scsi: mac_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:53 +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/mac_esp.c

index 1c78bc10c79021dd493f446b48ec97bc242a76b7..6d23ab5aee562f107e0cf262c6457ed02236cfd3 100644 (file)
@@ -439,22 +439,10 @@ static struct platform_driver esp_mac_driver = {
                .name   = DRV_MODULE_NAME,
        },
 };
-
-static int __init mac_esp_init(void)
-{
-       return platform_driver_register(&esp_mac_driver);
-}
-
-static void __exit mac_esp_exit(void)
-{
-       platform_driver_unregister(&esp_mac_driver);
-}
+module_platform_driver(esp_mac_driver);
 
 MODULE_DESCRIPTION("Mac ESP SCSI driver");
 MODULE_AUTHOR("Finn Thain");
 MODULE_LICENSE("GPL v2");
 MODULE_VERSION(DRV_VERSION);
 MODULE_ALIAS("platform:" DRV_MODULE_NAME);
-
-module_init(mac_esp_init);
-module_exit(mac_esp_exit);