aboutsummaryrefslogtreecommitdiffstats
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 437192e43006..d87cc91bc016 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -45,15 +45,12 @@ static int sram_probe(struct platform_device *pdev)
45 int ret; 45 int ret;
46 46
47 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 47 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
48 if (!res) 48 virt_base = devm_ioremap_resource(&pdev->dev, res);
49 return -EINVAL; 49 if (IS_ERR(virt_base))
50 return PTR_ERR(virt_base);
50 51
51 size = resource_size(res); 52 size = resource_size(res);
52 53
53 virt_base = devm_request_and_ioremap(&pdev->dev, res);
54 if (!virt_base)
55 return -EADDRNOTAVAIL;
56
57 sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL); 54 sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL);
58 if (!sram) 55 if (!sram)
59 return -ENOMEM; 56 return -ENOMEM;