media: staging: media: zoran: use module_pci_driver
authorCorentin Labbe <clabbe@baylibre.com>
Tue, 14 Dec 2021 16:16:20 +0000 (17:16 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 23 Jan 2022 20:18:38 +0000 (21:18 +0100)
Simplify code by using module_pci_driver()

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/zoran/zoran_card.c

index 3bc0e64..f1465fb 100644 (file)
@@ -1314,23 +1314,4 @@ static struct pci_driver zoran_driver = {
        .remove = zoran_remove,
 };
 
-static int __init zoran_init(void)
-{
-       int res;
-
-       res = pci_register_driver(&zoran_driver);
-       if (res) {
-               pr_err("Unable to register ZR36057 driver\n");
-               return res;
-       }
-
-       return 0;
-}
-
-static void __exit zoran_exit(void)
-{
-       pci_unregister_driver(&zoran_driver);
-}
-
-module_init(zoran_init);
-module_exit(zoran_exit);
+module_pci_driver(zoran_driver);