[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7dcee097-9119-1987-9bb5-777d541cc9f7@baylibre.com>
Date: Mon, 20 Sep 2021 10:26:30 +0200
From: Neil Armstrong <narmstrong@...libre.com>
To: Anand Moon <linux.amoon@...il.com>,
linux-arm-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jon Hunter <jonathanh@...dia.com>
Subject: Re: [PATCH] regulator: pwm-regulator: Make use of the helper function
dev_err_probe()
On 19/09/2021 23:11, Anand Moon wrote:
> devm_regulator_register can return -EPROBE_DEFER if the
> regulator is not ready yet. Use dev_err_probe() for
> pwm regulator resources to indicate the deferral reason
> when waiting for the resource to come up.
>
> Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")
>
> Cc: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
> Signed-off-by: Anand Moon <linux.amoon@...il.com>
> ---
> drivers/regulator/pwm-regulator.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
> index 7629476d94ae..451e57a739f8 100644
> --- a/drivers/regulator/pwm-regulator.c
> +++ b/drivers/regulator/pwm-regulator.c
> @@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
> &drvdata->desc, &config);
> if (IS_ERR(regulator)) {
> ret = PTR_ERR(regulator);
> - dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
> - drvdata->desc.name, ret);
> - return ret;
> + return dev_err_probe(&pdev->dev, ret,
> + "Failed to register regulator %s: %d\n",
> + drvdata->desc.name, ret);
No need to keep ret and print it since it will be printed by dev_err_probe, pass directly PTR_ERR(regulator) and drop the ": %d" from the error string.
Neil
> }
>
> return 0;
>
Powered by blists - more mailing lists