* [PATCH] drm/panel: ej030na: Make use of the helper function dev_err_probe()
@ 2021-09-16 10:42 Cai Huoqing
2021-10-14 20:15 ` Sam Ravnborg
0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-09-16 10:42 UTC (permalink / raw)
To: caihuoqing
Cc: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
dri-devel, linux-kernel
When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
And using dev_err_probe() can reduce code size, and the error value
gets printed.
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
drivers/gpu/drm/panel/panel-innolux-ej030na.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c b/drivers/gpu/drm/panel/panel-innolux-ej030na.c
index 34b98f70bd22..c558de3f99be 100644
--- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c
+++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c
@@ -198,16 +198,14 @@ static int ej030na_probe(struct spi_device *spi)
return -EINVAL;
priv->supply = devm_regulator_get(dev, "power");
- if (IS_ERR(priv->supply)) {
- dev_err(dev, "Failed to get power supply\n");
- return PTR_ERR(priv->supply);
- }
+ if (IS_ERR(priv->supply))
+ return dev_err_probe(dev, PTR_ERR(priv->supply),
+ "Failed to get power supply\n");
priv->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
- if (IS_ERR(priv->reset_gpio)) {
- dev_err(dev, "Failed to get reset GPIO\n");
- return PTR_ERR(priv->reset_gpio);
- }
+ if (IS_ERR(priv->reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(priv->reset_gpio),
+ "Failed to get reset GPIO\n");
drm_panel_init(&priv->panel, dev, &ej030na_funcs,
DRM_MODE_CONNECTOR_DPI);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/panel: ej030na: Make use of the helper function dev_err_probe()
2021-09-16 10:42 [PATCH] drm/panel: ej030na: Make use of the helper function dev_err_probe() Cai Huoqing
@ 2021-10-14 20:15 ` Sam Ravnborg
0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2021-10-14 20:15 UTC (permalink / raw)
To: Cai Huoqing
Cc: Thierry Reding, David Airlie, Daniel Vetter, dri-devel,
linux-kernel
Hi Cai,
On Thu, Sep 16, 2021 at 06:42:24PM +0800, Cai Huoqing wrote:
> When possible use dev_err_probe help to properly deal with the
> PROBE_DEFER error, the benefit is that DEFER issue will be logged
> in the devices_deferred debugfs file.
> And using dev_err_probe() can reduce code size, and the error value
> gets printed.
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Thanks for updating the panel drivers to use dev_err_probe().
I have applied all patches to drm-misc-next (11 in total + one
white space fix).
The patches will show up in -next in 1-2 weeks.
Sam
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-14 20:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-16 10:42 [PATCH] drm/panel: ej030na: Make use of the helper function dev_err_probe() Cai Huoqing
2021-10-14 20:15 ` Sam Ravnborg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox