Misc: sram: Remove unneeded check
[firefly-linux-kernel-4.4.55.git] / drivers / misc / sram.c
index 4a938860fec0210a052c4d6c9e9879604fdc9a12..d87cc91bc016568032c7416619c007d1995a6d54 100644 (file)
@@ -45,15 +45,11 @@ static int sram_probe(struct platform_device *pdev)
        int ret;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -EINVAL;
-
-       size = resource_size(res);
-
        virt_base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(virt_base))
                return PTR_ERR(virt_base);
 
+       size = resource_size(res);
 
        sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL);
        if (!sram)