[PATCH v3 7/8] iio: tcs3472: move standalone return to default case

From: Aldo Conte

Date: Fri May 22 2026 - 09:18:21 EST


Move the trailing 'return -EINVAL' statements at the end of
tcs3472_read_raw() and tcs3472_write_raw() into explicit default:
cases inside the respective switch statements.

This removes the need for a separate return statement
after the switch.

No functional change.

Suggested-by: Andy Shevchenko <andy@xxxxxxxxxx>
Reviewed-by: Andy Shevchenko <andy@xxxxxxxxxx>
Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
Signed-off-by: Aldo Conte <aldocontelk@xxxxxxxxx>
---
v3:
- No changes.

drivers/iio/light/tcs3472.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c
index f74e6633db45..1f597ca93697 100644
--- a/drivers/iio/light/tcs3472.c
+++ b/drivers/iio/light/tcs3472.c
@@ -166,8 +166,9 @@ static int tcs3472_read_raw(struct iio_dev *indio_dev,
*val = 0;
*val2 = (256 - data->atime) * 2400;
return IIO_VAL_INT_PLUS_MICRO;
+ default:
+ return -EINVAL;
}
- return -EINVAL;
}

static int tcs3472_write_raw(struct iio_dev *indio_dev,
@@ -204,8 +205,9 @@ static int tcs3472_write_raw(struct iio_dev *indio_dev,

}
return -EINVAL;
+ default:
+ return -EINVAL;
}
- return -EINVAL;
}

/*
--
2.54.0