Skip to content

Commit

Permalink
hwspinlock: sprd: use module_platform_driver() instead postcore initcall
Browse files Browse the repository at this point in the history
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.

Reviewed-by: Baolin Wang <baolin.wang7@gmail.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Link: https://lore.kernel.org/r/20201030034654.15775-3-zhang.lyra@gmail.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
Chunyan Zhang authored and Bjorn Andersson committed Nov 3, 2020
1 parent 3116a99 commit 8308678
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions drivers/hwspinlock/sprd_hwspinlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,7 @@ static struct platform_driver sprd_hwspinlock_driver = {
.of_match_table = of_match_ptr(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");
Expand Down

0 comments on commit 8308678

Please sign in to comment.