All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch: sparc: kernel: use devm_ioremap_resource()
@ 2013-05-12 14:10 ` Laurent Navet
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Navet @ 2013-05-12 14:10 UTC (permalink / raw)
  To: davem; +Cc: daniel, sam, sparclinux, linux-kernel, Laurent Navet

Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
---
 arch/sparc/kernel/leon_pci_grpci1.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c
index 7739a54..6df26e3 100644
--- a/arch/sparc/kernel/leon_pci_grpci1.c
+++ b/arch/sparc/kernel/leon_pci_grpci1.c
@@ -536,11 +536,9 @@ static int grpci1_of_probe(struct platform_device *ofdev)
 
 	/* find device register base address */
 	res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-	regs = devm_request_and_ioremap(&ofdev->dev, res);
-	if (!regs) {
-		dev_err(&ofdev->dev, "io-regs mapping failed\n");
-		return -EADDRNOTAVAIL;
-	}
+	regs = devm_ioremap_resource(&ofdev->dev, res);
+	if (IS_ERR(regs))
+		return PTR_ERR(regs);
 
 	/*
 	 * check that we're in Host Slot and that we can act as a Host Bridge
-- 
1.7.10.4


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

end of thread, other threads:[~2013-05-13 15:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-12 14:10 [PATCH] arch: sparc: kernel: use devm_ioremap_resource() Laurent Navet
2013-05-12 14:10 ` Laurent Navet
2013-05-12 15:28 ` Sam Ravnborg
2013-05-12 15:28   ` Sam Ravnborg
2013-05-13 11:43   ` Laurent Navet
2013-05-13 11:43     ` Laurent Navet
2013-05-13 15:37     ` Sam Ravnborg
2013-05-13 15:37       ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.