From: Andrey Skvortsov <andrej.skvortzov@gmail.com>
To: "Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Jonathan Marek" <jonathan@marek.ca>,
"Brian Masney" <masneyb@onstation.org>,
"Rob Herring" <robh@kernel.org>
Cc: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Subject: [PATCH v3 2/3] iio: imu: inv_mpu6050: use devres-enabled version of pm_runtime_enable
Date: Sun, 26 Apr 2026 14:23:33 +0300 [thread overview]
Message-ID: <20260426112334.3938774-3-andrej.skvortzov@gmail.com> (raw)
In-Reply-To: <20260426112334.3938774-1-andrej.skvortzov@gmail.com>
Usage of devm_pm_runtime_enable allows to remove driver-specific
action, that does the same as default action.
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
---
Changes in v3:
- remove extra blank lines in "use devres-enabled version of pm_runtime_enable"
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 49fdf33adec99..fc786aaeac5e5 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -1874,13 +1874,6 @@ 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 +2012,12 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
return dev_err_probe(dev, result,
"Failed to setup regulator cleanup action\n");
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.53.0
next prev parent reply other threads:[~2026-04-26 11:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-26 11:23 [PATCH v3 0/3] iio: imu: inv_mpu6050: runtime pm fixes Andrey Skvortsov
2026-04-26 11:23 ` [PATCH v3 1/3] iio: imu: inv_mpu6050: fix unbalanced regulator_disable calls, when probe fails Andrey Skvortsov
2026-04-26 14:43 ` Jonathan Cameron
2026-04-26 20:25 ` Andrey Skvortsov
2026-04-27 9:04 ` Jonathan Cameron
2026-04-27 8:28 ` Andy Shevchenko
2026-04-26 11:23 ` Andrey Skvortsov [this message]
2026-04-26 11:23 ` [PATCH v3 3/3] iio: imu: inv_mpu6050: control vdd supply using devm-helpers Andrey Skvortsov
2026-04-26 14:44 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260426112334.3938774-3-andrej.skvortzov@gmail.com \
--to=andrej.skvortzov@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=jonathan@marek.ca \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masneyb@onstation.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox