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@googlemail.com>
Signed-off-by: Anand Moon <redacted>
---
drivers/regulator/pwm-regulator.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Neil Armstrong <hidden> Date: 2021-09-20 08:26:40
On 19/09/2021 23:11, Anand Moon wrote:
quoted hunk
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@googlemail.com>
Signed-off-by: Anand Moon <redacted>
---
drivers/regulator/pwm-regulator.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -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);-returnret;+returndev_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
Hi Neil,
On Mon, 20 Sept 2021 at 13:56, Neil Armstrong [off-list ref] wrote:
On 19/09/2021 23:11, Anand Moon wrote:
quoted
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@googlemail.com>
Signed-off-by: Anand Moon <redacted>
---
drivers/regulator/pwm-regulator.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -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);-returnret;+returndev_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
Thanks for the input but it's a wrong fix I meant to fix another probe
defer with *devm_pwm_get*
I will correct this in the next version..
Thanks
-Anand