diff mbox series

[v3,1/3] drm/omap: Fail probe if irq registration fails

Message ID 802e7cedf8a697deeef3f143cc1068520b35f2f6.1518001667.git.jsarha@ti.com
State Superseded
Headers show
Series drm/omap: Make omapdss API more generic + related patches | expand

Commit Message

Jyri Sarha Feb. 7, 2018, 2:11 p.m. UTC
Call to omap_drm_irq_install() may fail with an error code. In such a
case the driver probe should fail.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tomi Valkeinen Feb. 7, 2018, 1:29 p.m. UTC | #1
On 07/02/18 14:10, Jyri Sarha wrote:
> Call to omap_drm_irq_install() may fail with an error code. In such a
> case the driver probe should fail.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 71ea43f..e6e7a2c 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -329,9 +329,9 @@ static int omap_modeset_init(struct drm_device *dev)
>  
>  	drm_mode_config_reset(dev);
>  
> -	omap_drm_irq_install(dev);
> +	ret = omap_drm_irq_install(dev);
>  
> -	return 0;
> +	return ret;
>  }

It's better to do "if (ret) return ret;" so that it's easy (and less
error prone) to modify the code later.

Other than that:

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

 Tomi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 71ea43f..e6e7a2c 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -329,9 +329,9 @@  static int omap_modeset_init(struct drm_device *dev)
 
 	drm_mode_config_reset(dev);
 
-	omap_drm_irq_install(dev);
+	ret = omap_drm_irq_install(dev);
 
-	return 0;
+	return ret;
 }
 
 /*