irqchip/mbigen: Fix return value check in mbigen_device_probe()
PATCH 1/1 irqchip/mbigen: Fix return value check in mbigen_device_probe()
From: Wei Yongjun <[email protected]>
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 <[email protected]>
--- drivers/irqchip/irq-mbigen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-mbigen.c +1 -2
@@ -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);
tip-bot for Wei Yongjun
merge botirqchip/mbigen: Fix return value check in mbigen_device_probe()
Commit-ID: 216646e4d82e847791f0ba66c439dedd36cb119f Gitweb: http://git.kernel.org/tip/216646e4d82e847791f0ba66c439dedd36cb119f Author: Wei Yongjun <[email protected]> AuthorDate: Thu, 27 Apr 2017 15:21:13 +0000 Committer: Thomas Gleixner <[email protected]> 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 <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Kefeng Wang <[email protected]>
Cc Jason Cooper <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
--- drivers/irqchip/irq-mbigen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/irqchip/irq-mbigen.c +1 -2
@@ -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);