Message ID | 20230803040401.3067484-2-ruanjinjie@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm: Do not check for 0 return after calling platform_get_irq() | expand |
On 03/08/2023 05:03, Ruan Jinjie wrote: > 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> I'll push this to drm-misc-next. Thanks, Steve > --- > drivers/gpu/drm/panfrost/panfrost_gpu.c | 4 ++-- > drivers/gpu/drm/panfrost/panfrost_job.c | 4 ++-- > drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c > index d28b99732dde..2faa344d89ee 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c > +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c > @@ -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); > diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c > index dbc597ab46fb..3322b3024937 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_job.c > +++ b/drivers/gpu/drm/panfrost/panfrost_job.c > @@ -794,8 +794,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, > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c > index c0123d09f699..d54d4e7b2195 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c > +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c > @@ -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,
diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index d28b99732dde..2faa344d89ee 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -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); diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index dbc597ab46fb..3322b3024937 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -794,8 +794,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, diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index c0123d09f699..d54d4e7b2195 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -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,
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> --- drivers/gpu/drm/panfrost/panfrost_gpu.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_job.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)