video: pxafb: Use devm_platform_ioremap_resource() in pxafb_probe()
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 19 Sep 2019 14:51:38 +0000 (16:51 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 3 Jan 2020 13:27:50 +0000 (14:27 +0100)
Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Cc: Daniel Mack <daniel@zonque.org>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: YueHaibing <yuehaibing@huawei.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a1b804b1-43c2-327a-d6d1-df49aebec680@web.de
drivers/video/fbdev/pxafb.c

index 6f7e9fb631903c42f1f99219a9521e751d14b3c7..00b96a78676efa30ea2df3c38fb2def094bad9a7 100644 (file)
@@ -2237,7 +2237,6 @@ static int pxafb_probe(struct platform_device *dev)
 {
        struct pxafb_info *fbi;
        struct pxafb_mach_info *inf, *pdata;
-       struct resource *r;
        int i, irq, ret;
 
        dev_dbg(&dev->dev, "pxafb_probe\n");
@@ -2303,14 +2302,7 @@ static int pxafb_probe(struct platform_device *dev)
                fbi->lcd_supply = NULL;
        }
 
-       r = platform_get_resource(dev, IORESOURCE_MEM, 0);
-       if (r == NULL) {
-               dev_err(&dev->dev, "no I/O memory resource defined\n");
-               ret = -ENODEV;
-               goto failed;
-       }
-
-       fbi->mmio_base = devm_ioremap_resource(&dev->dev, r);
+       fbi->mmio_base = devm_platform_ioremap_resource(dev, 0);
        if (IS_ERR(fbi->mmio_base)) {
                dev_err(&dev->dev, "failed to get I/O memory\n");
                ret = -EBUSY;