[PATCH] drm: panel: orisetech: improve error handling during probe

Akhilesh Patil posted 1 patch 2 months, 1 week ago
drivers/gpu/drm/panel/panel-orisetech-ota5601a.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
[PATCH] drm: panel: orisetech: improve error handling during probe
Posted by Akhilesh Patil 2 months, 1 week ago
Use dev_err_probe() helper as directed by core driver model to handle
driver probe error. Use standard helper defined at drivers/base/core.c
to maintain code consistency.

Inspired by,
commit a787e5400a1ce ("driver core: add device probe log helper")

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
---
 drivers/gpu/drm/panel/panel-orisetech-ota5601a.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
index fc87f61d4400..e971d1536654 100644
--- a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
+++ b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
@@ -277,11 +277,8 @@ static int ota5601a_probe(struct spi_device *spi)
 		       DRM_MODE_CONNECTOR_DPI);
 
 	err = drm_panel_of_backlight(&panel->drm_panel);
-	if (err) {
-		if (err != -EPROBE_DEFER)
-			dev_err(dev, "Failed to get backlight handle\n");
-		return err;
-	}
+	if (err)
+		return dev_err_probe(dev, err, "Failed to get backlight handle\n");
 
 	drm_panel_add(&panel->drm_panel);
 
-- 
2.34.1
Re: [PATCH] drm: panel: orisetech: improve error handling during probe
Posted by neil.armstrong@linaro.org 2 months ago
On 24/07/2025 18:08, Akhilesh Patil wrote:
> Use dev_err_probe() helper as directed by core driver model to handle
> driver probe error. Use standard helper defined at drivers/base/core.c
> to maintain code consistency.
> 
> Inspired by,
> commit a787e5400a1ce ("driver core: add device probe log helper")
> 
> Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
> ---
>   drivers/gpu/drm/panel/panel-orisetech-ota5601a.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
> index fc87f61d4400..e971d1536654 100644
> --- a/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
> +++ b/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
> @@ -277,11 +277,8 @@ static int ota5601a_probe(struct spi_device *spi)
>   		       DRM_MODE_CONNECTOR_DPI);
>   
>   	err = drm_panel_of_backlight(&panel->drm_panel);
> -	if (err) {
> -		if (err != -EPROBE_DEFER)
> -			dev_err(dev, "Failed to get backlight handle\n");
> -		return err;
> -	}
> +	if (err)
> +		return dev_err_probe(dev, err, "Failed to get backlight handle\n");
>   
>   	drm_panel_add(&panel->drm_panel);
>   

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Re: [PATCH] drm: panel: orisetech: improve error handling during probe
Posted by Neil Armstrong 2 months ago
Hi,

On Thu, 24 Jul 2025 21:38:32 +0530, Akhilesh Patil wrote:
> Use dev_err_probe() helper as directed by core driver model to handle
> driver probe error. Use standard helper defined at drivers/base/core.c
> to maintain code consistency.
> 
> Inspired by,
> commit a787e5400a1ce ("driver core: add device probe log helper")
> 
> [...]

Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next)

[1/1] drm: panel: orisetech: improve error handling during probe
      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/640d512caa64b569e58a08b540d9c400e1aa8f94

-- 
Neil