mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Martin Kepplinger <martin.kepplinger@puri.sm>,
	shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com
Cc: kernel@puri.sm, linux-kernel@vger.kernel.org, linux-imx@nxp.com,
	kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] soc: imx: gpcv2: print errno for regulator errors
Date: Thu, 9 Jun 2022 11:47:23 +0200	[thread overview]
Message-ID: <64828809-1eb7-dff3-da57-95b545aefc22@pengutronix.de> (raw)
In-Reply-To: <20220609094453.2120099-1-martin.kepplinger@puri.sm>

Hello Martin,

On 09.06.22 11:44, 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>
> ---
>  drivers/soc/imx/gpcv2.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
> index 3cb123016b3e..311507a815c5 100644
> --- a/drivers/soc/imx/gpcv2.c
> +++ b/drivers/soc/imx/gpcv2.c
> @@ -233,7 +233,8 @@ 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: %d\n",
> +				ret);

You could make it even more approachable by using %pe.

>  			goto out_put_pm;
>  		}
>  	}
> @@ -372,7 +373,8 @@ 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: %d\n", ret);
>  			return ret;
>  		}
>  	}


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2022-06-09  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09  9:44 Martin Kepplinger
2022-06-09  9:47 ` Ahmad Fatoum [this message]

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=64828809-1eb7-dff3-da57-95b545aefc22@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kernel@puri.sm \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.kepplinger@puri.sm \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@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

all inboxes | Powered by JetHome®