hwspinlock: sprd: fixed warning of unused variable 'sprd_hwspinlock_of_match'
Subsystems (2)
Chunyan Zhang
reviewerPATCH 1/2 hwspinlock: sprd: fixed warning of unused variable 'sprd_hwspinlock_of_match'
From: Chunyan Zhang <[email protected]>
The macro function of_match_ptr() is NULL if CONFIG_OF is not set, in this case Clang compiler would complain the of_device_id variable is unused.
--- drivers/hwspinlock/sprd_hwspinlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwspinlock/sprd_hwspinlock.c +1 -1
@@ -148,7 +148,7 @@ static struct platform_driver sprd_hwspinlock_driver = { .probe = sprd_hwspinlock_probe, .driver = { .name = "sprd_hwspinlock", - .of_match_table = of_match_ptr(sprd_hwspinlock_of_match), + .of_match_table = sprd_hwspinlock_of_match, }, };
Signature · 1 line
2.20.1
Chunyan Zhang
reviewerPATCH 2/2 hwspinlock: sprd: use module_platform_driver() instead postcore initcall
From: Chunyan Zhang <[email protected]>
The hardware spinlock devices are defined in the DT, there's no need for iinit calls order, remove boilerplate code by using module_platform_driver.
--- drivers/hwspinlock/sprd_hwspinlock.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/hwspinlock/sprd_hwspinlock.c +1 -12
@@ -151,18 +151,7 @@ static struct platform_driver sprd_hwspinlock_driver = { .of_match_table = sprd_hwspinlock_of_match, }, }; - -static int __init sprd_hwspinlock_init (void ) -{ -return platform_driver_register (&sprd_hwspinlock_driver); -} -postcore_initcall (sprd_hwspinlock_init); - -static void __exit sprd_hwspinlock_exit(void) -{ -platform_driver_unregister (&sprd_hwspinlock_driver); -} -module_exit (sprd_hwspinlock_exit); +module_platform_driver (sprd_hwspinlock_driver);MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("Hardware spinlock driver for Spreadtrum" );
Signature · 1 line
2.20.1
Chunyan Zhang
reviewerPATCH 2/2 hwspinlock: sprd: use module_platform_driver() instead postcore initcall
From: Chunyan Zhang <[email protected]>
The hardware spinlock devices are defined in the DT, there's no need for init calls order, remove boilerplate code by using module_platform_driver.
--- drivers/hwspinlock/sprd_hwspinlock.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/hwspinlock/sprd_hwspinlock.c +1 -12
@@ -151,18 +151,7 @@ static struct platform_driver sprd_hwspinlock_driver = { .of_match_table = sprd_hwspinlock_of_match, }, }; - -static int __init sprd_hwspinlock_init (void ) -{ -return platform_driver_register (&sprd_hwspinlock_driver); -} -postcore_initcall (sprd_hwspinlock_init); - -static void __exit sprd_hwspinlock_exit(void) -{ -platform_driver_unregister (&sprd_hwspinlock_driver); -} -module_exit (sprd_hwspinlock_exit); +module_platform_driver (sprd_hwspinlock_driver);MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("Hardware spinlock driver for Spreadtrum" );
Signature · 1 line
2.20.1