iio: gyro: adxrs290: use hook for devm resource unwinding
authorNishant Malpani <nish.malpani25@gmail.com>
Thu, 10 Sep 2020 12:27:11 +0000 (17:57 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Sep 2020 09:45:47 +0000 (10:45 +0100)
commit5ac65da27ea8631d2032d47c0b9ef06c79d3446a
treee6bf54693130b50c1c9c5b89805bbf8861c68ee5
parenta5c69204dafc77cde34317e34f2f4fc93afd36df
iio: gyro: adxrs290: use hook for devm resource unwinding

Make use of devm_add_action_or_reset() hook to switch device into STANDBY
mode during standard resource unwinding. The patch includes a helper
function, in the form of adxrs290_set_mode(), to realise driving the
device into STANDBY mode.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200910122711.16670-1-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/gyro/adxrs290.c