From: Julien Stephan Date: Thu, 24 Oct 2024 09:11:28 +0000 (+0200) Subject: iio: light: stk3310: simplify code in write_event_config callback X-Git-Tag: v6.13-rc1~28^2~11^2~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7804363d596a8f9e0f0643155b796b5cd629eea2;p=thirdparty%2Flinux.git iio: light: stk3310: simplify code in write_event_config callback 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 Link: https://patch.msgid.link/20241024-iio-fix-write-event-config-signature-v1-6-7d29e5a31b00@baylibre.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index ed20b67145463..c6f950af5afa0 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -330,9 +330,6 @@ static int stk3310_write_event_config(struct iio_dev *indio_dev, struct stk3310_data *data = iio_priv(indio_dev); struct i2c_client *client = data->client; - if (state < 0 || state > 7) - return -EINVAL; - /* Set INT_PS value */ mutex_lock(&data->lock); ret = regmap_field_write(data->reg_int_ps, state);