diff mbox series

drm: rcar-du: lvds: use dev_err_probe()

Message ID 20210623030646.7720-1-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State Mainlined
Commit 6571a76af380290dd9a003a3bc90d4779ec4f8f8
Delegated to: Kieran Bingham
Headers show
Series drm: rcar-du: lvds: use dev_err_probe() | expand

Commit Message

Laurent Pinchart June 23, 2021, 3:06 a.m. UTC
Simplify error handling by using the dev_err_probe() function.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/gpu/drm/rcar-du/rcar_lvds.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Kieran Bingham June 23, 2021, 8:48 a.m. UTC | #1
Hi Laurent,

On 23/06/2021 04:06, Laurent Pinchart wrote:
> Simplify error handling by using the dev_err_probe() function.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  drivers/gpu/drm/rcar-du/rcar_lvds.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> index 5909173b26eb..165be31c4c45 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> @@ -839,9 +839,8 @@ static struct clk *rcar_lvds_get_clock(struct rcar_lvds *lvds, const char *name,
>  	if (PTR_ERR(clk) == -ENOENT && optional)
>  		return NULL;
>  
> -	if (PTR_ERR(clk) != -EPROBE_DEFER)
> -		dev_err(lvds->dev, "failed to get %s clock\n",
> -			name ? name : "module");
> +	dev_err_probe(lvds->dev, PTR_ERR(clk), "failed to get %s clock\n",
> +		      name ? name : "module");

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

>  
>  	return clk;
>  }
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index 5909173b26eb..165be31c4c45 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -839,9 +839,8 @@  static struct clk *rcar_lvds_get_clock(struct rcar_lvds *lvds, const char *name,
 	if (PTR_ERR(clk) == -ENOENT && optional)
 		return NULL;
 
-	if (PTR_ERR(clk) != -EPROBE_DEFER)
-		dev_err(lvds->dev, "failed to get %s clock\n",
-			name ? name : "module");
+	dev_err_probe(lvds->dev, PTR_ERR(clk), "failed to get %s clock\n",
+		      name ? name : "module");
 
 	return clk;
 }