diff mbox series

[-next] coresight: dummy: simplify the code with module_platform_driver

Message ID 20230804092709.1359264-1-yangyingliang@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] coresight: dummy: simplify the code with module_platform_driver | expand

Commit Message

Yang Yingliang Aug. 4, 2023, 9:27 a.m. UTC
The init/exit() of driver only calls platform_driver_register/unregister,
it can be simpilfied with module_platform_driver.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/hwtracing/coresight/coresight-dummy.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Comments

Suzuki K Poulose Aug. 4, 2023, 1:20 p.m. UTC | #1
On Fri, 4 Aug 2023 17:27:09 +0800, Yang Yingliang wrote:
> 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,
diff mbox series

Patch

diff --git a/drivers/hwtracing/coresight/coresight-dummy.c b/drivers/hwtracing/coresight/coresight-dummy.c
index 8035120b70b3..e4deafae7bc2 100644
--- a/drivers/hwtracing/coresight/coresight-dummy.c
+++ b/drivers/hwtracing/coresight/coresight-dummy.c
@@ -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");