Skip to content

Commit 8cc18a7

Browse files
Uwe Kleine-Königkvalo
authored andcommitted
wifi: wcn36xx: Convert to platform remove callback returning void
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 <[email protected]> Reviewed-by: Jeff Johnson <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b5418d1 commit 8cc18a7

File tree

1 file changed

+2
-4
lines changed
  • drivers/net/wireless/ath/wcn36xx

1 file changed

+2
-4
lines changed

drivers/net/wireless/ath/wcn36xx/main.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ static int wcn36xx_probe(struct platform_device *pdev)
16441644
return ret;
16451645
}
16461646

1647-
static int wcn36xx_remove(struct platform_device *pdev)
1647+
static void wcn36xx_remove(struct platform_device *pdev)
16481648
{
16491649
struct ieee80211_hw *hw = platform_get_drvdata(pdev);
16501650
struct wcn36xx *wcn = hw->priv;
@@ -1666,8 +1666,6 @@ static int wcn36xx_remove(struct platform_device *pdev)
16661666

16671667
mutex_destroy(&wcn->hal_mutex);
16681668
ieee80211_free_hw(hw);
1669-
1670-
return 0;
16711669
}
16721670

16731671
static const struct of_device_id wcn36xx_of_match[] = {
@@ -1678,7 +1676,7 @@ MODULE_DEVICE_TABLE(of, wcn36xx_of_match);
16781676

16791677
static struct platform_driver wcn36xx_driver = {
16801678
.probe = wcn36xx_probe,
1681-
.remove = wcn36xx_remove,
1679+
.remove_new = wcn36xx_remove,
16821680
.driver = {
16831681
.name = "wcn36xx",
16841682
.of_match_table = wcn36xx_of_match,

0 commit comments

Comments
 (0)