Browse Source

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>
Linus Walleij 9 years ago
parent
commit
8d06cd25f7
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/iio/magnetometer/ak8975.c

+ 1 - 0
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;