* [PATCH net-next] wifi: ti/wlcore: Convert to platform remove callback returning void
@ 2023-09-12 17:12 Uwe Kleine-König
2023-09-12 17:23 ` Kalle Valo
2023-09-18 14:31 ` [net-next] wifi: wlcore: " Kalle Valo
0 siblings, 2 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2023-09-12 17:12 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
wlcore_remove() returned zero unconditionally. With that converted to
return void instead, the wl12xx and wl18xx driver can be converted to
.remove_new trivially.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/wireless/ti/wl12xx/main.c | 6 +++---
drivers/net/wireless/ti/wl18xx/main.c | 2 +-
drivers/net/wireless/ti/wlcore/main.c | 6 ++----
drivers/net/wireless/ti/wlcore/wlcore.h | 2 +-
4 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index d06a2c419447..de045fe4ca1e 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1919,7 +1919,7 @@ static int wl12xx_probe(struct platform_device *pdev)
return ret;
}
-static int wl12xx_remove(struct platform_device *pdev)
+static void wl12xx_remove(struct platform_device *pdev)
{
struct wl1271 *wl = platform_get_drvdata(pdev);
struct wl12xx_priv *priv;
@@ -1928,7 +1928,7 @@ static int wl12xx_remove(struct platform_device *pdev)
kfree(priv->rx_mem_addr);
- return wlcore_remove(pdev);
+ wlcore_remove(pdev);
}
static const struct platform_device_id wl12xx_id_table[] = {
@@ -1939,7 +1939,7 @@ MODULE_DEVICE_TABLE(platform, wl12xx_id_table);
static struct platform_driver wl12xx_driver = {
.probe = wl12xx_probe,
- .remove = wl12xx_remove,
+ .remove_new = wl12xx_remove,
.id_table = wl12xx_id_table,
.driver = {
.name = "wl12xx_driver",
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 0b3cf8477c6c..d4a89401f2c4 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -2033,7 +2033,7 @@ MODULE_DEVICE_TABLE(platform, wl18xx_id_table);
static struct platform_driver wl18xx_driver = {
.probe = wl18xx_probe,
- .remove = wlcore_remove,
+ .remove_new = wlcore_remove,
.id_table = wl18xx_id_table,
.driver = {
.name = "wl18xx_driver",
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index bf21611872a3..9dfd832b1d06 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -6737,7 +6737,7 @@ int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
}
EXPORT_SYMBOL_GPL(wlcore_probe);
-int wlcore_remove(struct platform_device *pdev)
+void wlcore_remove(struct platform_device *pdev)
{
struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev);
struct wl1271 *wl = platform_get_drvdata(pdev);
@@ -6752,7 +6752,7 @@ int wlcore_remove(struct platform_device *pdev)
if (pdev_data->family && pdev_data->family->nvs_name)
wait_for_completion(&wl->nvs_loading_complete);
if (!wl->initialized)
- return 0;
+ return;
if (wl->wakeirq >= 0) {
dev_pm_clear_wake_irq(wl->dev);
@@ -6772,8 +6772,6 @@ int wlcore_remove(struct platform_device *pdev)
free_irq(wl->irq, wl);
wlcore_free_hw(wl);
-
- return 0;
}
EXPORT_SYMBOL_GPL(wlcore_remove);
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 81c94d390623..1f8511bf9bb3 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -497,7 +497,7 @@ struct wl1271 {
};
int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
-int wlcore_remove(struct platform_device *pdev);
+void wlcore_remove(struct platform_device *pdev);
struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size,
u32 mbox_size);
int wlcore_free_hw(struct wl1271 *wl);
base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
--
2.40.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net-next] wifi: ti/wlcore: Convert to platform remove callback returning void
2023-09-12 17:12 [PATCH net-next] wifi: ti/wlcore: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-12 17:23 ` Kalle Valo
2023-09-12 20:01 ` Uwe Kleine-König
2023-09-18 14:31 ` [net-next] wifi: wlcore: " Kalle Valo
1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2023-09-12 17:23 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: linux-wireless, kernel
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> wlcore_remove() returned zero unconditionally. With that converted to
> return void instead, the wl12xx and wl18xx driver can be converted to
> .remove_new trivially.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/net/wireless/ti/wl12xx/main.c | 6 +++---
> drivers/net/wireless/ti/wl18xx/main.c | 2 +-
> drivers/net/wireless/ti/wlcore/main.c | 6 ++----
> drivers/net/wireless/ti/wlcore/wlcore.h | 2 +-
> 4 files changed, 7 insertions(+), 9 deletions(-)
wireless patches go to wireless-next, not net-next. But no need to
resend because of this.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] wifi: ti/wlcore: Convert to platform remove callback returning void
2023-09-12 17:23 ` Kalle Valo
@ 2023-09-12 20:01 ` Uwe Kleine-König
2023-09-13 2:02 ` Kalle Valo
0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2023-09-12 20:01 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, kernel
[-- Attachment #1: Type: text/plain, Size: 1712 bytes --]
Hello,
On Tue, Sep 12, 2023 at 08:23:18PM +0300, Kalle Valo wrote:
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
>
> > The .remove() callback for a platform driver returns an int which makes
> > many driver authors wrongly assume it's possible to do error handling by
> > returning an error code. However the value returned is (mostly) ignored
> > and this typically results in resource leaks. To improve here there is a
> > quest to make the remove callback return void. In the first step of this
> > quest all drivers are converted to .remove_new() which already returns
> > void.
> >
> > wlcore_remove() returned zero unconditionally. With that converted to
> > return void instead, the wl12xx and wl18xx driver can be converted to
> > .remove_new trivially.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> > drivers/net/wireless/ti/wl12xx/main.c | 6 +++---
> > drivers/net/wireless/ti/wl18xx/main.c | 2 +-
> > drivers/net/wireless/ti/wlcore/main.c | 6 ++----
> > drivers/net/wireless/ti/wlcore/wlcore.h | 2 +-
> > 4 files changed, 7 insertions(+), 9 deletions(-)
>
> wireless patches go to wireless-next, not net-next. But no need to
> resend because of this.
So for the next patch to drivers/net/wireless: I should write "[PATCH
wireless-next]" in the Subject? Do the other special rules for net-next
apply to wireless-next, too? (E.g. that I must not send patches for
-next during the merge window and the rules about comments.)
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] wifi: ti/wlcore: Convert to platform remove callback returning void
2023-09-12 20:01 ` Uwe Kleine-König
@ 2023-09-13 2:02 ` Kalle Valo
0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2023-09-13 2:02 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: linux-wireless, kernel
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> Hello,
>
> On Tue, Sep 12, 2023 at 08:23:18PM +0300, Kalle Valo wrote:
>> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
>>
>> > The .remove() callback for a platform driver returns an int which makes
>> > many driver authors wrongly assume it's possible to do error handling by
>> > returning an error code. However the value returned is (mostly) ignored
>> > and this typically results in resource leaks. To improve here there is a
>> > quest to make the remove callback return void. In the first step of this
>> > quest all drivers are converted to .remove_new() which already returns
>> > void.
>> >
>> > wlcore_remove() returned zero unconditionally. With that converted to
>> > return void instead, the wl12xx and wl18xx driver can be converted to
>> > .remove_new trivially.
>> >
>> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>> > ---
>> > drivers/net/wireless/ti/wl12xx/main.c | 6 +++---
>> > drivers/net/wireless/ti/wl18xx/main.c | 2 +-
>> > drivers/net/wireless/ti/wlcore/main.c | 6 ++----
>> > drivers/net/wireless/ti/wlcore/wlcore.h | 2 +-
>> > 4 files changed, 7 insertions(+), 9 deletions(-)
>>
>> wireless patches go to wireless-next, not net-next. But no need to
>> resend because of this.
>
> So for the next patch to drivers/net/wireless: I should write "[PATCH
> wireless-next]" in the Subject?
That's not a requirement from our side but feel free to add that if you
want. Usually we do so that if the patch has "[PATCH wireless]" or
"[PATCH v6.6]" we queue the patch to wireless tree, otherwise it's
queued for wireless-next.
> Do the other special rules for net-next apply to wireless-next, too?
> (E.g. that I must not send patches for -next during the merge window
> and the rules about comments.)
Yeah, we do work a bit different compared to net-next. For example,
wireless-next remains open during merge windows so you can submit
patches anytime. We have tried to document our practises in the wiki
link below in my signature.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [net-next] wifi: wlcore: Convert to platform remove callback returning void
2023-09-12 17:12 [PATCH net-next] wifi: ti/wlcore: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-12 17:23 ` Kalle Valo
@ 2023-09-18 14:31 ` Kalle Valo
1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2023-09-18 14:31 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: linux-wireless, kernel
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> wlcore_remove() returned zero unconditionally. With that converted to
> return void instead, the wl12xx and wl18xx driver can be converted to
> .remove_new trivially.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Patch applied to wireless-next.git, thanks.
f00928012886 wifi: wlcore: Convert to platform remove callback returning void
--
https://patchwork.kernel.org/project/linux-wireless/patch/20230912171249.755901-1-u.kleine-koenig@pengutronix.de/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-09-18 17:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-12 17:12 [PATCH net-next] wifi: ti/wlcore: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-12 17:23 ` Kalle Valo
2023-09-12 20:01 ` Uwe Kleine-König
2023-09-13 2:02 ` Kalle Valo
2023-09-18 14:31 ` [net-next] wifi: wlcore: " Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).