diff mbox series

[2/3] regulator: bd9571mwv: Fix regulator name printed on registration failure

Message ID 20210312130242.3390038-3-geert+renesas@glider.be (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show
Series regulator: bd9571mwv: Miscellaneous fixes and improvements | expand

Commit Message

Geert Uytterhoeven March 12, 2021, 1:02 p.m. UTC
If a regulator fails to register, the driver prints an error message
like:

    bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to register bd9571mwv-regulator regulator

However, the platform device's name is already printed as part of
dev_err(), and does not allow the user to distinguish among the various
regulators that are part of the PMIC.

Fix this by printing regulator_desc.name instead, to change the message
like:

    bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to register DVFS regulator

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/regulator/bd9571mwv-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matti Vaittinen March 15, 2021, 5:49 a.m. UTC | #1
On Fri, 2021-03-12 at 14:02 +0100, Geert Uytterhoeven wrote:
> If a regulator fails to register, the driver prints an error message
> like:
> 
>     bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to
> register bd9571mwv-regulator regulator
> 
> However, the platform device's name is already printed as part of
> dev_err(), and does not allow the user to distinguish among the
> various
> regulators that are part of the PMIC.
> 
> Fix this by printing regulator_desc.name instead, to change the
> message
> like:
> 
>     bd9571mwv-regulator bd9571mwv-regulator.6.auto: failed to
> register DVFS regulator
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
diff mbox series

Patch

diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c
index 13393cdc6be1497e..a4d406022587d59d 100644
--- a/drivers/regulator/bd9571mwv-regulator.c
+++ b/drivers/regulator/bd9571mwv-regulator.c
@@ -301,7 +301,7 @@  static int bd9571mwv_regulator_probe(struct platform_device *pdev)
 					       &config);
 		if (IS_ERR(rdev)) {
 			dev_err(&pdev->dev, "failed to register %s regulator\n",
-				pdev->name);
+				regulators[i].name);
 			return PTR_ERR(rdev);
 		}
 	}