2024-03-29 17:10:37

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/6] wifi: ath10k: sdio: simplify module initialization

This driver's initialization functions do not perform any custom code,
except printing messages. Printing messages on modules
loading/unloading is discouraged because it pollutes the dmesg
regardless whether user actually has this device. Core kernel code
already gives tools to investigate whether module was loaded or not.

Drop the printing messages which allows to replace open-coded
module_sdio_driver().

Signed-off-by: Krzysztof Kozlowski <[email protected]>

---

FYI:
I have ongoing patchset touching few lines above this patch chunk
(sdio_driver) which might go via different tree. If that patchset is
applied via different tree, it might result in a trivial conflict, but
there is no dependency. They can go via separate trees (except that
trivial conflict).
---
drivers/net/wireless/ath/ath10k/sdio.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c
index 0ab5433f6cf6..1acb9fba9a8e 100644
--- a/drivers/net/wireless/ath/ath10k/sdio.c
+++ b/drivers/net/wireless/ath/ath10k/sdio.c
@@ -2671,25 +2671,7 @@ static struct sdio_driver ath10k_sdio_driver = {
.pm = ATH10K_SDIO_PM_OPS,
},
};
-
-static int __init ath10k_sdio_init(void)
-{
- int ret;
-
- ret = sdio_register_driver(&ath10k_sdio_driver);
- if (ret)
- pr_err("sdio driver registration failed: %d\n", ret);
-
- return ret;
-}
-
-static void __exit ath10k_sdio_exit(void)
-{
- sdio_unregister_driver(&ath10k_sdio_driver);
-}
-
-module_init(ath10k_sdio_init);
-module_exit(ath10k_sdio_exit);
+module_sdio_driver(ath10k_sdio_driver);

MODULE_AUTHOR("Qualcomm Atheros");
MODULE_DESCRIPTION("Driver support for Qualcomm Atheros 802.11ac WLAN SDIO devices");
--
2.34.1



2024-03-29 17:10:54

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 3/6] wifi: rsi: sdio: simplify module initialization

This driver's initialization functions do not perform any custom code,
except printing messages. Printing messages on modules
loading/unloading is discouraged because it pollutes the dmesg
regardless whether user actually has this device. Core kernel code
already gives tools to investigate whether module was loaded or not.

Drop the printing messages which allows to replace open-coded
module_sdio_driver().

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/net/wireless/rsi/rsi_91x_sdio.c | 31 +------------------------
1 file changed, 1 insertion(+), 30 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c
index 8e7b757475d2..1e578533e473 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
@@ -1519,36 +1519,7 @@ static struct sdio_driver rsi_driver = {
}
#endif
};
-
-/**
- * rsi_module_init() - This function registers the sdio module.
- * @void: Void.
- *
- * Return: 0 on success.
- */
-static int rsi_module_init(void)
-{
- int ret;
-
- ret = sdio_register_driver(&rsi_driver);
- rsi_dbg(INIT_ZONE, "%s: Registering driver\n", __func__);
- return ret;
-}
-
-/**
- * rsi_module_exit() - This function unregisters the sdio module.
- * @void: Void.
- *
- * Return: None.
- */
-static void rsi_module_exit(void)
-{
- sdio_unregister_driver(&rsi_driver);
- rsi_dbg(INFO_ZONE, "%s: Unregistering driver\n", __func__);
-}
-
-module_init(rsi_module_init);
-module_exit(rsi_module_exit);
+module_sdio_driver(rsi_driver);

MODULE_AUTHOR("Redpine Signals Inc");
MODULE_DESCRIPTION("Common SDIO layer for RSI drivers");
--
2.34.1


2024-03-29 17:11:07

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 4/6] wifi: ti: wl1251: simplify module initialization

This driver's initialization functions do not perform any custom code,
except printing messages. Printing messages on modules
loading/unloading is discouraged because it pollutes the dmesg
regardless whether user actually has this device. Core kernel code
already gives tools to investigate whether module was loaded or not.

Drop the printing messages which allows to replace open-coded
module_sdio_driver().

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/net/wireless/ti/wl1251/sdio.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
index 4e5b351f80f0..c705081249d6 100644
--- a/drivers/net/wireless/ti/wl1251/sdio.c
+++ b/drivers/net/wireless/ti/wl1251/sdio.c
@@ -323,25 +323,7 @@ static struct sdio_driver wl1251_sdio_driver = {
.remove = wl1251_sdio_remove,
.drv.pm = &wl1251_sdio_pm_ops,
};
-
-static int __init wl1251_sdio_init(void)
-{
- int err;
-
- err = sdio_register_driver(&wl1251_sdio_driver);
- if (err)
- wl1251_error("failed to register sdio driver: %d", err);
- return err;
-}
-
-static void __exit wl1251_sdio_exit(void)
-{
- sdio_unregister_driver(&wl1251_sdio_driver);
- wl1251_notice("unloaded");
-}
-
-module_init(wl1251_sdio_init);
-module_exit(wl1251_sdio_exit);
+module_sdio_driver(wl1251_sdio_driver);

MODULE_DESCRIPTION("TI WL1251 SDIO helpers");
MODULE_LICENSE("GPL");
--
2.34.1


2024-03-29 17:11:30

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 5/6] wifi: microchip: wilc1000: replace open-coded module_sdio_driver()

Use module_sdio_driver() instead of open-coding it. No functional
difference.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/net/wireless/microchip/wilc1000/sdio.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c
index d6d394693090..52a770c5e76f 100644
--- a/drivers/net/wireless/microchip/wilc1000/sdio.c
+++ b/drivers/net/wireless/microchip/wilc1000/sdio.c
@@ -981,8 +981,7 @@ static struct sdio_driver wilc_sdio_driver = {
.of_match_table = wilc_of_match,
}
};
-module_driver(wilc_sdio_driver,
- sdio_register_driver,
- sdio_unregister_driver);
+module_sdio_driver(wilc_sdio_driver);
+
MODULE_DESCRIPTION("Atmel WILC1000 SDIO wireless driver");
MODULE_LICENSE("GPL");
--
2.34.1


2024-03-29 17:11:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 6/6] wifi: marvell: mwifiex: replace open-coded module_sdio_driver()

Use module_sdio_driver() instead of open-coding it. No functional
difference.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 75f53c2f1e1f..e1b58ca1b3ba 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -3183,7 +3183,7 @@ static struct mwifiex_if_ops sdio_ops = {
.up_dev = mwifiex_sdio_up_dev,
};

-module_driver(mwifiex_sdio, sdio_register_driver, sdio_unregister_driver);
+module_sdio_driver(mwifiex_sdio);

MODULE_AUTHOR("Marvell International Ltd.");
MODULE_DESCRIPTION("Marvell WiFi-Ex SDIO Driver version " SDIO_VERSION);
--
2.34.1


2024-03-31 20:26:21

by Francesco Dolcini

[permalink] [raw]
Subject: Re: [PATCH 6/6] wifi: marvell: mwifiex: replace open-coded module_sdio_driver()

On Fri, Mar 29, 2024 at 06:10:19PM +0100, Krzysztof Kozlowski wrote:
> Use module_sdio_driver() instead of open-coding it. No functional
> difference.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Francesco Dolcini <[email protected]>


2024-04-03 13:56:01

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/6] wifi: ath10k: sdio: simplify module initialization

On 03/04/2024 15:50, Kalle Valo wrote:
> Jeff Johnson <[email protected]> writes:
>
>> On 3/29/2024 10:10 AM, Krzysztof Kozlowski wrote:
>>> This driver's initialization functions do not perform any custom code,
>>> except printing messages. Printing messages on modules
>>> loading/unloading is discouraged because it pollutes the dmesg
>>> regardless whether user actually has this device. Core kernel code
>>> already gives tools to investigate whether module was loaded or not.
>>>
>>> Drop the printing messages which allows to replace open-coded
>>> module_sdio_driver().
>>>
>>> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>>
>> Acked-by: Jeff Johnson <[email protected]>
>>
>>>
>>> ---
>>>
>>> FYI:
>>> I have ongoing patchset touching few lines above this patch chunk
>>> (sdio_driver) which might go via different tree. If that patchset is
>>> applied via different tree, it might result in a trivial conflict, but
>>> there is no dependency. They can go via separate trees (except that
>>> trivial conflict).
>>
>> I'll let Kalle respond if he'll take this through the ath tree vs letting you
>> take it through your tree
>
> I prefer to avoid conflicts as much as possible. In this patchset I'm
> not anticipating any conflicts with wireless trees, so if we can avoid
> any conflicts, please take this patchset via the other tree:
>
> Acked-by: Kalle Valo <[email protected]>
>
> I'll drop this patchset from my queue. But if I should take these to
> wireless trees instead just let me know.

OK, let me squeeze both through sdio, with corrected subjects.

Best regards,
Krzysztof


2024-04-03 14:05:46

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/6] wifi: ath10k: sdio: simplify module initialization

On 03/04/2024 15:50, Kalle Valo wrote:
> Jeff Johnson <[email protected]> writes:
>
>> On 3/29/2024 10:10 AM, Krzysztof Kozlowski wrote:
>>> This driver's initialization functions do not perform any custom code,
>>> except printing messages. Printing messages on modules
>>> loading/unloading is discouraged because it pollutes the dmesg
>>> regardless whether user actually has this device. Core kernel code
>>> already gives tools to investigate whether module was loaded or not.
>>>
>>> Drop the printing messages which allows to replace open-coded
>>> module_sdio_driver().
>>>
>>> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>>
>> Acked-by: Jeff Johnson <[email protected]>
>>
>>>
>>> ---
>>>
>>> FYI:
>>> I have ongoing patchset touching few lines above this patch chunk
>>> (sdio_driver) which might go via different tree. If that patchset is
>>> applied via different tree, it might result in a trivial conflict, but
>>> there is no dependency. They can go via separate trees (except that
>>> trivial conflict).
>>
>> I'll let Kalle respond if he'll take this through the ath tree vs letting you
>> take it through your tree
>
> I prefer to avoid conflicts as much as possible. In this patchset I'm
> not anticipating any conflicts with wireless trees, so if we can avoid
> any conflicts, please take this patchset via the other tree:
>
> Acked-by: Kalle Valo <[email protected]>
>
> I'll drop this patchset from my queue. But if I should take these to
> wireless trees instead just let me know.

Just to clarify - only the first patch has possible conflict. The rest
should be fine. Can you pick up 2-6 patches from this set?

Best regards,
Krzysztof


2024-04-03 14:26:47

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 1/6] wifi: ath10k: sdio: simplify module initialization

Krzysztof Kozlowski <[email protected]> writes:

> On 03/04/2024 15:50, Kalle Valo wrote:
>
>> Jeff Johnson <[email protected]> writes:
>>
>>> On 3/29/2024 10:10 AM, Krzysztof Kozlowski wrote:
>>>> This driver's initialization functions do not perform any custom code,
>>>> except printing messages. Printing messages on modules
>>>> loading/unloading is discouraged because it pollutes the dmesg
>>>> regardless whether user actually has this device. Core kernel code
>>>> already gives tools to investigate whether module was loaded or not.
>>>>
>>>> Drop the printing messages which allows to replace open-coded
>>>> module_sdio_driver().
>>>>
>>>> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>>>
>>> Acked-by: Jeff Johnson <[email protected]>
>>>
>>>>
>>>> ---
>>>>
>>>> FYI:
>>>> I have ongoing patchset touching few lines above this patch chunk
>>>> (sdio_driver) which might go via different tree. If that patchset is
>>>> applied via different tree, it might result in a trivial conflict, but
>>>> there is no dependency. They can go via separate trees (except that
>>>> trivial conflict).
>>>
>>> I'll let Kalle respond if he'll take this through the ath tree vs letting you
>>> take it through your tree
>>
>> I prefer to avoid conflicts as much as possible. In this patchset I'm
>> not anticipating any conflicts with wireless trees, so if we can avoid
>> any conflicts, please take this patchset via the other tree:
>>
>> Acked-by: Kalle Valo <[email protected]>
>>
>> I'll drop this patchset from my queue. But if I should take these to
>> wireless trees instead just let me know.
>
> Just to clarify - only the first patch has possible conflict. The rest
> should be fine.

Ah, I was not quite sure what patches had the conflict.

> Can you pick up 2-6 patches from this set?

Yeah, that sounds the best. So patches 2-6 are back in my queue:

https://patchwork.kernel.org/project/linux-wireless/list/?series=839844&state=*&order=date

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2024-04-05 09:00:13

by Kalle Valo

[permalink] [raw]
Subject: Re: [3/6] wifi: rsi: sdio: simplify module initialization

Krzysztof Kozlowski <[email protected]> wrote:

> This driver's initialization functions do not perform any custom code,
> except printing messages. Printing messages on modules
> loading/unloading is discouraged because it pollutes the dmesg
> regardless whether user actually has this device. Core kernel code
> already gives tools to investigate whether module was loaded or not.
>
> Drop the printing messages which allows to replace open-coded
> module_sdio_driver().
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

4 patches applied to wireless-next.git, thanks.

73ec84df3469 wifi: rsi: sdio: simplify module initialization
718fcb7d7b3f wifi: wl1251: simplify module initialization
c33c93e9e96a wifi: wilc1000: replace open-coded module_sdio_driver()
170861bc0044 wifi: mwifiex: replace open-coded module_sdio_driver()

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches