diff mbox

drm: rcar-du: EPROBE_DEFER case doesn't need error message

Message ID 87posc9gg6.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Kuninori Morimoto May 24, 2016, 5:24 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

EPROBE_DEFER is not error, thus, error message on kernel log on this
case is confusable for user. Prints it only error cases.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart May 24, 2016, 1:32 p.m. UTC | #1
Hi Morimoto-san,

Thank you for the patch.

On Tuesday 24 May 2016 14:24:09 Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> EPROBE_DEFER is not error, thus, error message on kernel log on this
> case is confusable for user. Prints it only error cases.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/gpu/drm/rcar-du/rcar_du_drv.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 26fd3ba..1db080c 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -354,14 +354,16 @@ static int rcar_du_probe(struct platform_device *pdev)
> */
>  	ret = drm_vblank_init(ddev, (1 << rcdu->info->num_crtcs) - 1);
>  	if (ret < 0) {
> -		dev_err(&pdev->dev, "failed to initialize vblank\n");
> +		if (ret != -EPROBE_DEFER)

I don't think this can ever happen. Actually, the only reason 
drm_vblank_init() could return an error at the moment is a kcalloc() failure, 
so we could remove this message completely.

> +			dev_err(&pdev->dev, "failed to initialize vblank\n");
>  		goto error;
>  	}
> 
>  	/* DRM/KMS objects */
>  	ret = rcar_du_modeset_init(rcdu);
>  	if (ret < 0) {
> -		dev_err(&pdev->dev, "failed to initialize DRM/KMS (%d)\n", ret);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(&pdev->dev, "failed to initialize DRM/KMS (%d)\n", ret);
>  		goto error;
>  	}
Kuninori Morimoto May 25, 2016, 12:13 a.m. UTC | #2
Hi Laurent

> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > 
> > EPROBE_DEFER is not error, thus, error message on kernel log on this
> > case is confusable for user. Prints it only error cases.
> > 
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > ---
> >  drivers/gpu/drm/rcar-du/rcar_du_drv.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> > b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 26fd3ba..1db080c 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> > @@ -354,14 +354,16 @@ static int rcar_du_probe(struct platform_device *pdev)
> > */
> >  	ret = drm_vblank_init(ddev, (1 << rcdu->info->num_crtcs) - 1);
> >  	if (ret < 0) {
> > -		dev_err(&pdev->dev, "failed to initialize vblank\n");
> > +		if (ret != -EPROBE_DEFER)
> 
> I don't think this can ever happen. Actually, the only reason 
> drm_vblank_init() could return an error at the moment is a kcalloc() failure, 
> so we could remove this message completely.

OK, will send v2 patch

Best regards
---
Kuninori Morimoto
diff mbox

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index 26fd3ba..1db080c 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -354,14 +354,16 @@  static int rcar_du_probe(struct platform_device *pdev)
 	 */
 	ret = drm_vblank_init(ddev, (1 << rcdu->info->num_crtcs) - 1);
 	if (ret < 0) {
-		dev_err(&pdev->dev, "failed to initialize vblank\n");
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "failed to initialize vblank\n");
 		goto error;
 	}
 
 	/* DRM/KMS objects */
 	ret = rcar_du_modeset_init(rcdu);
 	if (ret < 0) {
-		dev_err(&pdev->dev, "failed to initialize DRM/KMS (%d)\n", ret);
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "failed to initialize DRM/KMS (%d)\n", ret);
 		goto error;
 	}