mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 17:04:50 -04:00
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 <u.kleine-koenig@pengutronix.de> Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20231117093056.873834-12-u.kleine-koenig@pengutronix.de
This commit is contained in:
committed by
Kalle Valo
parent
b5418d170b
commit
8cc18a7091
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user