vc4_irq_install() is handed the IRQ number as an argument even though
vc4_v3d_bind() has already stored it in vc4->irq, which is where
vc4_irq_disable() reads it from. Having a single source for it makes the
two paths agree by construction.

While at it, drop the IRQ_NOTCONNECTED check. platform_get_irq() doesn't
return that value, and vc4_v3d_bind() already refuses to continue on a
negative return, so the test can never be true.

No functional change.

Signed-off-by: Maíra Canal <[email protected]>
---
 drivers/gpu/drm/vc4/vc4_drv.h | 2 +-
 drivers/gpu/drm/vc4/vc4_irq.c | 7 ++-----
 drivers/gpu/drm/vc4/vc4_v3d.c | 2 +-
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
index 35b9b574671b..38f539cb49f4 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.h
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
@@ -1015,7 +1015,7 @@ extern struct platform_driver vc4_txp_driver;
 /* vc4_irq.c */
 void vc4_irq_enable(struct drm_device *dev);
 void vc4_irq_disable(struct drm_device *dev);
-int vc4_irq_install(struct drm_device *dev, int irq);
+int vc4_irq_install(struct drm_device *dev);
 void vc4_irq_uninstall(struct drm_device *dev);
 void vc4_irq_reset(struct drm_device *dev);
 
diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c
index 95b1a8ad848b..a1004c64e71b 100644
--- a/drivers/gpu/drm/vc4/vc4_irq.c
+++ b/drivers/gpu/drm/vc4/vc4_irq.c
@@ -283,7 +283,7 @@ vc4_irq_disable(struct drm_device *dev)
        cancel_work_sync(&vc4->overflow_mem_work);
 }
 
-int vc4_irq_install(struct drm_device *dev, int irq)
+int vc4_irq_install(struct drm_device *dev)
 {
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        int ret;
@@ -294,9 +294,6 @@ int vc4_irq_install(struct drm_device *dev, int irq)
        if (!vc4->v3d)
                return -ENODEV;
 
-       if (irq == IRQ_NOTCONNECTED)
-               return -ENOTCONN;
-
        init_waitqueue_head(&vc4->job_wait_queue);
        INIT_WORK(&vc4->overflow_mem_work, vc4_overflow_mem_work);
 
@@ -305,7 +302,7 @@ int vc4_irq_install(struct drm_device *dev, int irq)
         */
        V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS);
 
-       ret = devm_request_irq(dev->dev, irq, vc4_irq, 0,
+       ret = devm_request_irq(dev->dev, vc4->irq, vc4_irq, 0,
                               dev_name(dev->dev), dev);
        if (ret)
                return ret;
diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index 9aa8985e0428..818997ded33a 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -466,7 +466,7 @@ static int vc4_v3d_bind(struct device *dev, struct device 
*master, void *data)
        V3D_WRITE(V3D_BPOA, 0);
        V3D_WRITE(V3D_BPOS, 0);
 
-       ret = vc4_irq_install(drm, vc4->irq);
+       ret = vc4_irq_install(drm);
        if (ret) {
                drm_err(drm, "Failed to install IRQ handler\n");
                goto err_put_runtime_pm;

-- 
2.55.0

Reply via email to