Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Remove custom vbox_init() and vbox_exit() functions and initialize
the module with DRM module helpers.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20211217144615.32733-10-tzimmermann@suse.de

authored by

Thomas Zimmermann and committed by
Javier Martinez Canillas
ccecfd01 10dcc831

+2 -18
+2 -18
drivers/gpu/drm/vboxvideo/vbox_drv.c
··· 18 18 #include <drm/drm_file.h> 19 19 #include <drm/drm_ioctl.h> 20 20 #include <drm/drm_managed.h> 21 + #include <drm/drm_module.h> 21 22 22 23 #include "vbox_drv.h" 23 24 ··· 191 190 DRM_GEM_VRAM_DRIVER, 192 191 }; 193 192 194 - static int __init vbox_init(void) 195 - { 196 - if (drm_firmware_drivers_only() && vbox_modeset == -1) 197 - return -EINVAL; 198 - 199 - if (vbox_modeset == 0) 200 - return -EINVAL; 201 - 202 - return pci_register_driver(&vbox_pci_driver); 203 - } 204 - 205 - static void __exit vbox_exit(void) 206 - { 207 - pci_unregister_driver(&vbox_pci_driver); 208 - } 209 - 210 - module_init(vbox_init); 211 - module_exit(vbox_exit); 193 + drm_module_pci_driver_if_modeset(vbox_pci_driver, vbox_modeset); 212 194 213 195 MODULE_AUTHOR("Oracle Corporation"); 214 196 MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");