linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] soc: imx: gpcv2: print errno for regulator errors
@ 2022-06-09 11:17 Martin Kepplinger
  2022-06-19  7:15 ` Shawn Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Kepplinger @ 2022-06-09 11:17 UTC (permalink / raw)
  To: shawnguo, s.hauer, festevam
  Cc: kernel, kernel, linux-imx, linux-arm-kernel, linux-kernel,
	Martin Kepplinger

Make debugging of power management issues easier by printing the reason
why a regulator fails to be enabled or disabled.

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
---

revision history
----------------
v2: (thank you Ahmad)
 * use %pe format
 * sent out a bit early because it's pretty obvious
v1:
https://lore.kernel.org/linux-arm-kernel/64828809-1eb7-dff3-da57-95b545aefc22@pengutronix.de/T/#t


 drivers/soc/imx/gpcv2.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
index 85aa86e1338a..6383a4edc360 100644
--- a/drivers/soc/imx/gpcv2.c
+++ b/drivers/soc/imx/gpcv2.c
@@ -328,7 +328,9 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)
 	if (!IS_ERR(domain->regulator)) {
 		ret = regulator_enable(domain->regulator);
 		if (ret) {
-			dev_err(domain->dev, "failed to enable regulator\n");
+			dev_err(domain->dev,
+				"failed to enable regulator: %pe\n",
+				ERR_PTR(ret));
 			goto out_put_pm;
 		}
 	}
@@ -467,7 +469,9 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd)
 	if (!IS_ERR(domain->regulator)) {
 		ret = regulator_disable(domain->regulator);
 		if (ret) {
-			dev_err(domain->dev, "failed to disable regulator\n");
+			dev_err(domain->dev,
+				"failed to disable regulator: %pe\n",
+				ERR_PTR(ret));
 			return ret;
 		}
 	}
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] soc: imx: gpcv2: print errno for regulator errors
  2022-06-09 11:17 [PATCH v2] soc: imx: gpcv2: print errno for regulator errors Martin Kepplinger
@ 2022-06-19  7:15 ` Shawn Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2022-06-19  7:15 UTC (permalink / raw)
  To: Martin Kepplinger
  Cc: s.hauer, festevam, kernel, kernel, linux-imx, linux-arm-kernel,
	linux-kernel

On Thu, Jun 09, 2022 at 01:17:07PM +0200, Martin Kepplinger wrote:
> Make debugging of power management issues easier by printing the reason
> why a regulator fails to be enabled or disabled.
> 
> Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-19  7:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 11:17 [PATCH v2] soc: imx: gpcv2: print errno for regulator errors Martin Kepplinger
2022-06-19  7:15 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).