diff mbox series

[v2,2/2] iio: adc: rzg2l_adc: Remove unnecessary channel check from rzg2l_adc_read_label()

Message ID 20220505184037.511295-3-biju.das.jz@bp.renesas.com (mailing list archive)
State Changes Requested
Headers show
Series Add RZ/G2UL support | expand

Commit Message

Biju Das May 5, 2022, 6:40 p.m. UTC
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>
---
v2:
 * New patch
---
 drivers/iio/adc/rzg2l_adc.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Geert Uytterhoeven May 6, 2022, 7:17 a.m. UTC | #1
On Thu, May 5, 2022 at 8:40 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> 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>
> ---
> v2:
>  * New patch

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox series

Patch

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]);
 }