]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: iio: tsl2583: remove redundant write to the control register in taos_probe()
authorBrian Masney <masneyb@onstation.org>
Sat, 12 Nov 2016 18:19:20 +0000 (13:19 -0500)
committerJonathan Cameron <jic23@kernel.org>
Sun, 13 Nov 2016 13:07:20 +0000 (13:07 +0000)
taos_probe() calls i2c_smbus_write_byte() to select the control
register, however there are no subsequent calls to
i2c_smbus_read_byte(). The write call is unnecessary and is removed by
this patch.

Verified that the driver still functions correctly using a TSL2581
hooked up to a Raspberry Pi 2.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/light/tsl2583.c

index 5a32102e72d17d9e90ad7ddd029e481f72ece92c..449506bdffa4e9d0d8079b2b9131a4d6f2ac218c 100644 (file)
@@ -788,14 +788,6 @@ static int taos_probe(struct i2c_client *clientp,
                return -EINVAL;
        }
 
-       ret = i2c_smbus_write_byte(clientp, (TSL258X_CMD_REG | TSL258X_CNTRL));
-       if (ret < 0) {
-               dev_err(&clientp->dev,
-                       "i2c_smbus_write_byte() to cmd reg failed in taos_probe(), err = %d\n",
-                       ret);
-               return ret;
-       }
-
        indio_dev->info = &tsl2583_info;
        indio_dev->channels = tsl2583_channels;
        indio_dev->num_channels = ARRAY_SIZE(tsl2583_channels);