iio: accel: bma400: conversion to device-managed function
authorJagath Jog J <jagathjog1996@gmail.com>
Thu, 5 May 2022 13:30:14 +0000 (19:00 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 11 Jun 2022 13:35:26 +0000 (14:35 +0100)
commit12c99f859fd3da5fc8f8491826e7023001f54821
tree75895daed8f94afefd3b0c81cd4aa23db6768a71
parent1bd2dc6ea863690aee5c45ebf09c9194c7a42c0d
iio: accel: bma400: conversion to device-managed function

This is a conversion to device-managed by using devm_iio_device_register()
inside probe function. Previously the bma400 was not put into power down
mode in some error paths in probe where it now is, but that should cause
no harm.

The dev_set_drvdata() call, bma400_remove() function and hooks in the I2C
and SPI driver struct is removed as devm_iio_device_register() function is
used to automatically unregister on driver detach.

Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220505133021.22362-4-jagathjog1996@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/bma400.h
drivers/iio/accel/bma400_core.c
drivers/iio/accel/bma400_i2c.c
drivers/iio/accel/bma400_spi.c