* [PATCH -next] backlight: pwm_bl: Switch to use dev_err_probe() helper
@ 2022-09-26 13:32 Yang Yingliang
2022-09-26 13:37 ` Daniel Thompson
0 siblings, 1 reply; 4+ messages in thread
From: Yang Yingliang @ 2022-09-26 13:32 UTC (permalink / raw)
To: linux-fbdev, linux-pwm, dri-devel
Cc: daniel.thompson, thierry.reding, lee, u.kleine-koenig
In the probe path, dev_err() can be replaced with dev_err_probe()
which will check if error code is -EPROBE_DEFER and prints the
error name. It also sets the defer probe reason which can be
checked later through debugfs. It's more simple in error path.
---
drivers/video/backlight/pwm_bl.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index c0523a0269ee..ae858e3bd38f 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -513,9 +513,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
}
if (IS_ERR(pb->pwm)) {
- ret = PTR_ERR(pb->pwm);
- if (ret != -EPROBE_DEFER)
- dev_err(&pdev->dev, "unable to request PWM\n");
+ ret = dev_err_probe(&pdev->dev, PTR_ERR(pb->pwm),
+ "unable to request PWM\n");
goto err_alloc;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] backlight: pwm_bl: Switch to use dev_err_probe() helper
2022-09-26 13:32 [PATCH -next] backlight: pwm_bl: Switch to use dev_err_probe() helper Yang Yingliang
@ 2022-09-26 13:37 ` Daniel Thompson
2022-09-26 13:41 ` Daniel Thompson
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Thompson @ 2022-09-26 13:37 UTC (permalink / raw)
To: Yang Yingliang
Cc: linux-pwm, linux-fbdev, lee, dri-devel, thierry.reding, u.kleine-koenig
On Mon, Sep 26, 2022 at 09:32:58PM +0800, Yang Yingliang wrote:
> In the probe path, dev_err() can be replaced with dev_err_probe()
> which will check if error code is -EPROBE_DEFER and prints the
> error name. It also sets the defer probe reason which can be
> checked later through debugfs. It's more simple in error path.
I'd prefer to have received these patches as a patchset rather than
individual patches... but it is a good change so:
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Daniel.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] backlight: pwm_bl: Switch to use dev_err_probe() helper
2022-09-26 13:37 ` Daniel Thompson
@ 2022-09-26 13:41 ` Daniel Thompson
2022-09-26 14:00 ` Yang Yingliang
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Thompson @ 2022-09-26 13:41 UTC (permalink / raw)
To: Yang Yingliang
Cc: linux-pwm, linux-fbdev, lee, dri-devel, thierry.reding, u.kleine-koenig
On Mon, Sep 26, 2022 at 02:37:50PM +0100, Daniel Thompson wrote:
> On Mon, Sep 26, 2022 at 09:32:58PM +0800, Yang Yingliang wrote:
> > In the probe path, dev_err() can be replaced with dev_err_probe()
> > which will check if error code is -EPROBE_DEFER and prints the
> > error name. It also sets the defer probe reason which can be
> > checked later through debugfs. It's more simple in error path.
>
> I'd prefer to have received these patches as a patchset rather than
> individual patches... but it is a good change so:
>
> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Oops. My last mail neglected to mention that you did not sign off your
changes (meaning we cannot accept them). When you re-send this please
add a SoB and combine with the other similar patches.
Daniel.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] backlight: pwm_bl: Switch to use dev_err_probe() helper
2022-09-26 13:41 ` Daniel Thompson
@ 2022-09-26 14:00 ` Yang Yingliang
0 siblings, 0 replies; 4+ messages in thread
From: Yang Yingliang @ 2022-09-26 14:00 UTC (permalink / raw)
To: Daniel Thompson
Cc: linux-pwm, linux-fbdev, lee, dri-devel, thierry.reding, u.kleine-koenig
Hi,
On 2022/9/26 21:41, Daniel Thompson wrote:
> On Mon, Sep 26, 2022 at 02:37:50PM +0100, Daniel Thompson wrote:
>> On Mon, Sep 26, 2022 at 09:32:58PM +0800, Yang Yingliang wrote:
>>> In the probe path, dev_err() can be replaced with dev_err_probe()
>>> which will check if error code is -EPROBE_DEFER and prints the
>>> error name. It also sets the defer probe reason which can be
>>> checked later through debugfs. It's more simple in error path.
>> I'd prefer to have received these patches as a patchset rather than
>> individual patches... but it is a good change so:
>>
>> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
> Oops. My last mail neglected to mention that you did not sign off your
> changes (meaning we cannot accept them). When you re-send this please
> add a SoB and combine with the other similar patches.
I missed -s when doing format-patch, I will add my SoB and your reivew
tag in v2.
Thanks,
Yang
>
>
> Daniel.
> .
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-26 14:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 13:32 [PATCH -next] backlight: pwm_bl: Switch to use dev_err_probe() helper Yang Yingliang
2022-09-26 13:37 ` Daniel Thompson
2022-09-26 13:41 ` Daniel Thompson
2022-09-26 14:00 ` Yang Yingliang
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).