From: Linus Walleij Date: Wed, 29 Jun 2016 12:08:37 +0000 (+0200) Subject: iio: magn: ak8975: make sure to power down at remove() X-Git-Tag: v4.8-rc1~193^2^2~34 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8d06cd25f745db8905e303cc915932cc50aa0ae5;p=karo-tx-linux.git 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 --- 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;