summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vboxvideo
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2021-12-17 17:46:14 +0300
committerJavier Martinez Canillas <javierm@redhat.com>2022-01-27 21:15:34 +0300
commitccecfd013a39d8b8ea837e90f7f907e4ed5abe17 (patch)
treeabc93e3a103e19585a4984e784f3e9d250a39dee /drivers/gpu/drm/vboxvideo
parent10dcc8317f6063806ce1d34235af23da5e2fdd7a (diff)
downloadlinux-ccecfd013a39d8b8ea837e90f7f907e4ed5abe17.tar.xz
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
Diffstat (limited to 'drivers/gpu/drm/vboxvideo')
-rw-r--r--drivers/gpu/drm/vboxvideo/vbox_drv.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c b/drivers/gpu/drm/vboxvideo/vbox_drv.c
index f35d9e44c6b7..f4f2bd79a7cb 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_drv.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c
@@ -18,6 +18,7 @@
#include <drm/drm_file.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_managed.h>
+#include <drm/drm_module.h>
#include "vbox_drv.h"
@@ -190,24 +191,7 @@ static const struct drm_driver driver = {
DRM_GEM_VRAM_DRIVER,
};
-static int __init vbox_init(void)
-{
- if (drm_firmware_drivers_only() && vbox_modeset == -1)
- return -EINVAL;
-
- if (vbox_modeset == 0)
- return -EINVAL;
-
- return pci_register_driver(&vbox_pci_driver);
-}
-
-static void __exit vbox_exit(void)
-{
- pci_unregister_driver(&vbox_pci_driver);
-}
-
-module_init(vbox_init);
-module_exit(vbox_exit);
+drm_module_pci_driver_if_modeset(vbox_pci_driver, vbox_modeset);
MODULE_AUTHOR("Oracle Corporation");
MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");