Commit 3ea68922 authored by Heiko Stuebner's avatar Heiko Stuebner Committed by Mark Yao

drm/rockchip: fix error check when getting irq

platform_get_irq() can return negative error values and we already test for
these. Therefore the variable holding this value should be signed to not
loose possible error values.
Reported-by: default avatarDavid Binderman <dcb314@hotmail.com>
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Reviewed-By: default avatarDaniel Kurtz <djkurtz@chromium.org>
parent 625e0346
...@@ -1409,7 +1409,7 @@ static int vop_bind(struct device *dev, struct device *master, void *data) ...@@ -1409,7 +1409,7 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
struct vop *vop; struct vop *vop;
struct resource *res; struct resource *res;
size_t alloc_size; size_t alloc_size;
int ret; int ret, irq;
of_id = of_match_device(vop_driver_dt_match, dev); of_id = of_match_device(vop_driver_dt_match, dev);
vop_data = of_id->data; vop_data = of_id->data;
...@@ -1445,11 +1445,12 @@ static int vop_bind(struct device *dev, struct device *master, void *data) ...@@ -1445,11 +1445,12 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
return ret; return ret;
} }
vop->irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (vop->irq < 0) { if (irq < 0) {
dev_err(dev, "cannot find irq for vop\n"); dev_err(dev, "cannot find irq for vop\n");
return vop->irq; return irq;
} }
vop->irq = (unsigned int)irq;
spin_lock_init(&vop->reg_lock); spin_lock_init(&vop->reg_lock);
spin_lock_init(&vop->irq_lock); spin_lock_init(&vop->irq_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment