Skip to content

Commit

Permalink
scsi: mac_esp: Use module_platform_driver to simplify the code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liu Shixin authored and Martin K. Petersen committed Oct 3, 2020
1 parent 7fc83de commit d30fbf2
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions drivers/scsi/mac_esp.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit d30fbf2

Please sign in to comment.