Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1632174

[PATCH -next] irqchip/mbigen: Fix return value check in mbigen_device_probe()

From Wei Yongjun <weiyj.lk@gmail.com>
Newsgroups linux.kernel
Subject [PATCH -next] irqchip/mbigen: Fix return value check in mbigen_device_probe()
Date 2017-04-27 17:30 +0200
Message-ID <tATwJ-2t3-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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);

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH -next] irqchip/mbigen: Fix return value check in mbigen_device_probe() Wei Yongjun <weiyj.lk@gmail.com> - 2017-04-27 17:30 +0200
  [tip:irq/core] irqchip/mbigen: Fix return value check in  mbigen_device_probe() tip-bot for Wei Yongjun <tipbot@zytor.com> - 2017-04-30 11:50 +0200

csiph-web