drm/mgag200: Set up fbdev after registering device; remove error checks
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 8 Apr 2020 08:26:37 +0000 (10:26 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 8 Apr 2020 14:24:52 +0000 (16:24 +0200)
Generic fbdev support is a DRM client. Set it up after registering
the new DRM device. Remove the error checks as the driver's probe
function should not depend on a DRM client's state.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-7-tzimmermann@suse.de
drivers/gpu/drm/mgag200/mgag200_drv.c
drivers/gpu/drm/mgag200/mgag200_main.c

index 7a5bad2f57d70bbe838a46c8e29f800e4466f313..3298b7ef18b0386247c03549f72a56368fec28f4 100644 (file)
@@ -77,6 +77,8 @@ static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (ret)
                goto err_mgag200_driver_unload;
 
+       drm_fbdev_generic_setup(dev, 0);
+
        return 0;
 
 err_mgag200_driver_unload:
index e278b6a547bde6fb8e3b8e3b5f7b93f9e8348d56..b680cf47cbb9475aa6a5dd4bc835f3964d7fba45 100644 (file)
@@ -181,10 +181,6 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags)
                dev_warn(&dev->pdev->dev,
                        "Could not initialize cursors. Not doing hardware cursors.\n");
 
-       r = drm_fbdev_generic_setup(mdev->dev, 0);
-       if (r)
-               goto err_modeset;
-
        return 0;
 
 err_modeset: