* [PATCH -next] pinctrl: sprd: use module_platform_driver to simplify the code
@ 2020-09-14 6:54 Liu Shixin
2020-09-14 8:12 ` Chunyan Zhang
2020-09-29 12:53 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Liu Shixin @ 2020-09-14 6:54 UTC (permalink / raw)
To: Linus Walleij, Orson Zhai, Baolin Wang, Chunyan Zhang
Cc: linux-gpio, linux-kernel, Liu Shixin
module_platform_driver() makes the code simpler by eliminating
boilerplate code.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c b/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
index 06c8671b40e7..d14f382f2392 100644
--- a/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
@@ -946,18 +946,7 @@ static struct platform_driver sprd_pinctrl_driver = {
.remove = sprd_pinctrl_remove,
.shutdown = sprd_pinctrl_shutdown,
};
-
-static int sprd_pinctrl_init(void)
-{
- return platform_driver_register(&sprd_pinctrl_driver);
-}
-module_init(sprd_pinctrl_init);
-
-static void sprd_pinctrl_exit(void)
-{
- platform_driver_unregister(&sprd_pinctrl_driver);
-}
-module_exit(sprd_pinctrl_exit);
+module_platform_driver(sprd_pinctrl_driver);
MODULE_DESCRIPTION("SPREADTRUM Pin Controller Driver");
MODULE_AUTHOR("Baolin Wang <baolin.wang@spreadtrum.com>");
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] pinctrl: sprd: use module_platform_driver to simplify the code
2020-09-14 6:54 [PATCH -next] pinctrl: sprd: use module_platform_driver to simplify the code Liu Shixin
@ 2020-09-14 8:12 ` Chunyan Zhang
2020-09-29 12:53 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Chunyan Zhang @ 2020-09-14 8:12 UTC (permalink / raw)
To: Liu Shixin
Cc: Linus Walleij, Orson Zhai, Baolin Wang, linux-gpio,
Linux Kernel Mailing List
On Mon, 14 Sep 2020 at 14:32, Liu Shixin <liushixin2@huawei.com> wrote:
>
> module_platform_driver() makes the code simpler by eliminating
> boilerplate code.
>
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
Thanks,
Chunyan
> ---
> drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c b/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
> index 06c8671b40e7..d14f382f2392 100644
> --- a/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
> +++ b/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
> @@ -946,18 +946,7 @@ static struct platform_driver sprd_pinctrl_driver = {
> .remove = sprd_pinctrl_remove,
> .shutdown = sprd_pinctrl_shutdown,
> };
> -
> -static int sprd_pinctrl_init(void)
> -{
> - return platform_driver_register(&sprd_pinctrl_driver);
> -}
> -module_init(sprd_pinctrl_init);
> -
> -static void sprd_pinctrl_exit(void)
> -{
> - platform_driver_unregister(&sprd_pinctrl_driver);
> -}
> -module_exit(sprd_pinctrl_exit);
> +module_platform_driver(sprd_pinctrl_driver);
>
> MODULE_DESCRIPTION("SPREADTRUM Pin Controller Driver");
> MODULE_AUTHOR("Baolin Wang <baolin.wang@spreadtrum.com>");
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] pinctrl: sprd: use module_platform_driver to simplify the code
2020-09-14 6:54 [PATCH -next] pinctrl: sprd: use module_platform_driver to simplify the code Liu Shixin
2020-09-14 8:12 ` Chunyan Zhang
@ 2020-09-29 12:53 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2020-09-29 12:53 UTC (permalink / raw)
To: Liu Shixin
Cc: Orson Zhai, Baolin Wang, Chunyan Zhang, open list:GPIO SUBSYSTEM,
linux-kernel
On Mon, Sep 14, 2020 at 8:31 AM Liu Shixin <liushixin2@huawei.com> wrote:
> module_platform_driver() makes the code simpler by eliminating
> boilerplate code.
>
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Patch applied!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-29 12:53 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:54 [PATCH -next] pinctrl: sprd: use module_platform_driver to simplify the code Liu Shixin
2020-09-14 8:12 ` Chunyan Zhang
2020-09-29 12:53 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.