linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] irqchip/mbigen: Fix return value check in mbigen_device_probe()
@ 2017-04-27 15:21 Wei Yongjun
  2017-04-30  9:45 ` [tip:irq/core] " tip-bot for Wei Yongjun
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2017-04-27 15:21 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier, Kefeng Wang
  Cc: Wei Yongjun, linux-kernel

From: Wei Yongjun <weiyongjun1@huawei.com>

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: 76e1f77f9c26 ("irqchip/mbigen: Introduce mbigen_of_create_domain()")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/irqchip/irq-mbigen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
index 061cdb8..d2306c8 100644
--- a/drivers/irqchip/irq-mbigen.c
+++ b/drivers/irqchip/irq-mbigen.c
@@ -337,8 +337,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 	mgn_chip->pdev = pdev;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mgn_chip->base = devm_ioremap(&pdev->dev, res->start,
-				      resource_size(res));
+	mgn_chip->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(mgn_chip->base))
 		return PTR_ERR(mgn_chip->base);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:irq/core] irqchip/mbigen: Fix return value check in mbigen_device_probe()
  2017-04-27 15:21 [PATCH -next] irqchip/mbigen: Fix return value check in mbigen_device_probe() Wei Yongjun
@ 2017-04-30  9:45 ` tip-bot for Wei Yongjun
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Wei Yongjun @ 2017-04-30  9:45 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: marc.zyngier, weiyongjun1, wangkefeng.wang, linux-kernel, jason,
	hpa, mingo, tglx

Commit-ID:  216646e4d82e847791f0ba66c439dedd36cb119f
Gitweb:     http://git.kernel.org/tip/216646e4d82e847791f0ba66c439dedd36cb119f
Author:     Wei Yongjun <weiyongjun1@huawei.com>
AuthorDate: Thu, 27 Apr 2017 15:21:13 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sun, 30 Apr 2017 11:21:16 +0200

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: 76e1f77f9c26 ("irqchip/mbigen: Introduce mbigen_of_create_domain()")
Signed-off-by: Wei 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.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 drivers/irqchip/irq-mbigen.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
index 061cdb8..d2306c8 100644
--- a/drivers/irqchip/irq-mbigen.c
+++ b/drivers/irqchip/irq-mbigen.c
@@ -337,8 +337,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 	mgn_chip->pdev = pdev;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mgn_chip->base = devm_ioremap(&pdev->dev, res->start,
-				      resource_size(res));
+	mgn_chip->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(mgn_chip->base))
 		return PTR_ERR(mgn_chip->base);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-30  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 15:21 [PATCH -next] irqchip/mbigen: Fix return value check in mbigen_device_probe() Wei Yongjun
2017-04-30  9:45 ` [tip:irq/core] " tip-bot for Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).