diff mbox

e820: use module_platform_driver

Message ID 1466764164-69726-1-git-send-email-jthumshirn@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Johannes Thumshirn June 24, 2016, 10:29 a.m. UTC
User module_platform_driver macro instead of open-coding it.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/nvdimm/e820.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Dan Williams June 24, 2016, 3:40 p.m. UTC | #1
On Fri, Jun 24, 2016 at 3:29 AM, Johannes Thumshirn <jthumshirn@suse.de> wrote:
> User module_platform_driver macro instead of open-coding it.
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>

Looks good.
diff mbox

Patch

diff --git a/drivers/nvdimm/e820.c b/drivers/nvdimm/e820.c
index 95825b3..6c449fe 100644
--- a/drivers/nvdimm/e820.c
+++ b/drivers/nvdimm/e820.c
@@ -82,19 +82,8 @@  static struct platform_driver e820_pmem_driver = {
 		.name = "e820_pmem",
 	},
 };
-
-static __init int e820_pmem_init(void)
-{
-	return platform_driver_register(&e820_pmem_driver);
-}
-
-static __exit void e820_pmem_exit(void)
-{
-	platform_driver_unregister(&e820_pmem_driver);
-}
+module_platform_driver(e820_pmem_driver);
 
 MODULE_ALIAS("platform:e820_pmem*");
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Intel Corporation");
-module_init(e820_pmem_init);
-module_exit(e820_pmem_exit);