staging: iio: tsl2x7x: simplify tsl2x7x_write_interrupt_config return
authorBrian Masney <masneyb@onstation.org>
Sat, 21 Apr 2018 00:41:46 +0000 (20:41 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 28 Apr 2018 15:17:59 +0000 (16:17 +0100)
tsl2x7x_write_interrupt_config() has an unnecessary return value check
at the end of the function. This patch changes the function to just
return the value from the call to tsl2x7x_invoke_change().

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/light/tsl2x7x.c

index 21286b2..1a7189d 100644 (file)
@@ -990,18 +990,13 @@ static int tsl2x7x_write_interrupt_config(struct iio_dev *indio_dev,
                                          int val)
 {
        struct tsl2X7X_chip *chip = iio_priv(indio_dev);
-       int ret;
 
        if (chan->type == IIO_INTENSITY)
                chip->settings.als_interrupt_en = val ? true : false;
        else
                chip->settings.prox_interrupt_en = val ? true : false;
 
-       ret = tsl2x7x_invoke_change(indio_dev);
-       if (ret < 0)
-               return ret;
-
-       return 0;
+       return tsl2x7x_invoke_change(indio_dev);
 }
 
 static int tsl2x7x_write_event_value(struct iio_dev *indio_dev,