Skip to content

Commit b5418d1

Browse files
Uwe Kleine-Königkvalo
authored andcommitted
wifi: ath5k: 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 940b57f commit b5418d1

File tree

1 file changed

+3
-5
lines changed
  • drivers/net/wireless/ath/ath5k

1 file changed

+3
-5
lines changed

drivers/net/wireless/ath/ath5k/ahb.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,15 @@ static int ath_ahb_probe(struct platform_device *pdev)
185185
return ret;
186186
}
187187

188-
static int ath_ahb_remove(struct platform_device *pdev)
188+
static void ath_ahb_remove(struct platform_device *pdev)
189189
{
190190
struct ar231x_board_config *bcfg = dev_get_platdata(&pdev->dev);
191191
struct ieee80211_hw *hw = platform_get_drvdata(pdev);
192192
struct ath5k_hw *ah;
193193
u32 reg;
194194

195195
if (!hw)
196-
return 0;
196+
return;
197197

198198
ah = hw->priv;
199199

@@ -215,13 +215,11 @@ static int ath_ahb_remove(struct platform_device *pdev)
215215
ath5k_deinit_ah(ah);
216216
iounmap(ah->iobase);
217217
ieee80211_free_hw(hw);
218-
219-
return 0;
220218
}
221219

222220
static struct platform_driver ath_ahb_driver = {
223221
.probe = ath_ahb_probe,
224-
.remove = ath_ahb_remove,
222+
.remove_new = ath_ahb_remove,
225223
.driver = {
226224
.name = "ar231x-wmac",
227225
},

0 commit comments

Comments
 (0)