staging: iio: tsl2x7x: turn chip off if IIO device registration fails
authorBrian Masney <masneyb@onstation.org>
Fri, 11 May 2018 00:12:17 +0000 (20:12 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 12 May 2018 11:16:39 +0000 (12:16 +0100)
commitcc566e90cba70966b5c84ac373110d499b8be4ac
tree78ab78adaccd19684e49a86fa42bbe9d2b62ac9d
parent7b4db2e3e64a4a6028ff8cd1682df67df92a3ad4
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 <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/light/tsl2x7x.c