diff options
author | Matti Vaittinen <mazziesaccount@gmail.com> | 2022-08-19 22:19:46 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-11-23 19:44:00 +0000 |
commit | 6900cdbfb99e8600572da340576509297a684a3a (patch) | |
tree | b534aaa7f2d582a40810a8b67bb480fd0e5c6c8f /drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | |
parent | 2c620883a46b6e2299cf9e4b4683e5b3cc67a61e (diff) | |
download | lwn-6900cdbfb99e8600572da340576509297a684a3a.tar.gz lwn-6900cdbfb99e8600572da340576509297a684a3a.zip |
iio: imu: st_lsm6dsx: Simplify using devm_regulator_*get_enable()
Use devm_regulator_bulk_get_enable() instead of open coded bulk-get,
bulk-enable, add-action-to-disable-at-detach - pattern.
A functional change (which seems like a bugfix) is that if
regulator_bulk_get fails, the enable is not attempted.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/876e58428cec056d51070e49eff559e2d7c23b12.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h')
-rw-r--r-- | drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h index d3a4e21bc114..07ad8027de73 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h @@ -374,7 +374,6 @@ struct st_lsm6dsx_sensor { * struct st_lsm6dsx_hw - ST IMU MEMS hw instance * @dev: Pointer to instance of struct device (I2C or SPI). * @regmap: Register map of the device. - * @regulators: VDD/VDDIO voltage regulators. * @irq: Device interrupt line (I2C or SPI). * @fifo_lock: Mutex to prevent concurrent access to the hw FIFO. * @conf_lock: Mutex to prevent concurrent FIFO configuration update. @@ -397,7 +396,6 @@ struct st_lsm6dsx_sensor { struct st_lsm6dsx_hw { struct device *dev; struct regmap *regmap; - struct regulator_bulk_data regulators[2]; int irq; struct mutex fifo_lock; |