From patchwork Fri Nov 17 09:30:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 744903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95C02C072A2 for ; Fri, 17 Nov 2023 09:32:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345729AbjKQJcK (ORCPT ); Fri, 17 Nov 2023 04:32:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235733AbjKQJbt (ORCPT ); Fri, 17 Nov 2023 04:31:49 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFC401BDC for ; Fri, 17 Nov 2023 01:31:16 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r3vBw-0002W1-7T; Fri, 17 Nov 2023 10:31:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r3vBv-009e8M-Ga; Fri, 17 Nov 2023 10:31:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r3vBv-002yjZ-7e; Fri, 17 Nov 2023 10:31:11 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kalle Valo Cc: Jeff Johnson , ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH wifi-next 1/6] wifi: ath11k: Convert to platform remove callback returning void Date: Fri, 17 Nov 2023 10:30:58 +0100 Message-ID: <20231117093056.873834-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> References: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1890; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=3hYN3tnM4/NZ3knZ/+upus+mpO+Pxs5arIlHPwnJHaU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlVzLSL9vS6NnmImZuTLnRn0N7U5Tf5PTOeIPAq +P5ZjIJpaaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZVcy0gAKCRCPgPtYfRL+ Tsi0B/9CWelcJYoumkh4qKAWMn+yfrTHa3oNZC8oj2WIo1CAmki62h720/KIXJAKJNhRUgxlPBd a/AM6wsviq081gNYx5al77rBGez7HA1HWdjJmgCNKDPfF+NoU/n1/8TRerAaQU/yfKSRRsn5ZCf ANcAFLLiJMMvOjfgmp3S+Fs/l3jvXIjBwB3SgUnyHMCVZTWZvIl8OaC17iHYiLhpZSy7ezGdyN2 1Guu929RP0Y6BXZsSW2L8ovYi2EqcOdm0LvV6KdDFRmZgqOldK/sh0UvcixRfOT6UVis9yC8GbQ Fm9ZlQumTYb4qSqoLlxzm3HbzAUoUEVcQJ5JXVds+mfxXJU+ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 Acked-by: Jeff Johnson --- 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, }; From patchwork Fri Nov 17 09:30:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 745163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2FCDC54FB9 for ; Fri, 17 Nov 2023 09:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345786AbjKQJcL (ORCPT ); Fri, 17 Nov 2023 04:32:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235732AbjKQJbt (ORCPT ); Fri, 17 Nov 2023 04:31:49 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A83F1BDF for ; Fri, 17 Nov 2023 01:31:17 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r3vBw-0002W2-5V; Fri, 17 Nov 2023 10:31:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r3vBv-009e8P-PA; Fri, 17 Nov 2023 10:31:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r3vBv-002yjd-G9; Fri, 17 Nov 2023 10:31:11 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kalle Valo Cc: Jiri Slaby , Nick Kossifidis , Luis Chamberlain , linux-wireless@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH wifi-next 2/6] wifi: ath5k: Convert to platform remove callback returning void Date: Fri, 17 Nov 2023 10:30:59 +0100 Message-ID: <20231117093056.873834-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> References: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1959; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Cn+O4+g/1tMrz3IA5hL3E0hfLvZWdc/lCQDXHNZaDVs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlVzLTquOPtRTk3um5arJ1oVOgAhyYgLJYcn0gL pcyOsG7nHSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZVcy0wAKCRCPgPtYfRL+ ThatB/4sxUbLcY3DhhSdejvoAgsu9EBeuq6vbkWK/LhgCijDtR68FvOkNzvM1IlSSBCTOY/DKMe BWSOVxTXOVxB6KnEikbSPu6VnFQAift8Uy1l7FMkbxd4EofLyud4sanwClTXZjfFplTlMVcoc0g XluHpcWgeF4sNRvzdl92VQ4Jx7hvTEiPdF/nJ4Z5R8Gy/DjaKazvwC2q8H4rP7Uq5GsTWGewHSy 52hZT4cGBq+pgrLOh8bS5MC3CJU8/tNOI1xRtPB5BSWmmueKLWHH2tRxueWz49MBVRDFtApQtPl Jibtied2OPQJlM4dgGeVnxa389LSiGJiCxRimi6o+YIvffAd X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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", }, From patchwork Fri Nov 17 09:31:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 745162 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0153C072A2 for ; Fri, 17 Nov 2023 09:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345772AbjKQJcN (ORCPT ); Fri, 17 Nov 2023 04:32:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345747AbjKQJbv (ORCPT ); Fri, 17 Nov 2023 04:31:51 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42EF81BE1 for ; Fri, 17 Nov 2023 01:31:17 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r3vBw-0002W5-Bo; Fri, 17 Nov 2023 10:31:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r3vBv-009e8S-VH; Fri, 17 Nov 2023 10:31:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r3vBv-002yjh-M6; Fri, 17 Nov 2023 10:31:11 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kalle Valo Cc: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , linux-wireless@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH wifi-next 3/6] wifi: ath9k: Convert to platform remove callback returning void Date: Fri, 17 Nov 2023 10:31:00 +0100 Message-ID: <20231117093056.873834-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> References: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1721; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=N9Dy/6GQoy6eWX+yvg/Md8jIQ79Rp09sy8+AUKH7rkA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlVzLUfCLs5lvJrfBXqI+IKwDdFo/MXozPHEmu8 2TVZHj7V9aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZVcy1AAKCRCPgPtYfRL+ TmQXB/0R9ZkFar8V5zXc9jHXvyTaRRj5q5aNkfPJGI7OTAhu5rfoKCndcQLZW1IDLY00MogvlCb Fh4Ppg23d9weDryapg6JCm7YmQNqV0BKtSaDCPTldiC2AmSoRFUE2WrYR4ckm4+7gWAsK5ZINpw +ggpwYAvdxQ0VkKD73WBcsln+u9KKQLIh87kZ6fV9ikq690xRpw8P1tkbarWmm7Gb9u/M2HQoSD JlcuAnr25aycG9p2wSNvyeeSX49SNBBj8FHryxhSDzjoTfoQhLDyMMurgETJqYj10AUPi94zh7D FTFefmB81Y+6ykyeb+DrHx2yEljoYLA17jEIrnaOzbs3ZoH5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 Acked-by: Toke Høiland-Jørgensen --- 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", }, From patchwork Fri Nov 17 09:31:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 744902 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5C43C197A0 for ; Fri, 17 Nov 2023 09:32:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345755AbjKQJcM (ORCPT ); Fri, 17 Nov 2023 04:32:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345748AbjKQJbv (ORCPT ); Fri, 17 Nov 2023 04:31:51 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58DC71BE2 for ; Fri, 17 Nov 2023 01:31:17 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r3vBw-0002WO-My; Fri, 17 Nov 2023 10:31:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r3vBw-009e8X-5D; Fri, 17 Nov 2023 10:31:12 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r3vBv-002yjk-Rv; Fri, 17 Nov 2023 10:31:11 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kalle Valo Cc: Loic Poulain , wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH wifi-next 4/6] wifi: wcn36xx: Convert to platform remove callback returning void Date: Fri, 17 Nov 2023 10:31:01 +0100 Message-ID: <20231117093056.873834-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> References: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1943; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/ttUp2M5cZQsomdzrGK/RBLVhYvusZgwx6aihSw9aS0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlVzLVJfxMIG3sjF2ZFPDpj1ORbqA9cY1g1eSKA q/Hg9f0IX2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZVcy1QAKCRCPgPtYfRL+ TpdTB/9KHc/1xM523LAekxlN8ClroE1JcXgKwZS+MHYQoKq2HPCYHkbOVAifFvamwq7qGb5GsIl bu5hd1OyJYmB82uCET9symNHbwMdBiQW+LTKUmO4oQ+dlJD7KjwcvZweG9V/TWefbaq6O1CDIwn hI1oP1uvBrEQ74Dp5bDOMWPUNebLWOfvlDvmByqgX07A5IRx7Q5H7/l55AUK3GUddTFhW4IYPnk oPKMj8Gli+GzCpLIl6/XeGuQb/DMTtllyP/JOUvSR8GlvIzjd90/ip8B408W4ey+aIEvxOCZnBK NPFcDmLuxWCiY0BBpVk9NoQnsXtx/e2G8vSu2P8rUzIYo5hX X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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, From patchwork Fri Nov 17 09:31:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 745161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CE73C5AD4C for ; Fri, 17 Nov 2023 09:32:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345831AbjKQJcP (ORCPT ); Fri, 17 Nov 2023 04:32:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235749AbjKQJbx (ORCPT ); Fri, 17 Nov 2023 04:31:53 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED0EE1BF3 for ; Fri, 17 Nov 2023 01:31:22 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r3vBy-0002WX-AO; Fri, 17 Nov 2023 10:31:14 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r3vBw-009e8c-BG; Fri, 17 Nov 2023 10:31:12 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r3vBw-002yjo-1l; Fri, 17 Nov 2023 10:31:12 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Hector Martin , Linus Walleij , "Gustavo A. R. Silva" , Jisoo Jang , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, kernel@pengutronix.de Subject: [PATCH wifi-next 5/6] wifi: brcmfmac: Convert to platform remove callback returning void Date: Fri, 17 Nov 2023 10:31:02 +0100 Message-ID: <20231117093056.873834-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> References: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1742; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cqu0rMxMpS5T9wgBrb7wDBn5AdxukCT6CeUHSM8E6iU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlVzLW026t15O6rDRTnhHf2VesxOPdyJ0cjRAwE /I3vOTIPXGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZVcy1gAKCRCPgPtYfRL+ TiscB/9nE0k+th6hnSCSHF+ocm6M+lvednacS1/ZZav5d2nJ14vfg//IUj/z3+txvIdz98wpixc h73feH/uue2zYL5eW8iLXh3vz073mM+9buKfY8yFJ9lHl4lrgxJpNYPje4yO8lBzGgpFVGmcRTC neBmpQl/MNVitv6mFWDfEMbcYEBpjInuTB9sK0Uoo0mtER558HdCM4UUCEBW27VJy5BgO5nXthj Qd6kLvIaEzSL05/9FyUXPJTZymCOZ3JSgAnj11S/Nxdhrh/8R9DwZE8mMnqGaUniDu6NJzZlD/9 sX8seMgnGzWiO763RsnXyXqbJVLjg72mIe7ioEkxCf/Kw0wX X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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, } From patchwork Fri Nov 17 09:31:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 744900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B9EC072A2 for ; Fri, 17 Nov 2023 09:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbjKQJcX (ORCPT ); Fri, 17 Nov 2023 04:32:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230404AbjKQJcE (ORCPT ); Fri, 17 Nov 2023 04:32:04 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81523D67 for ; Fri, 17 Nov 2023 01:31:37 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r3vBy-0002We-Lm; Fri, 17 Nov 2023 10:31:14 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r3vBw-009e8g-HW; Fri, 17 Nov 2023 10:31:12 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r3vBw-002yjs-7w; Fri, 17 Nov 2023 10:31:12 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= 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@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH wifi-next 6/6] wifi: mt76: Convert to platform remove callback returning void Date: Fri, 17 Nov 2023 10:31:03 +0100 Message-ID: <20231117093056.873834-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> References: <20231117093056.873834-8-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3950; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+3uRgiNiFEUq76nz+Tl18IjBYtgiYGwpGMdyzAD5v60=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlVzLXT1SjMog7G1p0Rt6rpyQjo0Au315Pg03xv eJWDyH3yuuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZVcy1wAKCRCPgPtYfRL+ TvnCB/9W4nN1DVz3DUuF4txvKaocsAYBLBRVL5oSyWLKW3jc9vc7e7+t0d3pFlApANOGIhJ/4e7 /alJ8pDpLBgOtaQfXZc2JQuIMxE7uHDjraYxXtA7x1ztdzOrpkm7VBYuljDA8tjxqmUnTA7PSXH yf5X/s/jKtKRvqYYcCmjH1o9qCNY38dLQ0KfC0hOuelhXaEXM93Ns9jG3NnQkp0FrPNZocuhbIP 8yLjFgb4lOi4nDO0kG1Z5WPrmyTVl04hL09tbZ7brIJ6qDjfla/2ZMIuQjr6swLEM/xI8kGUCKN mmMpEauAJ7RTTJdaLpN/4y5pp4WMgzEi8Blu10DQ2eenY2Ha X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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);