diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2019-09-19 16:26:56 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2020-01-03 14:27:49 +0100 |
commit | bc2e7382890b36c8139d728509c1420073aef5a3 (patch) | |
tree | a90e770b11ec98d2245aa4c1941c68e1cf36336b /drivers/video/fbdev/ocfb.c | |
parent | 4a7001f0f4e2362d8040b94764ec321ff57e1a46 (diff) |
video: ocfb: Use devm_platform_ioremap_resource() in ocfb_probe()
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: 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/61b75aa6-ff92-e0ed-53f2-50a95d93d1f6@web.de
Diffstat (limited to 'drivers/video/fbdev/ocfb.c')
-rw-r--r-- | drivers/video/fbdev/ocfb.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/video/fbdev/ocfb.c b/drivers/video/fbdev/ocfb.c index c8cee2d890dc..bfa4ed421148 100644 --- a/drivers/video/fbdev/ocfb.c +++ b/drivers/video/fbdev/ocfb.c @@ -297,7 +297,6 @@ static int ocfb_probe(struct platform_device *pdev) { int ret = 0; struct ocfb_dev *fbdev; - struct resource *res; int fbsize; fbdev = devm_kzalloc(&pdev->dev, sizeof(*fbdev), GFP_KERNEL); @@ -319,13 +318,7 @@ static int ocfb_probe(struct platform_device *pdev) ocfb_init_var(fbdev); ocfb_init_fix(fbdev); - /* Request I/O resource */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "I/O resource request failed\n"); - return -ENXIO; - } - fbdev->regs = devm_ioremap_resource(&pdev->dev, res); + fbdev->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(fbdev->regs)) return PTR_ERR(fbdev->regs); |