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

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

Remove custom bochs_init() and bochs_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>
Link: https://patchwork.freedesktop.org/patch/msgid/20211222082831.196562-4-javierm@redhat.com
parent 8638b4d8
......@@ -10,6 +10,7 @@
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_gem_vram_helper.h>
#include <drm/drm_managed.h>
#include <drm/drm_module.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
......@@ -716,24 +717,7 @@ static struct pci_driver bochs_pci_driver = {
/* ---------------------------------------------------------------------- */
/* module init/exit */
static int __init bochs_init(void)
{
if (drm_firmware_drivers_only() && bochs_modeset == -1)
return -EINVAL;
if (bochs_modeset == 0)
return -EINVAL;
return pci_register_driver(&bochs_pci_driver);
}
static void __exit bochs_exit(void)
{
pci_unregister_driver(&bochs_pci_driver);
}
module_init(bochs_init);
module_exit(bochs_exit);
drm_module_pci_driver_if_modeset(bochs_pci_driver, bochs_modeset);
MODULE_DEVICE_TABLE(pci, bochs_pci_tbl);
MODULE_AUTHOR("Gerd Hoffmann <kraxel@redhat.com>");
......
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