linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] EDAC/aspeed: use module_platform_driver to simplify the code
@ 2020-09-14  6:53 Liu Shixin
  2020-09-14  6:38 ` Joel Stanley
  2020-09-16 17:22 ` Borislav Petkov
  0 siblings, 2 replies; 3+ messages in thread
From: Liu Shixin @ 2020-09-14  6:53 UTC (permalink / raw)
  To: Stefan Schaeckeler, Borislav Petkov, Mauro Carvalho Chehab,
	Tony Luck, James Morse, Robert Richter, Joel Stanley,
	Andrew Jeffery
  Cc: linux-edac, linux-arm-kernel, linux-aspeed, linux-kernel, Liu Shixin

module_platform_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/edac/aspeed_edac.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
index fbec28dc661d..fde809efc520 100644
--- a/drivers/edac/aspeed_edac.c
+++ b/drivers/edac/aspeed_edac.c
@@ -388,23 +388,7 @@ static struct platform_driver aspeed_driver = {
 	.probe		= aspeed_probe,
 	.remove		= aspeed_remove
 };
-
-
-static int __init aspeed_init(void)
-{
-	return platform_driver_register(&aspeed_driver);
-}
-
-
-static void __exit aspeed_exit(void)
-{
-	platform_driver_unregister(&aspeed_driver);
-}
-
-
-module_init(aspeed_init);
-module_exit(aspeed_exit);
-
+module_platform_driver(aspeed_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Stefan Schaeckeler <sschaeck@cisco.com>");
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-16 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14  6:53 [PATCH -next] EDAC/aspeed: use module_platform_driver to simplify the code Liu Shixin
2020-09-14  6:38 ` Joel Stanley
2020-09-16 17:22 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).