linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: rcar: fix return value check in rcar_pci_probe()
@ 2013-11-19  3:40 Wei Yongjun
  2013-11-19  7:05 ` Jingoo Han
  2013-12-07 22:50 ` Bjorn Helgaas
  0 siblings, 2 replies; 7+ messages in thread
From: Wei Yongjun @ 2013-11-19  3:40 UTC (permalink / raw)
  To: bhelgaas, valentine.barshak; +Cc: yongjun_wei, linux-pci

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/pci/host/pci-rcar-gen2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
index cbaa5c4..96d1182 100644
--- a/drivers/pci/host/pci-rcar-gen2.c
+++ b/drivers/pci/host/pci-rcar-gen2.c
@@ -276,8 +276,8 @@ static int __init rcar_pci_probe(struct platform_device *pdev)
 
 	cfg_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg = devm_ioremap_resource(&pdev->dev, cfg_res);
-	if (!reg)
-		return -ENODEV;
+	if (IS_ERR(reg))
+		return PTR_ERR(reg);
 
 	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	if (!mem_res || !mem_res->start)


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

end of thread, other threads:[~2013-12-13 17:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-19  3:40 [PATCH] PCI: rcar: fix return value check in rcar_pci_probe() Wei Yongjun
2013-11-19  7:05 ` Jingoo Han
2013-12-07 22:50 ` Bjorn Helgaas
2013-12-09  1:46   ` Jingoo Han
2013-12-11  2:30     ` Simon Horman
2013-12-13 12:06       ` Valentine
2013-12-13 17:00         ` Bjorn Helgaas

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