drm/panfrost: Do not check for 0 return after calling platform_get_irq_byname()
authorRuan Jinjie <ruanjinjie@huawei.com>
Thu, 3 Aug 2023 04:03:59 +0000 (12:03 +0800)
committerSteven Price <steven.price@arm.com>
Mon, 21 Aug 2023 14:11:27 +0000 (15:11 +0100)
It is not possible for platform_get_irq_byname() to return 0.
Use the return value from platform_get_irq_byname().

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230803040401.3067484-2-ruanjinjie@huawei.com
drivers/gpu/drm/panfrost/panfrost_gpu.c
drivers/gpu/drm/panfrost/panfrost_job.c
drivers/gpu/drm/panfrost/panfrost_mmu.c

index d28b99732ddeb62d1a0bf42e995c38615de5c5e0..2faa344d89ee1479aefeccba57b84ae494703dfb 100644 (file)
@@ -390,8 +390,8 @@ int panfrost_gpu_init(struct panfrost_device *pfdev)
        dma_set_max_seg_size(pfdev->dev, UINT_MAX);
 
        irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "gpu");
-       if (irq <= 0)
-               return -ENODEV;
+       if (irq < 0)
+               return irq;
 
        err = devm_request_irq(pfdev->dev, irq, panfrost_gpu_irq_handler,
                               IRQF_SHARED, KBUILD_MODNAME "-gpu", pfdev);
index a8b4827dc4258633d13d5a0fb3d7e1b04a51a787..033f5e684707d869ff0e11d0f92b4ade8be1688d 100644 (file)
@@ -810,8 +810,8 @@ int panfrost_job_init(struct panfrost_device *pfdev)
        spin_lock_init(&js->job_lock);
 
        js->irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "job");
-       if (js->irq <= 0)
-               return -ENODEV;
+       if (js->irq < 0)
+               return js->irq;
 
        ret = devm_request_threaded_irq(pfdev->dev, js->irq,
                                        panfrost_job_irq_handler,
index c0123d09f699c74d6bd18b6ab0a18944268c7d4b..d54d4e7b21951b114a03506903dd694fc3c8606c 100644 (file)
@@ -755,8 +755,8 @@ int panfrost_mmu_init(struct panfrost_device *pfdev)
        int err, irq;
 
        irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "mmu");
-       if (irq <= 0)
-               return -ENODEV;
+       if (irq < 0)
+               return irq;
 
        err = devm_request_threaded_irq(pfdev->dev, irq,
                                        panfrost_mmu_irq_handler,