summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorBiju Das <biju.das.jz@bp.renesas.com>2022-05-15 07:03:36 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-11 14:35:26 +0100
commit78f32011b24021bb96accc2a57791ce727cc166a (patch)
treeefa7ab2095fd9b436755732ff9f4932d2bf9579c /drivers/iio
parent153415feda2eec936e29be6d1e7f74375c5d6d0d (diff)
downloadlinux-stable-78f32011b24021bb96accc2a57791ce727cc166a.tar.gz
linux-stable-78f32011b24021bb96accc2a57791ce727cc166a.tar.bz2
linux-stable-78f32011b24021bb96accc2a57791ce727cc166a.zip
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 <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20220515060337.16513-3-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/rzg2l_adc.c3
1 files changed, 0 insertions, 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]);
}