From: Chris Morgan <macroalpha82@gmail.com>
To: linux-pm@vger.kernel.org
Cc: linux-iio@vger.kernel.org, andre.przywara@arm.com,
lee@kernel.org, wens@csie.org, sre@kernel.org, lars@metafoo.de,
jic23@kernel.org, Chris Morgan <macromorgan@hotmail.com>
Subject: [PATCH 2/2] power: supply: axp20x: Use devm_iio_channel_get_sys() for iio chans
Date: Tue, 10 Dec 2024 16:48:59 -0600 [thread overview]
Message-ID: <20241210224859.58917-3-macroalpha82@gmail.com> (raw)
In-Reply-To: <20241210224859.58917-1-macroalpha82@gmail.com>
From: Chris Morgan <macromorgan@hotmail.com>
Since commit e37ec3218870 ("mfd: axp20x: Allow multiple regulators")
the drivers for AC, battery, and USB have failed to probe when the
option of CONFIG_AXP20X_ADC is enabled. This appears to be because
the existing function devm_iio_channel_get() no longer calls
iio_channel_get_sys(). Use the newly created function of
devm_iio_channel_get_sys() instead.
Fixes: e37ec3218870 ("mfd: axp20x: Allow multiple regulators")
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
drivers/power/supply/axp20x_ac_power.c | 4 ++--
drivers/power/supply/axp20x_battery.c | 16 ++++++++--------
drivers/power/supply/axp20x_usb_power.c | 6 +++---
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c
index e5733cb9e19e..07de889af16b 100644
--- a/drivers/power/supply/axp20x_ac_power.c
+++ b/drivers/power/supply/axp20x_ac_power.c
@@ -343,14 +343,14 @@ static int axp20x_ac_power_probe(struct platform_device *pdev)
return -ENOMEM;
if (axp_data->acin_adc) {
- power->acin_v = devm_iio_channel_get(&pdev->dev, "acin_v");
+ power->acin_v = devm_iio_channel_get_sys(&pdev->dev, "acin_v");
if (IS_ERR(power->acin_v)) {
if (PTR_ERR(power->acin_v) == -ENODEV)
return -EPROBE_DEFER;
return PTR_ERR(power->acin_v);
}
- power->acin_i = devm_iio_channel_get(&pdev->dev, "acin_i");
+ power->acin_i = devm_iio_channel_get_sys(&pdev->dev, "acin_i");
if (IS_ERR(power->acin_i)) {
if (PTR_ERR(power->acin_i) == -ENODEV)
return -EPROBE_DEFER;
diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c
index fa27195f074e..152e556a4417 100644
--- a/drivers/power/supply/axp20x_battery.c
+++ b/drivers/power/supply/axp20x_battery.c
@@ -906,23 +906,23 @@ static const struct power_supply_desc axp717_batt_ps_desc = {
static int axp209_bat_cfg_iio_channels(struct platform_device *pdev,
struct axp20x_batt_ps *axp_batt)
{
- axp_batt->batt_v = devm_iio_channel_get(&pdev->dev, "batt_v");
+ axp_batt->batt_v = devm_iio_channel_get_sys(&pdev->dev, "batt_v");
if (IS_ERR(axp_batt->batt_v)) {
if (PTR_ERR(axp_batt->batt_v) == -ENODEV)
return -EPROBE_DEFER;
return PTR_ERR(axp_batt->batt_v);
}
- axp_batt->batt_chrg_i = devm_iio_channel_get(&pdev->dev,
- "batt_chrg_i");
+ axp_batt->batt_chrg_i = devm_iio_channel_get_sys(&pdev->dev,
+ "batt_chrg_i");
if (IS_ERR(axp_batt->batt_chrg_i)) {
if (PTR_ERR(axp_batt->batt_chrg_i) == -ENODEV)
return -EPROBE_DEFER;
return PTR_ERR(axp_batt->batt_chrg_i);
}
- axp_batt->batt_dischrg_i = devm_iio_channel_get(&pdev->dev,
- "batt_dischrg_i");
+ axp_batt->batt_dischrg_i = devm_iio_channel_get_sys(&pdev->dev,
+ "batt_dischrg_i");
if (IS_ERR(axp_batt->batt_dischrg_i)) {
if (PTR_ERR(axp_batt->batt_dischrg_i) == -ENODEV)
return -EPROBE_DEFER;
@@ -935,15 +935,15 @@ static int axp209_bat_cfg_iio_channels(struct platform_device *pdev,
static int axp717_bat_cfg_iio_channels(struct platform_device *pdev,
struct axp20x_batt_ps *axp_batt)
{
- axp_batt->batt_v = devm_iio_channel_get(&pdev->dev, "batt_v");
+ axp_batt->batt_v = devm_iio_channel_get_sys(&pdev->dev, "batt_v");
if (IS_ERR(axp_batt->batt_v)) {
if (PTR_ERR(axp_batt->batt_v) == -ENODEV)
return -EPROBE_DEFER;
return PTR_ERR(axp_batt->batt_v);
}
- axp_batt->batt_chrg_i = devm_iio_channel_get(&pdev->dev,
- "batt_chrg_i");
+ axp_batt->batt_chrg_i = devm_iio_channel_get_sys(&pdev->dev,
+ "batt_chrg_i");
if (IS_ERR(axp_batt->batt_chrg_i)) {
if (PTR_ERR(axp_batt->batt_chrg_i) == -ENODEV)
return -EPROBE_DEFER;
diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
index 9722912268fe..c82f05cef379 100644
--- a/drivers/power/supply/axp20x_usb_power.c
+++ b/drivers/power/supply/axp20x_usb_power.c
@@ -577,14 +577,14 @@ static int axp717_usb_power_prop_writeable(struct power_supply *psy,
static int axp20x_configure_iio_channels(struct platform_device *pdev,
struct axp20x_usb_power *power)
{
- power->vbus_v = devm_iio_channel_get(&pdev->dev, "vbus_v");
+ power->vbus_v = devm_iio_channel_get_sys(&pdev->dev, "vbus_v");
if (IS_ERR(power->vbus_v)) {
if (PTR_ERR(power->vbus_v) == -ENODEV)
return -EPROBE_DEFER;
return PTR_ERR(power->vbus_v);
}
- power->vbus_i = devm_iio_channel_get(&pdev->dev, "vbus_i");
+ power->vbus_i = devm_iio_channel_get_sys(&pdev->dev, "vbus_i");
if (IS_ERR(power->vbus_i)) {
if (PTR_ERR(power->vbus_i) == -ENODEV)
return -EPROBE_DEFER;
@@ -597,7 +597,7 @@ static int axp20x_configure_iio_channels(struct platform_device *pdev,
static int axp717_configure_iio_channels(struct platform_device *pdev,
struct axp20x_usb_power *power)
{
- power->vbus_v = devm_iio_channel_get(&pdev->dev, "vbus_v");
+ power->vbus_v = devm_iio_channel_get_sys(&pdev->dev, "vbus_v");
if (IS_ERR(power->vbus_v)) {
if (PTR_ERR(power->vbus_v) == -ENODEV)
return -EPROBE_DEFER;
--
2.43.0
next prev parent reply other threads:[~2024-12-10 22:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 22:48 [PATCH 0/2] Fix Regression with AXP20X for 6.13-rc1 Chris Morgan
2024-12-10 22:48 ` [PATCH 1/2] iio: core: Add devm_ API for iio_channel_get_sys Chris Morgan
2024-12-10 22:48 ` Chris Morgan [this message]
2024-12-11 21:58 ` [PATCH 0/2] Fix Regression with AXP20X for 6.13-rc1 Jonathan Cameron
2024-12-11 22:06 ` Jonathan Cameron
2024-12-16 18:01 ` Chris Morgan
2024-12-16 18:04 ` Chen-Yu Tsai
2025-03-04 18:18 ` Chris Morgan
2025-03-04 23:29 ` Jonathan Cameron
2025-03-06 2:19 ` Chris Morgan
2025-03-08 17:11 ` 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=20241210224859.58917-3-macroalpha82@gmail.com \
--to=macroalpha82@gmail.com \
--cc=andre.przywara@arm.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=lee@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=macromorgan@hotmail.com \
--cc=sre@kernel.org \
--cc=wens@csie.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