Commit 216646e4 authored by Wei Yongjun's avatar Wei Yongjun Committed by Thomas Gleixner

irqchip/mbigen: Fix return value check in mbigen_device_probe()

In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). Use devm_ioremap_resource() instead of devm_ioremap()
to fix the IS_ERR() test issue.

Fixes: 76e1f77f ("irqchip/mbigen: Introduce mbigen_of_create_domain()")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/20170427152113.31147-1-weiyj.lk@gmail.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 8ada00a6
...@@ -337,8 +337,7 @@ static int mbigen_device_probe(struct platform_device *pdev) ...@@ -337,8 +337,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
mgn_chip->pdev = pdev; mgn_chip->pdev = pdev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mgn_chip->base = devm_ioremap(&pdev->dev, res->start, mgn_chip->base = devm_ioremap_resource(&pdev->dev, res);
resource_size(res));
if (IS_ERR(mgn_chip->base)) if (IS_ERR(mgn_chip->base))
return PTR_ERR(mgn_chip->base); return PTR_ERR(mgn_chip->base);
......
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