summaryrefslogtreecommitdiffstats
path: root/drivers/misc/sram.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/sram.c')
-rw-r--r--drivers/misc/sram.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 437192e4300..d87cc91bc01 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -45,15 +45,12 @@ static int sram_probe(struct platform_device *pdev)
int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
+ virt_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(virt_base))
+ return PTR_ERR(virt_base);
size = resource_size(res);
- virt_base = devm_request_and_ioremap(&pdev->dev, res);
- if (!virt_base)
- return -EADDRNOTAVAIL;
-
sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL);
if (!sram)
return -ENOMEM;