Skip to contentSkip to conversation

coresight: dummy: simplify the code with module_platform_driver

PATCH Applied Yang Yingliang 2 participants 2 messages Aug 4, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coresight: dummy: simplify the code with module_platform_driver

The init/exit() of driver only calls platform_driver_register/unregister, it can be simpilfied with module_platform_driver.

---
 drivers/hwtracing/coresight/coresight-dummy.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/hwtracing/coresight/coresight-dummy.c +1 -11
index 8035120b70b3..e4deafae7bc2 100644
@@ -147,17 +147,7 @@ static struct platform_driver dummy_driver = {
 	},
 };
 
-static int __init dummy_init(void)
-{
-	return platform_driver_register(&dummy_driver);
-}
-module_init(dummy_init);
-
-static void __exit dummy_exit(void)
-{
-	platform_driver_unregister(&dummy_driver);
-}
-module_exit(dummy_exit);
+module_platform_driver(dummy_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("CoreSight dummy driver");
Signature · 7 lines
2.25.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Applied
#1 lore raw
Quoted 4 lines · Yang Yingliang

The init/exit() of driver only calls platform_driver_register/unregister, it can be simpilfied with module_platform_driver.

Applied, thanks!

[1/1] coresight: dummy: simplify the code with module_platform_driver

      https://git.kernel.org/coresight/c/28a03fae6e524d39fec14fea1ee67b86f4870658

Best regards,

Signature · 6 lines
Suzuki K Poulose <[email protected]>

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel