drm/vc4: use simpler remove_conflicting_framebuffers(NULL)
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Sat, 1 Sep 2018 14:08:50 +0000 (16:08 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 3 Sep 2018 16:17:50 +0000 (18:17 +0200)
Use remove_conflicting_framebuffers(NULL) instead of open-coding it.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/be7e6396e6e7159695a5bccc109c6ab49a51e0d8.1535810304.git.mirq-linux@rere.qmqm.pl
drivers/gpu/drm/vc4/vc4_drv.c

index 04270a14fcaaf491a3344f13ce169e7da42cd186..e2a15c63a81f1faeb320a88148f728b292b0fbf7 100644 (file)
@@ -248,24 +248,6 @@ static void vc4_match_add_drivers(struct device *dev,
        }
 }
 
-static void vc4_kick_out_firmware_fb(void)
-{
-       struct apertures_struct *ap;
-
-       ap = alloc_apertures(1);
-       if (!ap)
-               return;
-
-       /* Since VC4 is a UMA device, the simplefb node may have been
-        * located anywhere in memory.
-        */
-       ap->ranges[0].base = 0;
-       ap->ranges[0].size = ~0;
-
-       drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false);
-       kfree(ap);
-}
-
 static int vc4_drm_bind(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
@@ -298,7 +280,7 @@ static int vc4_drm_bind(struct device *dev)
        if (ret)
                goto gem_destroy;
 
-       vc4_kick_out_firmware_fb();
+       drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);
 
        ret = drm_dev_register(drm, 0);
        if (ret < 0)