* [PATCH wifi-next 0/6] wifi: Convert to platform remove callback returning void
@ 2023-11-17 9:30 ` Uwe Kleine-König
0 siblings, 0 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:30 UTC (permalink / raw)
To: Kalle Valo
Cc: Jeff Johnson, ath11k, linux-wireless, kernel, Jiri Slaby,
Nick Kossifidis, Luis Chamberlain,
Toke Høiland-Jørgensen, Loic Poulain, wcn36xx,
Arend van Spriel, Franky Lin, Hante Meuleman, Hector Martin,
Linus Walleij, Gustavo A. R. Silva, Jisoo Jang,
brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, Felix Fietkau,
Lorenzo Bianconi, Ryder Lee, Shayne Chen, Sean Wang,
Matthias Brugger, AngeloGioacchino Del Regno, Simon Horman,
Rob Herring, Wang Yufen, Peter Chiu, Alexander Couzens,
Jinjie Ruan, linux-arm-kernel, linux-mediatek
Hello,
this series converts the platform drivers below drivers/net/wireless to
make use of .remove_new().
See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.
The TL;DR; is to make it harder for driver authors to leak resources
without noticing.
Best regards
Uwe
Uwe Kleine-König (6):
wifi: ath11k: Convert to platform remove callback returning void
wifi: ath5k: Convert to platform remove callback returning void
wifi: ath9k: Convert to platform remove callback returning void
wifi: wcn36xx: Convert to platform remove callback returning void
wifi: brcmfmac: Convert to platform remove callback returning void
wifi: mt76: Convert to platform remove callback returning void
drivers/net/wireless/ath/ath11k/ahb.c | 6 ++----
drivers/net/wireless/ath/ath5k/ahb.c | 8 +++-----
drivers/net/wireless/ath/ath9k/ahb.c | 6 ++----
drivers/net/wireless/ath/wcn36xx/main.c | 6 ++----
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 6 ++----
drivers/net/wireless/mediatek/mt76/mt7603/soc.c | 7 ++-----
drivers/net/wireless/mediatek/mt76/mt7615/soc.c | 6 ++----
drivers/net/wireless/mediatek/mt76/mt7915/soc.c | 6 ++----
8 files changed, 17 insertions(+), 34 deletions(-)
base-commit: eff99d8edbed7918317331ebd1e365d8e955d65e
--
2.42.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread* [PATCH wifi-next 0/6] wifi: Convert to platform remove callback returning void
@ 2023-11-17 9:30 ` Uwe Kleine-König
0 siblings, 0 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:30 UTC (permalink / raw)
To: Kalle Valo
Cc: Jeff Johnson, ath11k, linux-wireless, kernel, Jiri Slaby,
Nick Kossifidis, Luis Chamberlain,
Toke Høiland-Jørgensen, Loic Poulain, wcn36xx,
Arend van Spriel, Franky Lin, Hante Meuleman, Hector Martin,
Linus Walleij, Gustavo A. R. Silva, Jisoo Jang,
brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, Felix Fietkau,
Lorenzo Bianconi, Ryder Lee, Shayne Chen, Sean Wang,
Matthias Brugger, AngeloGioacchino Del Regno, Simon Horman,
Rob Herring, Wang Yufen, Peter Chiu, Alexander Couzens,
Jinjie Ruan, linux-arm-kernel, linux-mediatek
Hello,
this series converts the platform drivers below drivers/net/wireless to
make use of .remove_new().
See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.
The TL;DR; is to make it harder for driver authors to leak resources
without noticing.
Best regards
Uwe
Uwe Kleine-König (6):
wifi: ath11k: Convert to platform remove callback returning void
wifi: ath5k: Convert to platform remove callback returning void
wifi: ath9k: Convert to platform remove callback returning void
wifi: wcn36xx: Convert to platform remove callback returning void
wifi: brcmfmac: Convert to platform remove callback returning void
wifi: mt76: Convert to platform remove callback returning void
drivers/net/wireless/ath/ath11k/ahb.c | 6 ++----
drivers/net/wireless/ath/ath5k/ahb.c | 8 +++-----
drivers/net/wireless/ath/ath9k/ahb.c | 6 ++----
drivers/net/wireless/ath/wcn36xx/main.c | 6 ++----
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 6 ++----
drivers/net/wireless/mediatek/mt76/mt7603/soc.c | 7 ++-----
drivers/net/wireless/mediatek/mt76/mt7615/soc.c | 6 ++----
drivers/net/wireless/mediatek/mt76/mt7915/soc.c | 6 ++----
8 files changed, 17 insertions(+), 34 deletions(-)
base-commit: eff99d8edbed7918317331ebd1e365d8e955d65e
--
2.42.0
^ permalink raw reply [flat|nested] 24+ messages in thread* [PATCH wifi-next 1/6] wifi: ath11k: Convert to platform remove callback returning void
2023-11-17 9:30 ` Uwe Kleine-König
@ 2023-11-17 9:30 ` Uwe Kleine-König
-1 siblings, 0 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:30 UTC (permalink / raw)
To: Kalle Valo; +Cc: Jeff Johnson, ath11k, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/wireless/ath/ath11k/ahb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 235336ef2a7a..f8ae9ba85500 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1251,7 +1251,7 @@ static void ath11k_ahb_free_resources(struct ath11k_base *ab)
platform_set_drvdata(pdev, NULL);
}
-static int ath11k_ahb_remove(struct platform_device *pdev)
+static void ath11k_ahb_remove(struct platform_device *pdev)
{
struct ath11k_base *ab = platform_get_drvdata(pdev);
@@ -1267,8 +1267,6 @@ static int ath11k_ahb_remove(struct platform_device *pdev)
qmi_fail:
ath11k_ahb_free_resources(ab);
-
- return 0;
}
static void ath11k_ahb_shutdown(struct platform_device *pdev)
@@ -1296,7 +1294,7 @@ static struct platform_driver ath11k_ahb_driver = {
.of_match_table = ath11k_ahb_of_match,
},
.probe = ath11k_ahb_probe,
- .remove = ath11k_ahb_remove,
+ .remove_new = ath11k_ahb_remove,
.shutdown = ath11k_ahb_shutdown,
};
--
2.42.0
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH wifi-next 1/6] wifi: ath11k: Convert to platform remove callback returning void
@ 2023-11-17 9:30 ` Uwe Kleine-König
0 siblings, 0 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:30 UTC (permalink / raw)
To: Kalle Valo; +Cc: Jeff Johnson, ath11k, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/wireless/ath/ath11k/ahb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 235336ef2a7a..f8ae9ba85500 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1251,7 +1251,7 @@ static void ath11k_ahb_free_resources(struct ath11k_base *ab)
platform_set_drvdata(pdev, NULL);
}
-static int ath11k_ahb_remove(struct platform_device *pdev)
+static void ath11k_ahb_remove(struct platform_device *pdev)
{
struct ath11k_base *ab = platform_get_drvdata(pdev);
@@ -1267,8 +1267,6 @@ static int ath11k_ahb_remove(struct platform_device *pdev)
qmi_fail:
ath11k_ahb_free_resources(ab);
-
- return 0;
}
static void ath11k_ahb_shutdown(struct platform_device *pdev)
@@ -1296,7 +1294,7 @@ static struct platform_driver ath11k_ahb_driver = {
.of_match_table = ath11k_ahb_of_match,
},
.probe = ath11k_ahb_probe,
- .remove = ath11k_ahb_remove,
+ .remove_new = ath11k_ahb_remove,
.shutdown = ath11k_ahb_shutdown,
};
--
2.42.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH wifi-next 1/6] wifi: ath11k: Convert to platform remove callback returning void
2023-11-17 9:30 ` Uwe Kleine-König
@ 2023-11-17 17:23 ` Jeff Johnson
-1 siblings, 0 replies; 24+ messages in thread
From: Jeff Johnson @ 2023-11-17 17:23 UTC (permalink / raw)
To: Uwe Kleine-König, Kalle Valo; +Cc: ath11k, linux-wireless, kernel
On 11/17/2023 1:30 AM, Uwe Kleine-König 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH wifi-next 1/6] wifi: ath11k: Convert to platform remove callback returning void
@ 2023-11-17 17:23 ` Jeff Johnson
0 siblings, 0 replies; 24+ messages in thread
From: Jeff Johnson @ 2023-11-17 17:23 UTC (permalink / raw)
To: Uwe Kleine-König, Kalle Valo; +Cc: ath11k, linux-wireless, kernel
On 11/17/2023 1:30 AM, Uwe Kleine-König 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH wifi-next 1/6] wifi: ath11k: Convert to platform remove callback returning void
2023-11-17 9:30 ` Uwe Kleine-König
(?)
(?)
@ 2023-11-30 17:06 ` Kalle Valo
-1 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2023-11-30 17:06 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Jeff Johnson, ath11k, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Patch applied to ath-next branch of ath.git, thanks.
62e31362033e wifi: ath11k: Convert to platform remove callback returning void
--
https://patchwork.kernel.org/project/linux-wireless/patch/20231117093056.873834-9-u.kleine-koenig@pengutronix.de/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH wifi-next 2/6] wifi: ath5k: Convert to platform remove callback returning void
2023-11-17 9:30 ` Uwe Kleine-König
` (2 preceding siblings ...)
(?)
@ 2023-11-17 9:30 ` Uwe Kleine-König
2023-11-17 19:18 ` Jeff Johnson
2023-12-01 16:06 ` Kalle Valo
-1 siblings, 2 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:30 UTC (permalink / raw)
To: Kalle Valo
Cc: Jiri Slaby, Nick Kossifidis, Luis Chamberlain, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/wireless/ath/ath5k/ahb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
index 08bd5d3b00f1..f27308ccb2f1 100644
--- a/drivers/net/wireless/ath/ath5k/ahb.c
+++ b/drivers/net/wireless/ath/ath5k/ahb.c
@@ -185,7 +185,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
return ret;
}
-static int ath_ahb_remove(struct platform_device *pdev)
+static void ath_ahb_remove(struct platform_device *pdev)
{
struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev);
struct ieee80211_hw *hw = platform_get_drvdata(pdev);
@@ -193,7 +193,7 @@ static int ath_ahb_remove(struct platform_device *pdev)
u32 reg;
if (!hw)
- return 0;
+ return;
ah = hw->priv;
@@ -215,13 +215,11 @@ static int ath_ahb_remove(struct platform_device *pdev)
ath5k_deinit_ah(ah);
iounmap(ah->iobase);
ieee80211_free_hw(hw);
-
- return 0;
}
static struct platform_driver ath_ahb_driver = {
.probe = ath_ahb_probe,
- .remove = ath_ahb_remove,
+ .remove_new = ath_ahb_remove,
.driver = {
.name = "ar231x-wmac",
},
--
2.42.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH wifi-next 2/6] wifi: ath5k: Convert to platform remove callback returning void
2023-11-17 9:30 ` [PATCH wifi-next 2/6] wifi: ath5k: " Uwe Kleine-König
@ 2023-11-17 19:18 ` Jeff Johnson
2023-12-01 16:06 ` Kalle Valo
1 sibling, 0 replies; 24+ messages in thread
From: Jeff Johnson @ 2023-11-17 19:18 UTC (permalink / raw)
To: Uwe Kleine-König, Kalle Valo
Cc: Jiri Slaby, Nick Kossifidis, Luis Chamberlain, linux-wireless,
kernel
On 11/17/2023 1:30 AM, Uwe Kleine-König 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH wifi-next 2/6] wifi: ath5k: Convert to platform remove callback returning void
2023-11-17 9:30 ` [PATCH wifi-next 2/6] wifi: ath5k: " Uwe Kleine-König
2023-11-17 19:18 ` Jeff Johnson
@ 2023-12-01 16:06 ` Kalle Valo
1 sibling, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2023-12-01 16:06 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Jiri Slaby, Nick Kossifidis, Luis Chamberlain, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
2 patches applied to ath-next branch of ath.git, thanks.
b5418d170b7c wifi: ath5k: Convert to platform remove callback returning void
8cc18a70913f wifi: wcn36xx: Convert to platform remove callback returning void
--
https://patchwork.kernel.org/project/linux-wireless/patch/20231117093056.873834-10-u.kleine-koenig@pengutronix.de/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH wifi-next 3/6] wifi: ath9k: Convert to platform remove callback returning void
2023-11-17 9:30 ` Uwe Kleine-König
` (3 preceding siblings ...)
(?)
@ 2023-11-17 9:31 ` Uwe Kleine-König
2023-11-17 19:19 ` Jeff Johnson
` (2 more replies)
-1 siblings, 3 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:31 UTC (permalink / raw)
To: Kalle Valo; +Cc: Toke Høiland-Jørgensen, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/wireless/ath/ath9k/ahb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 9bfaadfa6c00..1a6697b6e3b4 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -144,7 +144,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
return ret;
}
-static int ath_ahb_remove(struct platform_device *pdev)
+static void ath_ahb_remove(struct platform_device *pdev)
{
struct ieee80211_hw *hw = platform_get_drvdata(pdev);
@@ -155,13 +155,11 @@ static int ath_ahb_remove(struct platform_device *pdev)
free_irq(sc->irq, sc);
ieee80211_free_hw(sc->hw);
}
-
- return 0;
}
static struct platform_driver ath_ahb_driver = {
.probe = ath_ahb_probe,
- .remove = ath_ahb_remove,
+ .remove_new = ath_ahb_remove,
.driver = {
.name = "ath9k",
},
--
2.42.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH wifi-next 3/6] wifi: ath9k: Convert to platform remove callback returning void
2023-11-17 9:31 ` [PATCH wifi-next 3/6] wifi: ath9k: " Uwe Kleine-König
@ 2023-11-17 19:19 ` Jeff Johnson
2023-12-15 11:24 ` Toke Høiland-Jørgensen
2023-12-18 18:46 ` Kalle Valo
2 siblings, 0 replies; 24+ messages in thread
From: Jeff Johnson @ 2023-11-17 19:19 UTC (permalink / raw)
To: Uwe Kleine-König, Kalle Valo
Cc: Toke Høiland-Jørgensen, linux-wireless, kernel
On 11/17/2023 1:31 AM, Uwe Kleine-König 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH wifi-next 3/6] wifi: ath9k: Convert to platform remove callback returning void
2023-11-17 9:31 ` [PATCH wifi-next 3/6] wifi: ath9k: " Uwe Kleine-König
2023-11-17 19:19 ` Jeff Johnson
@ 2023-12-15 11:24 ` Toke Høiland-Jørgensen
2023-12-18 18:46 ` Kalle Valo
2 siblings, 0 replies; 24+ messages in thread
From: Toke Høiland-Jørgensen @ 2023-12-15 11:24 UTC (permalink / raw)
To: Uwe Kleine-König, Kalle Valo; +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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH wifi-next 3/6] wifi: ath9k: Convert to platform remove callback returning void
2023-11-17 9:31 ` [PATCH wifi-next 3/6] wifi: ath9k: " Uwe Kleine-König
2023-11-17 19:19 ` Jeff Johnson
2023-12-15 11:24 ` Toke Høiland-Jørgensen
@ 2023-12-18 18:46 ` Kalle Valo
2 siblings, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2023-12-18 18:46 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Toke Høiland-Jørgensen, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Patch applied to ath-next branch of ath.git, thanks.
27ce06d018ce wifi: ath9k: Convert to platform remove callback returning void
--
https://patchwork.kernel.org/project/linux-wireless/patch/20231117093056.873834-11-u.kleine-koenig@pengutronix.de/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH wifi-next 4/6] wifi: wcn36xx: Convert to platform remove callback returning void
2023-11-17 9:30 ` Uwe Kleine-König
` (4 preceding siblings ...)
(?)
@ 2023-11-17 9:31 ` Uwe Kleine-König
2023-11-17 19:19 ` Jeff Johnson
-1 siblings, 1 reply; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:31 UTC (permalink / raw)
To: Kalle Valo; +Cc: Loic Poulain, wcn36xx, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/wireless/ath/wcn36xx/main.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 2bd1163177f0..41119fb177e3 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1644,7 +1644,7 @@ static int wcn36xx_probe(struct platform_device *pdev)
return ret;
}
-static int wcn36xx_remove(struct platform_device *pdev)
+static void wcn36xx_remove(struct platform_device *pdev)
{
struct ieee80211_hw *hw = platform_get_drvdata(pdev);
struct wcn36xx *wcn = hw->priv;
@@ -1666,8 +1666,6 @@ static int wcn36xx_remove(struct platform_device *pdev)
mutex_destroy(&wcn->hal_mutex);
ieee80211_free_hw(hw);
-
- return 0;
}
static const struct of_device_id wcn36xx_of_match[] = {
@@ -1678,7 +1676,7 @@ MODULE_DEVICE_TABLE(of, wcn36xx_of_match);
static struct platform_driver wcn36xx_driver = {
.probe = wcn36xx_probe,
- .remove = wcn36xx_remove,
+ .remove_new = wcn36xx_remove,
.driver = {
.name = "wcn36xx",
.of_match_table = wcn36xx_of_match,
--
2.42.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH wifi-next 4/6] wifi: wcn36xx: Convert to platform remove callback returning void
2023-11-17 9:31 ` [PATCH wifi-next 4/6] wifi: wcn36xx: " Uwe Kleine-König
@ 2023-11-17 19:19 ` Jeff Johnson
0 siblings, 0 replies; 24+ messages in thread
From: Jeff Johnson @ 2023-11-17 19:19 UTC (permalink / raw)
To: Uwe Kleine-König, Kalle Valo
Cc: Loic Poulain, wcn36xx, linux-wireless, kernel
On 11/17/2023 1:31 AM, Uwe Kleine-König 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH wifi-next 5/6] wifi: brcmfmac: Convert to platform remove callback returning void
2023-11-17 9:30 ` Uwe Kleine-König
` (5 preceding siblings ...)
(?)
@ 2023-11-17 9:31 ` Uwe Kleine-König
2023-11-17 19:20 ` Jeff Johnson
2023-11-30 19:19 ` Kalle Valo
-1 siblings, 2 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:31 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Hector Martin,
Linus Walleij, Gustavo A. R. Silva, Jisoo Jang, linux-wireless,
brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
index a194b0e68eb5..b6d458e022fa 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
@@ -578,18 +578,16 @@ static int __init brcmf_common_pd_probe(struct platform_device *pdev)
return 0;
}
-static int brcmf_common_pd_remove(struct platform_device *pdev)
+static void brcmf_common_pd_remove(struct platform_device *pdev)
{
brcmf_dbg(INFO, "Enter\n");
if (brcmfmac_pdata->power_off)
brcmfmac_pdata->power_off();
-
- return 0;
}
static struct platform_driver brcmf_pd = {
- .remove = brcmf_common_pd_remove,
+ .remove_new = brcmf_common_pd_remove,
.driver = {
.name = BRCMFMAC_PDATA_NAME,
}
--
2.42.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH wifi-next 5/6] wifi: brcmfmac: Convert to platform remove callback returning void
2023-11-17 9:31 ` [PATCH wifi-next 5/6] wifi: brcmfmac: " Uwe Kleine-König
@ 2023-11-17 19:20 ` Jeff Johnson
2023-11-30 19:19 ` Kalle Valo
1 sibling, 0 replies; 24+ messages in thread
From: Jeff Johnson @ 2023-11-17 19:20 UTC (permalink / raw)
To: Uwe Kleine-König, Kalle Valo
Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Hector Martin,
Linus Walleij, Gustavo A. R. Silva, Jisoo Jang, linux-wireless,
brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, kernel
On 11/17/2023 1:31 AM, Uwe Kleine-König 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
not my driver but since it is trivial
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH wifi-next 5/6] wifi: brcmfmac: Convert to platform remove callback returning void
2023-11-17 9:31 ` [PATCH wifi-next 5/6] wifi: brcmfmac: " Uwe Kleine-König
2023-11-17 19:20 ` Jeff Johnson
@ 2023-11-30 19:19 ` Kalle Valo
1 sibling, 0 replies; 24+ messages in thread
From: Kalle Valo @ 2023-11-30 19:19 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Arend van Spriel, Franky Lin, Hante Meuleman, Hector Martin,
Linus Walleij, Gustavo A. R. Silva, Jisoo Jang, linux-wireless,
brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Patch applied to wireless-next.git, thanks.
afb154426bf1 wifi: brcmfmac: Convert to platform remove callback returning void
--
https://patchwork.kernel.org/project/linux-wireless/patch/20231117093056.873834-13-u.kleine-koenig@pengutronix.de/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH wifi-next 6/6] wifi: mt76: Convert to platform remove callback returning void
2023-11-17 9:30 ` Uwe Kleine-König
@ 2023-11-17 9:31 ` Uwe Kleine-König
-1 siblings, 0 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:31 UTC (permalink / raw)
To: Kalle Valo
Cc: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
Simon Horman, Rob Herring, Wang Yufen, Peter Chiu,
Alexander Couzens, Jinjie Ruan, linux-wireless, kernel,
linux-arm-kernel, linux-mediatek
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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert the three mt76 drivers from always returning zero in
the remove callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/wireless/mediatek/mt76/mt7603/soc.c | 7 ++-----
drivers/net/wireless/mediatek/mt76/mt7615/soc.c | 6 ++----
drivers/net/wireless/mediatek/mt76/mt7915/soc.c | 6 ++----
3 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
index ba927033bbe8..ec02148a7f1f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
@@ -52,15 +52,12 @@ mt76_wmac_probe(struct platform_device *pdev)
return ret;
}
-static int
-mt76_wmac_remove(struct platform_device *pdev)
+static void mt76_wmac_remove(struct platform_device *pdev)
{
struct mt76_dev *mdev = platform_get_drvdata(pdev);
struct mt7603_dev *dev = container_of(mdev, struct mt7603_dev, mt76);
mt7603_unregister_device(dev);
-
- return 0;
}
static const struct of_device_id of_wmac_match[] = {
@@ -74,7 +71,7 @@ MODULE_FIRMWARE(MT7628_FIRMWARE_E2);
struct platform_driver mt76_wmac_driver = {
.probe = mt76_wmac_probe,
- .remove = mt76_wmac_remove,
+ .remove_new = mt76_wmac_remove,
.driver = {
.name = "mt76_wmac",
.of_match_table = of_wmac_match,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/soc.c b/drivers/net/wireless/mediatek/mt76/mt7615/soc.c
index f13d1b418742..12e3e4a91d27 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/soc.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/soc.c
@@ -45,13 +45,11 @@ static int mt7622_wmac_probe(struct platform_device *pdev)
return mt7615_mmio_probe(&pdev->dev, mem_base, irq, mt7615e_reg_map);
}
-static int mt7622_wmac_remove(struct platform_device *pdev)
+static void mt7622_wmac_remove(struct platform_device *pdev)
{
struct mt7615_dev *dev = platform_get_drvdata(pdev);
mt7615_unregister_device(dev);
-
- return 0;
}
static const struct of_device_id mt7622_wmac_of_match[] = {
@@ -65,7 +63,7 @@ struct platform_driver mt7622_wmac_driver = {
.of_match_table = mt7622_wmac_of_match,
},
.probe = mt7622_wmac_probe,
- .remove = mt7622_wmac_remove,
+ .remove_new = mt7622_wmac_remove,
};
MODULE_FIRMWARE(MT7622_FIRMWARE_N9);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c
index 06e3d9db996c..8b4809703efc 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c
@@ -1282,13 +1282,11 @@ static int mt798x_wmac_probe(struct platform_device *pdev)
return ret;
}
-static int mt798x_wmac_remove(struct platform_device *pdev)
+static void mt798x_wmac_remove(struct platform_device *pdev)
{
struct mt7915_dev *dev = platform_get_drvdata(pdev);
mt7915_unregister_device(dev);
-
- return 0;
}
static const struct of_device_id mt798x_wmac_of_match[] = {
@@ -1305,7 +1303,7 @@ struct platform_driver mt798x_wmac_driver = {
.of_match_table = mt798x_wmac_of_match,
},
.probe = mt798x_wmac_probe,
- .remove = mt798x_wmac_remove,
+ .remove_new = mt798x_wmac_remove,
};
MODULE_FIRMWARE(MT7986_FIRMWARE_WA);
--
2.42.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH wifi-next 6/6] wifi: mt76: Convert to platform remove callback returning void
@ 2023-11-17 9:31 ` Uwe Kleine-König
0 siblings, 0 replies; 24+ messages in thread
From: Uwe Kleine-König @ 2023-11-17 9:31 UTC (permalink / raw)
To: Kalle Valo
Cc: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
Simon Horman, Rob Herring, Wang Yufen, Peter Chiu,
Alexander Couzens, Jinjie Ruan, linux-wireless, kernel,
linux-arm-kernel, linux-mediatek
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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert the three mt76 drivers from always returning zero in
the remove callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/wireless/mediatek/mt76/mt7603/soc.c | 7 ++-----
drivers/net/wireless/mediatek/mt76/mt7615/soc.c | 6 ++----
drivers/net/wireless/mediatek/mt76/mt7915/soc.c | 6 ++----
3 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
index ba927033bbe8..ec02148a7f1f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
@@ -52,15 +52,12 @@ mt76_wmac_probe(struct platform_device *pdev)
return ret;
}
-static int
-mt76_wmac_remove(struct platform_device *pdev)
+static void mt76_wmac_remove(struct platform_device *pdev)
{
struct mt76_dev *mdev = platform_get_drvdata(pdev);
struct mt7603_dev *dev = container_of(mdev, struct mt7603_dev, mt76);
mt7603_unregister_device(dev);
-
- return 0;
}
static const struct of_device_id of_wmac_match[] = {
@@ -74,7 +71,7 @@ MODULE_FIRMWARE(MT7628_FIRMWARE_E2);
struct platform_driver mt76_wmac_driver = {
.probe = mt76_wmac_probe,
- .remove = mt76_wmac_remove,
+ .remove_new = mt76_wmac_remove,
.driver = {
.name = "mt76_wmac",
.of_match_table = of_wmac_match,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/soc.c b/drivers/net/wireless/mediatek/mt76/mt7615/soc.c
index f13d1b418742..12e3e4a91d27 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/soc.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/soc.c
@@ -45,13 +45,11 @@ static int mt7622_wmac_probe(struct platform_device *pdev)
return mt7615_mmio_probe(&pdev->dev, mem_base, irq, mt7615e_reg_map);
}
-static int mt7622_wmac_remove(struct platform_device *pdev)
+static void mt7622_wmac_remove(struct platform_device *pdev)
{
struct mt7615_dev *dev = platform_get_drvdata(pdev);
mt7615_unregister_device(dev);
-
- return 0;
}
static const struct of_device_id mt7622_wmac_of_match[] = {
@@ -65,7 +63,7 @@ struct platform_driver mt7622_wmac_driver = {
.of_match_table = mt7622_wmac_of_match,
},
.probe = mt7622_wmac_probe,
- .remove = mt7622_wmac_remove,
+ .remove_new = mt7622_wmac_remove,
};
MODULE_FIRMWARE(MT7622_FIRMWARE_N9);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c
index 06e3d9db996c..8b4809703efc 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c
@@ -1282,13 +1282,11 @@ static int mt798x_wmac_probe(struct platform_device *pdev)
return ret;
}
-static int mt798x_wmac_remove(struct platform_device *pdev)
+static void mt798x_wmac_remove(struct platform_device *pdev)
{
struct mt7915_dev *dev = platform_get_drvdata(pdev);
mt7915_unregister_device(dev);
-
- return 0;
}
static const struct of_device_id mt798x_wmac_of_match[] = {
@@ -1305,7 +1303,7 @@ struct platform_driver mt798x_wmac_driver = {
.of_match_table = mt798x_wmac_of_match,
},
.probe = mt798x_wmac_probe,
- .remove = mt798x_wmac_remove,
+ .remove_new = mt798x_wmac_remove,
};
MODULE_FIRMWARE(MT7986_FIRMWARE_WA);
--
2.42.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH wifi-next 6/6] wifi: mt76: Convert to platform remove callback returning void
2023-11-17 9:31 ` Uwe Kleine-König
@ 2023-11-17 19:21 ` Jeff Johnson
-1 siblings, 0 replies; 24+ messages in thread
From: Jeff Johnson @ 2023-11-17 19:21 UTC (permalink / raw)
To: Uwe Kleine-König, Kalle Valo
Cc: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
Simon Horman, Rob Herring, Wang Yufen, Peter Chiu,
Alexander Couzens, Jinjie Ruan, linux-wireless, kernel,
linux-arm-kernel, linux-mediatek
On 11/17/2023 1:31 AM, Uwe Kleine-König 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert the three mt76 drivers from always returning zero in
> the remove callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
not my driver but since it is trivial
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH wifi-next 6/6] wifi: mt76: Convert to platform remove callback returning void
@ 2023-11-17 19:21 ` Jeff Johnson
0 siblings, 0 replies; 24+ messages in thread
From: Jeff Johnson @ 2023-11-17 19:21 UTC (permalink / raw)
To: Uwe Kleine-König, Kalle Valo
Cc: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
Simon Horman, Rob Herring, Wang Yufen, Peter Chiu,
Alexander Couzens, Jinjie Ruan, linux-wireless, kernel,
linux-arm-kernel, linux-mediatek
On 11/17/2023 1:31 AM, Uwe Kleine-König 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert the three mt76 drivers from always returning zero in
> the remove callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
not my driver but since it is trivial
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 24+ messages in thread