]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iio: magn: ak8975: make sure to power down at remove()
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 29 Jun 2016 12:08:37 +0000 (14:08 +0200)
committerJonathan Cameron <jic23@kernel.org>
Thu, 30 Jun 2016 19:40:12 +0000 (20:40 +0100)
The code was not powering the magnetometer down properly at
remove(): just cutting the regulators without first setting the
device in power off mode. Fix this.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/magnetometer/ak8975.c

index bf3ffc4ae5c711904775ea37f8ba08a5c4ed1c89..3e12201b823f25a3ecb650aff62a13276f4e3b73 100644 (file)
@@ -991,6 +991,7 @@ static int ak8975_remove(struct i2c_client *client)
 
        iio_device_unregister(indio_dev);
        iio_triggered_buffer_cleanup(indio_dev);
+       ak8975_set_mode(data, POWER_DOWN);
        ak8975_power_off(data);
 
        return 0;