[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211222082831.196562-5-javierm@redhat.com>
Date: Wed, 22 Dec 2021 09:28:25 +0100
From: Javier Martinez Canillas <javierm@...hat.com>
To: linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Cc: Thomas Zimmermann <tzimmermann@...e.de>,
Javier Martinez Canillas <javierm@...hat.com>,
Daniel Vetter <daniel@...ll.ch>,
Dave Airlie <airlied@...hat.com>,
David Airlie <airlied@...ux.ie>,
Gerd Hoffmann <kraxel@...hat.com>,
virtualization@...ts.linux-foundation.org
Subject: [PATCH v3 04/10] drm/cirrus: Replace module-init boiler-plate code with DRM helpers
From: Thomas Zimmermann <tzimmermann@...e.de>
Remove custom cirrus_init() and cirrus_exit() functions and initialize
the module with DRM module helpers.
Signed-off-by: Thomas Zimmermann <tzimmermann@...e.de>
Signed-off-by: Javier Martinez Canillas <javierm@...hat.com>
---
(no changes since v1)
drivers/gpu/drm/tiny/cirrus.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny/cirrus.c
index c95d9ff7d600..ecf2475d0f16 100644
--- a/drivers/gpu/drm/tiny/cirrus.c
+++ b/drivers/gpu/drm/tiny/cirrus.c
@@ -39,6 +39,7 @@
#include <drm/drm_ioctl.h>
#include <drm/drm_managed.h>
#include <drm/drm_modeset_helper_vtables.h>
+#include <drm/drm_module.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
@@ -633,21 +634,7 @@ static struct pci_driver cirrus_pci_driver = {
.remove = cirrus_pci_remove,
};
-static int __init cirrus_init(void)
-{
- if (drm_firmware_drivers_only())
- return -EINVAL;
-
- return pci_register_driver(&cirrus_pci_driver);
-}
-
-static void __exit cirrus_exit(void)
-{
- pci_unregister_driver(&cirrus_pci_driver);
-}
-
-module_init(cirrus_init);
-module_exit(cirrus_exit);
+drm_module_pci_driver(cirrus_pci_driver)
MODULE_DEVICE_TABLE(pci, pciidlist);
MODULE_LICENSE("GPL");
--
2.33.1
Powered by blists - more mailing lists