2024-05-06 15:59:55

by David Lechner

[permalink] [raw]
Subject: [PATCH 0/2] regulator: devm_regulator_get_enable_read_voltage fixes

I was going to send a v3 of [1] with these changes, but v2 was partially
applied so here they are as additional patches.

[1] https://lore.kernel.org/all/20240429-regulator-get-enable-get-votlage-v2-0-b1f11ab766c1@baylibre.com/

---
David Lechner (2):
regulator: devres: fix devm_regulator_get_enable_read_voltage() return
hwmon: (adc128d818) simplify final return in probe

drivers/hwmon/adc128d818.c | 4 +---
drivers/regulator/devres.c | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)
---
base-commit: 4f6454d1bf73255e49c02d0a7b3bb85146863098
change-id: 20240506-regulator-devm_regulator_get_enable_read_voltage-fixes-b1f2277763fd


2024-05-06 16:00:08

by David Lechner

[permalink] [raw]
Subject: [PATCH 1/2] regulator: devres: fix devm_regulator_get_enable_read_voltage() return

The devm_regulator_get_enable_read_voltage() function is supposed to
return the voltage that the regulator is currently set to. However, it
currently returns 0.

Fixes: b250c20b6429 ("regulator: devres: add API for reference voltage supplies")
Signed-off-by: David Lechner <[email protected]>
---
drivers/regulator/devres.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c
index 4f290b9b559b..7111c46e9de1 100644
--- a/drivers/regulator/devres.c
+++ b/drivers/regulator/devres.c
@@ -193,7 +193,7 @@ int devm_regulator_get_enable_read_voltage(struct device *dev, const char *id)
if (ret < 0)
goto err_release_action;

- return 0;
+ return ret;

err_release_action:
devm_release_action(dev, regulator_action_disable, r);

--
2.43.2


2024-05-06 16:02:02

by David Lechner

[permalink] [raw]
Subject: [PATCH 2/2] hwmon: (adc128d818) simplify final return in probe

The final return in adc128d818_probe() can be simplified by using
PTR_ERR_OR_ZERO rather than an if statement.

Suggested-by: Guenter Roeck <[email protected]>
Signed-off-by: David Lechner <[email protected]>
---
drivers/hwmon/adc128d818.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/hwmon/adc128d818.c b/drivers/hwmon/adc128d818.c
index 2a35acb011eb..321a61977396 100644
--- a/drivers/hwmon/adc128d818.c
+++ b/drivers/hwmon/adc128d818.c
@@ -475,10 +475,8 @@ static int adc128_probe(struct i2c_client *client)

hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
data, adc128_groups);
- if (IS_ERR(hwmon_dev))
- return PTR_ERR(hwmon_dev);

- return 0;
+ return PTR_ERR_OR_ZERO(hwmon_dev);
}

static const struct i2c_device_id adc128_id[] = {

--
2.43.2


2024-05-06 23:19:52

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 2/2] hwmon: (adc128d818) simplify final return in probe

On Mon, May 06, 2024 at 10:59:16AM -0500, David Lechner wrote:
> The final return in adc128d818_probe() can be simplified by using
> PTR_ERR_OR_ZERO rather than an if statement.
>
> Suggested-by: Guenter Roeck <[email protected]>
> Signed-off-by: David Lechner <[email protected]>

Acked-by: Guenter Roeck <[email protected]>

.. assuming the patch will be applied as part of the previous series.
Otherwise I'll apply it after that series is upstream.

Thanks,
Guenter

2024-05-07 15:28:45

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/2] regulator: devm_regulator_get_enable_read_voltage fixes

On Mon, 06 May 2024 10:59:14 -0500, David Lechner wrote:
> I was going to send a v3 of [1] with these changes, but v2 was partially
> applied so here they are as additional patches.
>
> [1] https://lore.kernel.org/all/20240429-regulator-get-enable-get-votlage-v2-0-b1f11ab766c1@baylibre.com/
>

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/2] regulator: devres: fix devm_regulator_get_enable_read_voltage() return
commit: 257b2335eebf51e318db1f3b2d023512da46fa66
[2/2] hwmon: (adc128d818) simplify final return in probe
commit: 346fe0ce1fd780038ca9e5bcb65aad54bae7c4d9

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark