summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2015-04-20 01:00:53 +0200
committerMark Yao <mark.yao@rock-chips.com>2015-04-20 09:02:31 +0800
commit3ea68922fc4148abc97557df43d4ba9a136b1c8d (patch)
tree68738f2926b5c5fc0d6bc7318d52499cc87294d2
parent625e03461ba51592ac785214b2254af7bd630077 (diff)
downloadop-kernel-dev-3ea68922fc4148abc97557df43d4ba9a136b1c8d.zip
op-kernel-dev-3ea68922fc4148abc97557df43d4ba9a136b1c8d.tar.gz
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: David Binderman <dcb314@hotmail.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-By: Daniel Kurtz <djkurtz@chromium.org>
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_vop.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index ccb0ce0..4557f33 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1409,7 +1409,7 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
struct vop *vop;
struct resource *res;
size_t alloc_size;
- int ret;
+ int ret, irq;
of_id = of_match_device(vop_driver_dt_match, dev);
vop_data = of_id->data;
@@ -1445,11 +1445,12 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
return ret;
}
- vop->irq = platform_get_irq(pdev, 0);
- if (vop->irq < 0) {
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0) {
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->irq_lock);
OpenPOWER on IntegriCloud