[PATCH v2 1/3] iio: imu: inv_mpu6050: use devres-enabled version of pm_runtime_enable

Andrey Skvortsov posted 3 patches 13 hours ago
[PATCH v2 1/3] iio: imu: inv_mpu6050: use devres-enabled version of pm_runtime_enable
Posted by Andrey Skvortsov 13 hours ago
That allows remove driver-specific action, that does the same as
default action.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 5796896d54cd8..84eb0ee770086 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -1872,12 +1872,7 @@ static void inv_mpu_core_disable_regulator_action(void *_data)
 	inv_mpu_core_disable_regulator_vddio(st);
 }
 
-static void inv_mpu_pm_disable(void *data)
-{
-	struct device *dev = data;
 
-	pm_runtime_disable(dev);
-}
 
 int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
 		int (*inv_mpu_bus_setup)(struct iio_dev *), int chip_type)
@@ -2019,13 +2014,12 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
 	if (result)
 		goto error_power_off;
 	pm_runtime_get_noresume(dev);
-	pm_runtime_enable(dev);
+	result = devm_pm_runtime_enable(dev);
+	if (result)
+		return result;
 	pm_runtime_set_autosuspend_delay(dev, INV_MPU6050_SUSPEND_DELAY_MS);
 	pm_runtime_use_autosuspend(dev);
 	pm_runtime_put(dev);
-	result = devm_add_action_or_reset(dev, inv_mpu_pm_disable, dev);
-	if (result)
-		return result;
 
 	switch (chip_type) {
 	case INV_MPU6000:
-- 
2.51.0
Re: [PATCH v2 1/3] iio: imu: inv_mpu6050: use devres-enabled version of pm_runtime_enable
Posted by Andy Shevchenko 7 hours ago
On Wed, Apr 01, 2026 at 11:27:35AM +0300, Andrey Skvortsov wrote:
> That allows remove driver-specific action, that does the same as
> default action.

Don't use the Subject as the first sentence in the explanation. Id est
always start a commit message as no Subject was ever existed.

-- 
With Best Regards,
Andy Shevchenko