2013-05-29 10:32:24

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 1/2] net: wireless: wl1251: Use module_spi_driver macro

module_spi_driver() eliminates some boiler plate and makes code
simpler.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/net/wireless/ti/wl1251/spi.c | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
index 4c67c2f..dfd0877 100644
--- a/drivers/net/wireless/ti/wl1251/spi.c
+++ b/drivers/net/wireless/ti/wl1251/spi.c
@@ -329,29 +329,7 @@ static struct spi_driver wl1251_spi_driver = {
.remove = wl1251_spi_remove,
};

-static int __init wl1251_spi_init(void)
-{
- int ret;
-
- ret = spi_register_driver(&wl1251_spi_driver);
- if (ret < 0) {
- wl1251_error("failed to register spi driver: %d", ret);
- goto out;
- }
-
-out:
- return ret;
-}
-
-static void __exit wl1251_spi_exit(void)
-{
- spi_unregister_driver(&wl1251_spi_driver);
-
- wl1251_notice("unloaded");
-}
-
-module_init(wl1251_spi_init);
-module_exit(wl1251_spi_exit);
+module_spi_driver(wl1251_spi_driver);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Kalle Valo <[email protected]>");
--
1.7.9.5



2013-05-29 10:32:29

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 2/2] net: wireless: wl1251: Fix commenting style

Make the commenting style consistent with networking block comment
style as suggested by checkpatch.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/net/wireless/ti/wl1251/spi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
index dfd0877..c7dc6fe 100644
--- a/drivers/net/wireless/ti/wl1251/spi.c
+++ b/drivers/net/wireless/ti/wl1251/spi.c
@@ -93,8 +93,7 @@ static void wl1251_spi_wake(struct wl1251 *wl)
memset(&t, 0, sizeof(t));
spi_message_init(&m);

- /*
- * Set WSPI_INIT_COMMAND
+ /* Set WSPI_INIT_COMMAND
* the data is being send from the MSB to LSB
*/
cmd[2] = 0xff;
@@ -262,7 +261,8 @@ static int wl1251_spi_probe(struct spi_device *spi)
wl->if_ops = &wl1251_spi_ops;

/* This is the only SPI value that we need to set here, the rest
- * comes from the board-peripherals file */
+ * comes from the board-peripherals file
+ */
spi->bits_per_word = 32;

ret = spi_setup(spi);
--
1.7.9.5


2013-06-06 11:48:36

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH 1/2] net: wireless: wl1251: Use module_spi_driver macro

Hi Sachin,

On Thu, 2013-06-06 at 14:48 +0530, Sachin Kamat wrote:
> On 29 May 2013 15:48, Sachin Kamat <[email protected]> wrote:
> > module_spi_driver() eliminates some boiler plate and makes code
> > simpler.
> >
> > Signed-off-by: Sachin Kamat <[email protected]>
> > ---
> > drivers/net/wireless/ti/wl1251/spi.c | 24 +-----------------------
> > 1 file changed, 1 insertion(+), 23 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
> > index 4c67c2f..dfd0877 100644
> > --- a/drivers/net/wireless/ti/wl1251/spi.c
> > +++ b/drivers/net/wireless/ti/wl1251/spi.c
> > @@ -329,29 +329,7 @@ static struct spi_driver wl1251_spi_driver = {
> > .remove = wl1251_spi_remove,
> > };
> >
> > -static int __init wl1251_spi_init(void)
> > -{
> > - int ret;
> > -
> > - ret = spi_register_driver(&wl1251_spi_driver);
> > - if (ret < 0) {
> > - wl1251_error("failed to register spi driver: %d", ret);
> > - goto out;
> > - }
> > -
> > -out:
> > - return ret;
> > -}
> > -
> > -static void __exit wl1251_spi_exit(void)
> > -{
> > - spi_unregister_driver(&wl1251_spi_driver);
> > -
> > - wl1251_notice("unloaded");
> > -}
> > -
> > -module_init(wl1251_spi_init);
> > -module_exit(wl1251_spi_exit);
> > +module_spi_driver(wl1251_spi_driver);
> >
> > MODULE_LICENSE("GPL");
> > MODULE_AUTHOR("Kalle Valo <[email protected]>");
> > --
> > 1.7.9.5
> >
>
> Gentle ping on this series John.

This is in my queue. Haven't had the time to review and apply them yet.
And these are not urgent changes, so they can wait a little while.

--
Luca.


2013-06-17 09:24:43

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH 1/2] net: wireless: wl1251: Use module_spi_driver macro

On Wed, 2013-05-29 at 15:48 +0530, Sachin Kamat wrote:
> module_spi_driver() eliminates some boiler plate and makes code
> simpler.
>
> Signed-off-by: Sachin Kamat <[email protected]>
> ---

Applied both patches in this series.

Thanks!

--
Luca.


2013-06-06 09:18:18

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 1/2] net: wireless: wl1251: Use module_spi_driver macro

On 29 May 2013 15:48, Sachin Kamat <[email protected]> wrote:
> module_spi_driver() eliminates some boiler plate and makes code
> simpler.
>
> Signed-off-by: Sachin Kamat <[email protected]>
> ---
> drivers/net/wireless/ti/wl1251/spi.c | 24 +-----------------------
> 1 file changed, 1 insertion(+), 23 deletions(-)
>
> diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
> index 4c67c2f..dfd0877 100644
> --- a/drivers/net/wireless/ti/wl1251/spi.c
> +++ b/drivers/net/wireless/ti/wl1251/spi.c
> @@ -329,29 +329,7 @@ static struct spi_driver wl1251_spi_driver = {
> .remove = wl1251_spi_remove,
> };
>
> -static int __init wl1251_spi_init(void)
> -{
> - int ret;
> -
> - ret = spi_register_driver(&wl1251_spi_driver);
> - if (ret < 0) {
> - wl1251_error("failed to register spi driver: %d", ret);
> - goto out;
> - }
> -
> -out:
> - return ret;
> -}
> -
> -static void __exit wl1251_spi_exit(void)
> -{
> - spi_unregister_driver(&wl1251_spi_driver);
> -
> - wl1251_notice("unloaded");
> -}
> -
> -module_init(wl1251_spi_init);
> -module_exit(wl1251_spi_exit);
> +module_spi_driver(wl1251_spi_driver);
>
> MODULE_LICENSE("GPL");
> MODULE_AUTHOR("Kalle Valo <[email protected]>");
> --
> 1.7.9.5
>

Gentle ping on this series John.

--
With warm regards,
Sachin

2013-06-06 11:51:23

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH 1/2] net: wireless: wl1251: Use module_spi_driver macro

Hi Luciano,

On 6 June 2013 17:16, Luciano Coelho <[email protected]> wrote:
> Hi Sachin,
>
> On Thu, 2013-06-06 at 14:48 +0530, Sachin Kamat wrote:
>> On 29 May 2013 15:48, Sachin Kamat <[email protected]> wrote:
>> > module_spi_driver() eliminates some boiler plate and makes code
>> > simpler.
>> >
>> > Signed-off-by: Sachin Kamat <[email protected]>
>> > ---
>> > drivers/net/wireless/ti/wl1251/spi.c | 24 +-----------------------
>> > 1 file changed, 1 insertion(+), 23 deletions(-)
>> >
>> > diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
>> > index 4c67c2f..dfd0877 100644
>> > --- a/drivers/net/wireless/ti/wl1251/spi.c
>> > +++ b/drivers/net/wireless/ti/wl1251/spi.c
>> > @@ -329,29 +329,7 @@ static struct spi_driver wl1251_spi_driver = {
>> > .remove = wl1251_spi_remove,
>> > };
>> >
>> > -static int __init wl1251_spi_init(void)
>> > -{
>> > - int ret;
>> > -
>> > - ret = spi_register_driver(&wl1251_spi_driver);
>> > - if (ret < 0) {
>> > - wl1251_error("failed to register spi driver: %d", ret);
>> > - goto out;
>> > - }
>> > -
>> > -out:
>> > - return ret;
>> > -}
>> > -
>> > -static void __exit wl1251_spi_exit(void)
>> > -{
>> > - spi_unregister_driver(&wl1251_spi_driver);
>> > -
>> > - wl1251_notice("unloaded");
>> > -}
>> > -
>> > -module_init(wl1251_spi_init);
>> > -module_exit(wl1251_spi_exit);
>> > +module_spi_driver(wl1251_spi_driver);
>> >
>> > MODULE_LICENSE("GPL");
>> > MODULE_AUTHOR("Kalle Valo <[email protected]>");
>> > --
>> > 1.7.9.5
>> >
>>
>> Gentle ping on this series John.
>
> This is in my queue. Haven't had the time to review and apply them yet.
> And these are not urgent changes, so they can wait a little while.

Sure. Thanks.


--
With warm regards,
Sachin