mm: concentrate modification of totalram_pages into the mm core
[firefly-linux-kernel-4.4.55.git] / drivers / misc / sram.c
index 437192e43006d49db726c828aace74062ed3929c..d87cc91bc016568032c7416619c007d1995a6d54 100644 (file)
@@ -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;