2014-07-22 12:14:12

by Tobias Klauser

[permalink] [raw]
Subject: [PATCH] mailbox/omap: Use module_platform_driver

Use the module_platform_driver to omit module init/exit boilerplate code.

Signed-off-by: Tobias Klauser <[email protected]>
---
drivers/mailbox/mailbox-omap1.c | 13 +------------
drivers/mailbox/mailbox-omap2.c | 13 +------------
2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/mailbox/mailbox-omap1.c b/drivers/mailbox/mailbox-omap1.c
index 9001b76..735aeef 100644
--- a/drivers/mailbox/mailbox-omap1.c
+++ b/drivers/mailbox/mailbox-omap1.c
@@ -184,18 +184,7 @@ static struct platform_driver omap1_mbox_driver = {
},
};

-static int __init omap1_mbox_init(void)
-{
- return platform_driver_register(&omap1_mbox_driver);
-}
-
-static void __exit omap1_mbox_exit(void)
-{
- platform_driver_unregister(&omap1_mbox_driver);
-}
-
-module_init(omap1_mbox_init);
-module_exit(omap1_mbox_exit);
+module_platform_driver(omap1_mbox_driver);

MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("omap mailbox: omap1 architecture specific functions");
diff --git a/drivers/mailbox/mailbox-omap2.c b/drivers/mailbox/mailbox-omap2.c
index 42d2b89..a9dedf0 100644
--- a/drivers/mailbox/mailbox-omap2.c
+++ b/drivers/mailbox/mailbox-omap2.c
@@ -337,18 +337,7 @@ static struct platform_driver omap2_mbox_driver = {
},
};

-static int __init omap2_mbox_init(void)
-{
- return platform_driver_register(&omap2_mbox_driver);
-}
-
-static void __exit omap2_mbox_exit(void)
-{
- platform_driver_unregister(&omap2_mbox_driver);
-}
-
-module_init(omap2_mbox_init);
-module_exit(omap2_mbox_exit);
+module_platform_driver(omap2_mbox_driver);

MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("omap mailbox: omap2/3/4 architecture specific functions");
--
2.0.1


2014-07-22 15:00:55

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCH] mailbox/omap: Use module_platform_driver

Hi Tobias,

On 07/22/2014 07:13 AM, Tobias Klauser wrote:
> Use the module_platform_driver to omit module init/exit boilerplate code.
>
> Signed-off-by: Tobias Klauser <[email protected]>
> ---
> drivers/mailbox/mailbox-omap1.c | 13 +------------
> drivers/mailbox/mailbox-omap2.c | 13 +------------
> 2 files changed, 2 insertions(+), 24 deletions(-)

I have submitted a series that cleans up/consolidates the OMAP mailbox
driver [1], and this patch won't be necessary as the same lines get deleted.

regards
Suman

[1] http://www.spinics.net/lists/linux-omap/msg108574.html

2014-07-23 00:52:21

by Jingoo Han

[permalink] [raw]
Subject: Re: [PATCH] mailbox/omap: Use module_platform_driver

On Tuesday, July 22, 2014 9:14 PM, Tobias Klauser wrote:
>
> Use the module_platform_driver to omit module init/exit boilerplate code.
>
> Signed-off-by: Tobias Klauser <[email protected]>

Reviewed-by: Jingoo Han <[email protected]>

Best regards,
Jingoo Han

> ---
> drivers/mailbox/mailbox-omap1.c | 13 +------------
> drivers/mailbox/mailbox-omap2.c | 13 +------------
> 2 files changed, 2 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/mailbox/mailbox-omap1.c b/drivers/mailbox/mailbox-omap1.c
> index 9001b76..735aeef 100644
> --- a/drivers/mailbox/mailbox-omap1.c
> +++ b/drivers/mailbox/mailbox-omap1.c
> @@ -184,18 +184,7 @@ static struct platform_driver omap1_mbox_driver = {
> },
> };
>
> -static int __init omap1_mbox_init(void)
> -{
> - return platform_driver_register(&omap1_mbox_driver);
> -}
> -
> -static void __exit omap1_mbox_exit(void)
> -{
> - platform_driver_unregister(&omap1_mbox_driver);
> -}
> -
> -module_init(omap1_mbox_init);
> -module_exit(omap1_mbox_exit);
> +module_platform_driver(omap1_mbox_driver);
>
> MODULE_LICENSE("GPL v2");
> MODULE_DESCRIPTION("omap mailbox: omap1 architecture specific functions");
> diff --git a/drivers/mailbox/mailbox-omap2.c b/drivers/mailbox/mailbox-omap2.c
> index 42d2b89..a9dedf0 100644
> --- a/drivers/mailbox/mailbox-omap2.c
> +++ b/drivers/mailbox/mailbox-omap2.c
> @@ -337,18 +337,7 @@ static struct platform_driver omap2_mbox_driver = {
> },
> };
>
> -static int __init omap2_mbox_init(void)
> -{
> - return platform_driver_register(&omap2_mbox_driver);
> -}
> -
> -static void __exit omap2_mbox_exit(void)
> -{
> - platform_driver_unregister(&omap2_mbox_driver);
> -}
> -
> -module_init(omap2_mbox_init);
> -module_exit(omap2_mbox_exit);
> +module_platform_driver(omap2_mbox_driver);
>
> MODULE_LICENSE("GPL v2");
> MODULE_DESCRIPTION("omap mailbox: omap2/3/4 architecture specific functions");
> --
> 2.0.1

2014-07-23 00:57:23

by Jingoo Han

[permalink] [raw]
Subject: Re: [PATCH] mailbox/omap: Use module_platform_driver

On Wednesday, July 23, 2014 12:01 AM, Suman Anna wrote:
> On 07/22/2014 07:13 AM, Tobias Klauser wrote:
> > Use the module_platform_driver to omit module init/exit boilerplate code.
> >
> > Signed-off-by: Tobias Klauser <[email protected]>
> > ---
> > drivers/mailbox/mailbox-omap1.c | 13 +------------
> > drivers/mailbox/mailbox-omap2.c | 13 +------------
> > 2 files changed, 2 insertions(+), 24 deletions(-)
>
> I have submitted a series that cleans up/consolidates the OMAP mailbox
> driver [1], and this patch won't be necessary as the same lines get deleted.

Oh, I see. So, this patch is unnecessary. I hope that Jassi's mailbox framework
is submitted soon. Thank you.

Best regards,
Jingoo Han

>
> regards
> Suman
>
> [1] http://www.spinics.net/lists/linux-omap/msg108574.html

2014-07-23 01:24:14

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCH] mailbox/omap: Use module_platform_driver

On 07/22/2014 07:57 PM, Jingoo Han wrote:
> On Wednesday, July 23, 2014 12:01 AM, Suman Anna wrote:
>> On 07/22/2014 07:13 AM, Tobias Klauser wrote:
>>> Use the module_platform_driver to omit module init/exit boilerplate code.
>>>
>>> Signed-off-by: Tobias Klauser <[email protected]>
>>> ---
>>> drivers/mailbox/mailbox-omap1.c | 13 +------------
>>> drivers/mailbox/mailbox-omap2.c | 13 +------------
>>> 2 files changed, 2 insertions(+), 24 deletions(-)
>>
>> I have submitted a series that cleans up/consolidates the OMAP mailbox
>> driver [1], and this patch won't be necessary as the same lines get deleted.
>
> Oh, I see. So, this patch is unnecessary. I hope that Jassi's mailbox framework
> is submitted soon. Thank you.

Yep, its very close now, there is a v9 version posted today. In any
case, the cleanup series is independent of the framework.

regards
Suman

>>
>> [1] http://www.spinics.net/lists/linux-omap/msg108574.html
>

2014-07-23 07:43:33

by Tobias Klauser

[permalink] [raw]
Subject: Re: [PATCH] mailbox/omap: Use module_platform_driver

On 2014-07-22 at 17:00:44 +0200, Suman Anna <[email protected]> wrote:
> Hi Tobias,
>
> On 07/22/2014 07:13 AM, Tobias Klauser wrote:
> > Use the module_platform_driver to omit module init/exit boilerplate code.
> >
> > Signed-off-by: Tobias Klauser <[email protected]>
> > ---
> > drivers/mailbox/mailbox-omap1.c | 13 +------------
> > drivers/mailbox/mailbox-omap2.c | 13 +------------
> > 2 files changed, 2 insertions(+), 24 deletions(-)
>
> I have submitted a series that cleans up/consolidates the OMAP mailbox
> driver [1], and this patch won't be necessary as the same lines get deleted.

Ah, I wasn't aware of this series. Should do my homework better next
time ;) Sorry for the noise.

Thanks
Tobias