[07/11] drm/msm: Make irq_postinstall optional

Submitted by Jordan Crouse on Nov. 5, 2018, 11:30 p.m.

Details

Message ID 20181105233103.7657-8-jcrouse@codeaurora.org
State New
Headers show
Series "DPU cleanups" ( rev: 2 1 ) in Freedreno

Not browsing as part of any series.

Commit Message

Jordan Crouse Nov. 5, 2018, 11:30 p.m.
Allow the KMS operation 'irq_postinstall' to be optional
so that the target display drivers don't need to define
a dummy function if they don't need one.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---
 drivers/gpu/drm/msm/msm_drv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 9c9f7ff6960b..d8af97407b3c 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -724,7 +724,11 @@  static int msm_irq_postinstall(struct drm_device *dev)
 	struct msm_drm_private *priv = dev->dev_private;
 	struct msm_kms *kms = priv->kms;
 	BUG_ON(!kms);
-	return kms->funcs->irq_postinstall(kms);
+
+	if (kms->funcs->irq_postinstall)
+		return kms->funcs->irq_postinstall(kms);
+
+	return 0;
 }
 
 static void msm_irq_uninstall(struct drm_device *dev)

Comments

On Mon, Nov 05, 2018 at 04:30:59PM -0700, Jordan Crouse wrote:
> Allow the KMS operation 'irq_postinstall' to be optional
> so that the target display drivers don't need to define
> a dummy function if they don't need one.
> 
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Reviewed-by: Sean Paul <sean@poorly.run>

> ---
>  drivers/gpu/drm/msm/msm_drv.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 9c9f7ff6960b..d8af97407b3c 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -724,7 +724,11 @@ static int msm_irq_postinstall(struct drm_device *dev)
>  	struct msm_drm_private *priv = dev->dev_private;
>  	struct msm_kms *kms = priv->kms;
>  	BUG_ON(!kms);
> -	return kms->funcs->irq_postinstall(kms);
> +
> +	if (kms->funcs->irq_postinstall)
> +		return kms->funcs->irq_postinstall(kms);
> +
> +	return 0;
>  }
>  
>  static void msm_irq_uninstall(struct drm_device *dev)
> -- 
> 2.18.0
>