diff options
-rw-r--r-- | drivers/misc/sram.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index 4a938860fec0..d87cc91bc016 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c | |||
@@ -45,15 +45,11 @@ 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) | ||
49 | return -EINVAL; | ||
50 | |||
51 | size = resource_size(res); | ||
52 | |||
53 | virt_base = devm_ioremap_resource(&pdev->dev, res); | 48 | virt_base = devm_ioremap_resource(&pdev->dev, res); |
54 | if (IS_ERR(virt_base)) | 49 | if (IS_ERR(virt_base)) |
55 | return PTR_ERR(virt_base); | 50 | return PTR_ERR(virt_base); |
56 | 51 | ||
52 | size = resource_size(res); | ||
57 | 53 | ||
58 | sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL); | 54 | sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL); |
59 | if (!sram) | 55 | if (!sram) |