scsi: jazz_esp: Use module_platform_driver to simplify the code
authorLiu Shixin <liushixin2@huawei.com>
Mon, 14 Sep 2020 06:54:03 +0000 (14:54 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 3 Oct 2020 01:52:52 +0000 (21:52 -0400)
Use module_platform_driver() to eliminate boilerplate code.

Link: https://lore.kernel.org/r/20200914065403.3726462-1-liushixin2@huawei.com
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/jazz_esp.c

index 7f683e42c798707798b7d4690074aca4cdba0447..f0ed6863cc70014ed7195d0c205a9783e0600d22 100644 (file)
@@ -201,21 +201,9 @@ static struct platform_driver esp_jazz_driver = {
                .name   = "jazz_esp",
        },
 };
-
-static int __init jazz_esp_init(void)
-{
-       return platform_driver_register(&esp_jazz_driver);
-}
-
-static void __exit jazz_esp_exit(void)
-{
-       platform_driver_unregister(&esp_jazz_driver);
-}
+module_platform_driver(esp_jazz_driver);
 
 MODULE_DESCRIPTION("JAZZ ESP SCSI driver");
 MODULE_AUTHOR("Thomas Bogendoerfer (tsbogend@alpha.franken.de)");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
-
-module_init(jazz_esp_init);
-module_exit(jazz_esp_exit);