diff mbox series

[3/7] iio: light: ltr501: simplify code in write_event_config callback

Message ID 20241024-iio-fix-write-event-config-signature-v1-3-7d29e5a31b00@baylibre.com (mailing list archive)
State Accepted
Headers show
Series iio: fix write_event_config signature | expand

Commit Message

Julien Stephan Oct. 24, 2024, 9:11 a.m. UTC
iio_ev_state_store is actually using kstrtobool to check user
input, then gives the converted boolean value to the write_event_config
callback.

Remove useless code in write_event_config callback.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
---
 drivers/iio/light/ltr501.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Jonathan Cameron Oct. 26, 2024, 12:23 p.m. UTC | #1
On Thu, 24 Oct 2024 11:11:25 +0200
Julien Stephan <jstephan@baylibre.com> wrote:

> iio_ev_state_store is actually using kstrtobool to check user
> input, then gives the converted boolean value to the write_event_config
> callback.
> 
> Remove useless code in write_event_config callback.
> 
> Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Applied.
diff mbox series

Patch

diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index 8c516ede911619bb4ee8f8a823f242b7aaa6af55..42daebd6023456098dc4bcedc3fe3a45f9ae5be0 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -1083,10 +1083,6 @@  static int ltr501_write_event_config(struct iio_dev *indio_dev,
 	struct ltr501_data *data = iio_priv(indio_dev);
 	int ret;
 
-	/* only 1 and 0 are valid inputs */
-	if (state != 1  && state != 0)
-		return -EINVAL;
-
 	switch (chan->type) {
 	case IIO_INTENSITY:
 		mutex_lock(&data->lock_als);