diff mbox

[RFC,2/9] drm/omap: Fail probe if irq registration fails

Message ID 9b81b22145e303cb33df02b6770e295c7418bad2.1518780268.git.jsarha@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jyri Sarha Feb. 16, 2018, 11:25 a.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>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart Feb. 27, 2018, 2:27 p.m. UTC | #1
Hi Jyri,

Thank you for the patch.

On Friday, 16 February 2018 13:25:03 EET 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>
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
> b/drivers/gpu/drm/omapdrm/omap_drv.c index 65a567d..979bede 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -321,7 +321,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);
> +	if (ret)
> +		return ret;
> 
>  	return 0;

Or maybe just

	return omap_drm_irq_install(dev);

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  }
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 65a567d..979bede 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -321,7 +321,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);
+	if (ret)
+		return ret;
 
 	return 0;
 }