summaryrefslogtreecommitdiffstats
path: root/drivers/misc/sram.c
diff options
context:
space:
mode:
authorLaurent Navet <laurent.navet@gmail.com>2013-05-02 14:39:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-17 03:11:13 +0200
commit21b066f19a81bd2af496745796914cfeca7a8ea7 (patch)
treef862686f2200b02d00702dab452f676d52c1d09f /drivers/misc/sram.c
parentDrivers: Misc: tsl2250: fix warnings, unsigned long will never < 0 (diff)
downloadlinux-21b066f19a81bd2af496745796914cfeca7a8ea7.tar.xz
linux-21b066f19a81bd2af496745796914cfeca7a8ea7.zip
drivers: misc: use devm_ioremap_resource()
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/sram.c')
-rw-r--r--drivers/misc/sram.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 437192e43006..4a938860fec0 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -50,9 +50,10 @@ static int sram_probe(struct platform_device *pdev)
size = resource_size(res);
- virt_base = devm_request_and_ioremap(&pdev->dev, res);
- if (!virt_base)
- return -EADDRNOTAVAIL;
+ virt_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(virt_base))
+ return PTR_ERR(virt_base);
+
sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL);
if (!sram)