drm/mgag200: use simpler remove_conflicting_pci_framebuffers()
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Sat, 1 Sep 2018 14:08:48 +0000 (16:08 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 3 Sep 2018 16:17:32 +0000 (18:17 +0200)
Remove duplicated call, while at it.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
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/90fc954f90de44157d6cc1c782147db6252c71e4.1535810304.git.mirq-linux@rere.qmqm.pl
drivers/gpu/drm/mgag200/mgag200_drv.c
drivers/gpu/drm/mgag200/mgag200_main.c

index 74cdde2..ac6af4b 100644 (file)
@@ -42,29 +42,10 @@ static const struct pci_device_id pciidlist[] = {
 
 MODULE_DEVICE_TABLE(pci, pciidlist);
 
-static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-       struct apertures_struct *ap;
-       bool primary = false;
-
-       ap = alloc_apertures(1);
-       if (!ap)
-               return;
-
-       ap->ranges[0].base = pci_resource_start(pdev, 0);
-       ap->ranges[0].size = pci_resource_len(pdev, 0);
-
-#ifdef CONFIG_X86
-       primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
-#endif
-       drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary);
-       kfree(ap);
-}
-
 
 static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       mgag200_kick_out_firmware_fb(pdev);
+       drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb");
 
        return drm_get_pci_dev(pdev, ent, &driver);
 }
index 780f983..79d5410 100644 (file)
@@ -124,20 +124,11 @@ static int mga_probe_vram(struct mga_device *mdev, void __iomem *mem)
 static int mga_vram_init(struct mga_device *mdev)
 {
        void __iomem *mem;
-       struct apertures_struct *aper = alloc_apertures(1);
-       if (!aper)
-               return -ENOMEM;
 
        /* BAR 0 is VRAM */
        mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0);
        mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0);
 
-       aper->ranges[0].base = mdev->mc.vram_base;
-       aper->ranges[0].size = mdev->mc.vram_window;
-
-       drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true);
-       kfree(aper);
-
        if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window,
                                "mgadrmfb_vram")) {
                DRM_ERROR("can't reserve VRAM\n");