Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp390054rdb; Fri, 17 Nov 2023 01:32:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/4U4Xi0qgU1nfmOCR1kFMN2zn/4UCsOSbE14ag5o2HEMEWS0HP0zHRcNBA4KY15ZXhyh7 X-Received: by 2002:a05:6871:a110:b0:1e9:8b12:89aa with SMTP id vs16-20020a056871a11000b001e98b1289aamr21751999oab.26.1700213563987; Fri, 17 Nov 2023 01:32:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700213563; cv=none; d=google.com; s=arc-20160816; b=BQCJR0HM6udrfYDyM/rqMm9wbqWp2mqYs8GfhkH9Yk7nFp1Y11YGtrAg8OUVOPWUQT xftOWJYopph3lIGYsKqepMav89Lyu8LbUXHwWxZxByY/jp0hZeogufJctW5KhtD7af6e BWXmo4GNb3Z40/ta/adjqHcQyOe557s6xdb453Kv3LeZ1pmQ6wRXe1oSRbR3H3u6Ccoj lzthTBQCwFShmUB2qNvQrLxrrOVF192ab5K9PhF3C0FK5aCJR/Y0Y/x5HY1ewEuZtRY9 FBH1Z7tVPB+y3wcKcfbv4jejsyhdWN2RJO9DQXR8ZnLUhnMZTVT4EcQbzGDPKutRlMMw plGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=h37p2Oa3rkwghl8Ka66KaewLsroPJbEXXxYAkH8Qg7w=; fh=emwUgBy1ZnCb8/tM3w/tDH8W7XakPTiSesv67eZBgNg=; b=kU3U3xpTjiXGoAGOerPNfWHZ45yAHltU2ptWzzai9nR+Hd1DrukLYc+0oVByVzlqty 1WVv9BakFJzQQmlFarT3IdpLp9u8GkMv32BRIKoZo1ex3ZNx/Id3H0XAXTyataIz9Fu3 7jmKIg/VbNDXcSPKzfOOGnRGfMLGtH6qqDInoSoivAnDFjzmI4wGoDUfM7XNaG9n24Es G5+dzCX9AQnPLLjLEUAKKl1/VSX7WF8bEV3wy56myaUWjtd97SnV6NMZ7mOCn0OLfDKj Rb6btsgFbRQJh/eQGVisX+X5B8WFuPX2xjAADYujw7a929WpSjowTv/DHX1GmA7dbWCX HwEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id m5-20020a056a00080500b006c4ec5d627csi1545048pfk.299.2023.11.17.01.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 01:32:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CD2298271DF6; Fri, 17 Nov 2023 01:32:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbjKQJcX (ORCPT + 53 others); 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=20Kleine-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 Content-Type: text/plain; charset=UTF-8 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 Content-Transfer-Encoding: 8bit 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 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 17 Nov 2023 01:32:22 -0800 (PST) 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); -- 2.42.0