From patchwork Wed May 11 08:23:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 12845925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BF5BC433F5 for ; Wed, 11 May 2022 08:23:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243615AbiEKIXl (ORCPT ); Wed, 11 May 2022 04:23:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243642AbiEKIXl (ORCPT ); Wed, 11 May 2022 04:23:41 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00B8549F85; Wed, 11 May 2022 01:23:39 -0700 (PDT) X-IronPort-AV: E=Sophos;i="5.91,216,1647270000"; d="scan'208";a="120627852" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 11 May 2022 17:23:39 +0900 Received: from localhost.localdomain (unknown [10.226.92.143]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 49AB4400F50E; Wed, 11 May 2022 17:23:36 +0900 (JST) From: Biju Das To: Jonathan Cameron Cc: Biju Das , Lad Prabhakar , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , Chris Paterson , Biju Das Subject: [PATCH v4 2/2] iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label() Date: Wed, 11 May 2022 09:23:25 +0100 Message-Id: <20220511082325.36185-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220511082325.36185-1-biju.das.jz@bp.renesas.com> References: <20220511082325.36185-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Remove unnecessary channel check from rzg2l_adc_read_label(), as the channel error handling is already done in probe(). Therefore no need to validate at runtime. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven --- v3->v4: * No Change. v2->v3: * Added Rb tag from Geert. v2: * New patch --- drivers/iio/adc/rzg2l_adc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c index 7585144b9715..bee5f9861acb 100644 --- a/drivers/iio/adc/rzg2l_adc.c +++ b/drivers/iio/adc/rzg2l_adc.c @@ -260,9 +260,6 @@ static int rzg2l_adc_read_label(struct iio_dev *iio_dev, const struct iio_chan_spec *chan, char *label) { - if (chan->channel >= RZG2L_ADC_MAX_CHANNELS) - return -EINVAL; - return sysfs_emit(label, "%s\n", rzg2l_adc_channel_name[chan->channel]); }