[PATCHv2] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
Martin Blumenstingl
martin.blumenstingl at googlemail.com
Mon Sep 20 22:34:06 PDT 2021
Hi Anand,
On Mon, Sep 20, 2021 at 10:38 PM Anand Moon <linux.amoon at gmail.com> wrote:
>
> devm_pwm_get() can return -EPROBE_DEFER if the pwm 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")
Personally I consider this as an improvement (having the deferral
reason show up in debugfs), not a bugfix.
Because of that I would drop the Fixes tag.
Let's wait on other people's opinions though.
[...]
> - dev_err(&pdev->dev, "Failed to get PWM: %d\n", ret);
> - return ret;
> + return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->pwm),
> + "Failed to register regulator %s\n",
The message here should still be similar to the original one since the
actual problem is that we could not get a reference to the PWM
controller. At this point we are not trying to register the
pwm-regulator yet.
Best regards,
Martin
More information about the linux-amlogic
mailing list