From 8d06cd25f745db8905e303cc915932cc50aa0ae5 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Wed, 29 Jun 2016 14:08:37 +0200 Subject: [PATCH] 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 Reviewed-by: Ulf Hansson Signed-off-by: Jonathan Cameron --- drivers/iio/magnetometer/ak8975.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.20.1