Commit cc566e90 authored by Brian Masney's avatar Brian Masney Committed by Jonathan Cameron

staging: iio: tsl2x7x: turn chip off if IIO device registration fails

This patch turns the chip off if IIO device registration fails so that
the error handling mirrors the device remove to make review easier in
preparation for moving this driver out of staging.

This patch also adds a missing error check in the call to
tsl2x7x_chip_on() in tsl2x7x_probe().
Signed-off-by: Brian Masney's avatarBrian Masney <>
Signed-off-by: default avatarJonathan Cameron <>
parent 7b4db2e3
......@@ -1657,10 +1657,13 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
ret = tsl2x7x_chip_on(indio_dev);
if (ret < 0)
return ret;
ret = iio_device_register(indio_dev);
if (ret) {
"%s: iio registration failed\n", __func__);
return ret;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment