diff options
-rw-r--r-- | drivers/staging/iio/light/tsl2x7x.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index c1e726fc87b7..f5ca5ada0358 100644 --- a/drivers/staging/iio/light/tsl2x7x.c +++ b/drivers/staging/iio/light/tsl2x7x.c @@ -1657,10 +1657,13 @@ static int tsl2x7x_probe(struct i2c_client *clientp, } tsl2x7x_defaults(chip); - tsl2x7x_chip_on(indio_dev); + ret = tsl2x7x_chip_on(indio_dev); + if (ret < 0) + return ret; ret = iio_device_register(indio_dev); if (ret) { + tsl2x7x_chip_off(indio_dev); dev_err(&clientp->dev, "%s: iio registration failed\n", __func__); return ret; |