Commit a7b23fd9 authored by Thomas Zimmermann's avatar Thomas Zimmermann Committed by Javier Martinez Canillas

drm/mgag200: Replace module-init boiler-plate code with DRM helpers

Remove custom mgag200_init() and mgag200_exit() functions and initialize
the module with DRM_module helpers.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20211217144615.32733-7-tzimmermann@suse.de
parent a0f25a6b
......@@ -14,6 +14,7 @@
#include <drm/drm_drv.h>
#include <drm/drm_file.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_module.h>
#include <drm/drm_pciids.h>
#include "mgag200_drv.h"
......@@ -375,24 +376,7 @@ static struct pci_driver mgag200_pci_driver = {
.remove = mgag200_pci_remove,
};
static int __init mgag200_init(void)
{
if (drm_firmware_drivers_only() && mgag200_modeset == -1)
return -EINVAL;
if (mgag200_modeset == 0)
return -EINVAL;
return pci_register_driver(&mgag200_pci_driver);
}
static void __exit mgag200_exit(void)
{
pci_unregister_driver(&mgag200_pci_driver);
}
module_init(mgag200_init);
module_exit(mgag200_exit);
drm_module_pci_driver_if_modeset(mgag200_pci_driver, mgag200_modeset);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment