From: Biju Das Date: Sun, 15 May 2022 06:03:36 +0000 (+0100) Subject: iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=78f32011b24021bb96accc2a57791ce727cc166a;p=linux.git iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label() 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 Link: https://lore.kernel.org/r/20220515060337.16513-3-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c index 7585144b9715b..bee5f9861acba 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]); }