fbdev/sa1100fb: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 4 Sep 2019 11:57:54 +0000 (19:57 +0800)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 3 Jan 2020 13:27:46 +0000 (14:27 +0100)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190904115754.21612-1-yuehaibing@huawei.com
drivers/video/fbdev/sa1100fb.c

index 4680cc3efb81d445e269c978af6af71909c66f6c..5bb653db0cec12fb089730900e34a819a1c9b271 100644 (file)
@@ -1143,7 +1143,6 @@ static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev)
 static int sa1100fb_probe(struct platform_device *pdev)
 {
        struct sa1100fb_info *fbi;
-       struct resource *res;
        int ret, irq;
 
        if (!dev_get_platdata(&pdev->dev)) {
@@ -1159,8 +1158,7 @@ static int sa1100fb_probe(struct platform_device *pdev)
        if (!fbi)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       fbi->base = devm_ioremap_resource(&pdev->dev, res);
+       fbi->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(fbi->base))
                return PTR_ERR(fbi->base);