summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-06-29 14:08:37 +0200
committerJonathan Cameron <jic23@kernel.org>2016-06-30 20:40:12 +0100
commit8d06cd25f745db8905e303cc915932cc50aa0ae5 (patch)
treec26b72fafd7c98c3b009feaac5a48b9e38fc18e9 /drivers/iio
parentb1037c1a498f9bb3b5a81c2f243c605c190da754 (diff)
iio: magn: ak8975: make sure to power down at remove()
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>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/magnetometer/ak8975.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index bf3ffc4ae5c7..3e12201b823f 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -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;