Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2731110rdb; Tue, 12 Sep 2023 10:16:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsDa4kPx9D3L98n0xRMNKDGetqPZongUKHg7ubZXixbxLKOEYsXYAX6Qdr1wqW0eE5r6ln X-Received: by 2002:a17:90b:3653:b0:273:f138:29cc with SMTP id nh19-20020a17090b365300b00273f13829ccmr7597980pjb.35.1694539011874; Tue, 12 Sep 2023 10:16:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694539011; cv=none; d=google.com; s=arc-20160816; b=sy/QUj7vwnbYeDO/JcSyZ2BE3tHTJEIOTgZiy5CHmcrQCAYTmzFO/2Rc6Lwj6Elp9+ Rzph8TkDczM5XNodkeddPlBAwrc3zLKaD440ekFHPolmJcw7fFapFeiAqUz6Nj8et9NA wamgaHmKBi/Z4noawTmJVz3oXeeoSEvVjJ/dSAi8LY3zJ9xHaZF20sziiyXYcicRinmq V0ha00pmfk3nk2FEr8p86LBGqTaaRGjpURgh1dNQ9JgQL/HC+AWsgItXbrWS1hhdq1pQ Z2Ojlp+10AT9dnKlYRxlaDK1+kr8o4q4/GAoT9kMXs3LE6N1B/qz7sBootXKDewJQnvH sKWw== 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 :message-id:date:subject:cc:to:from; bh=g4FVZ8w2JpsihBezaf/IVI3Y36P0mW5RLuEwfquH3oI=; fh=PlxUx1RKsPgGlKV8HdlNgp4L5wTmRZJ5xUutE/PqUkw=; b=SNH7+lf1gFbaJ/0ke0OT07Qgm7jhABHWgJ1ZHKUJUwYjAWde93FUKhOnto/SQKZcey gy9xbg+TU+gV0uA+iM6b2yVSQAztvKx5KectCKV3JroAajZuvO1kqd+15sfhEnn6jG/B Z4VyzvNhiN5kinFbGAbDLwrfVROhluUAY4ReW/w13M6Hovod2Ph90YVzCoTe9HgyauPq IBrTjXnzfR3CT72BUeyKqp/M0Mq39Hv3q3b+CSKSnndOLEvlO7Ng4g5CP35VCE3OBx1Z OHAJ9C4nO5G33HtlHD3GTjGLKxt8+btJ3okGIFEutdIzaM80XXLVzVvpQlvxLADrPOnR uFXg== 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 na18-20020a17090b4c1200b002680c21ca6csi10550276pjb.95.2023.09.12.10.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 10:16:51 -0700 (PDT) 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 A23A6825F143; Tue, 12 Sep 2023 10:13:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235087AbjILRNY (ORCPT + 56 others); Tue, 12 Sep 2023 13:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236969AbjILRNX (ORCPT ); Tue, 12 Sep 2023 13:13:23 -0400 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 2AE7A10F9 for ; Tue, 12 Sep 2023 10:13:19 -0700 (PDT) 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 1qg6wv-0001mI-Kg; Tue, 12 Sep 2023 19:13:17 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qg6wv-005pIg-1P; Tue, 12 Sep 2023 19:13:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qg6wu-00189l-89; Tue, 12 Sep 2023 19:13:16 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Kalle Valo Cc: linux-wireless@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH net-next] wifi: ti/wlcore: Convert to platform remove callback returning void Date: Tue, 12 Sep 2023 19:12:49 +0200 Message-Id: <20230912171249.755901-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=4229; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Imx0MK8ZkfI1XAlqsm/tTH4erfDJiHYF4Nk5YdLdNzI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlAJwQ8GPnpA+nl0nXY9M3fRQYZ2RIuo19HyIJG kOUj0nS1M+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQCcEAAKCRCPgPtYfRL+ TtOaB/wPGde9qpTBK5MqAMT61GD3EwYQ1jaQAjGf4/8lQCfZ2LooXDbhXniCWBQ+wXnPyPovIrv AxGjsze6iEfT3HWx6JAxkheVs8jp5YAMK7g+ZiFhTbb1qamKupUXKq1gA0SfZgj+0NGoIPc3LyA D/9cBXrZ3YVCTq/BafoGfj8DIxhyKYSSQYm2Ws/3Tq+PGOuZBR41BnuWmt/oyaZsWIfyJvwrn4Q +DsWpSuABgJ5/vPNGDEIOUwmH86SRPUQq2UsfYP5Xlt2c1WdaXfvYtN9nus6vM25bSM4FlsMwvz Qb6t+0CQgt+L6kWI5IiquyM4r5OLhHNrMDtpXZ9vnNVZql2F 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 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]); Tue, 12 Sep 2023 10:13:21 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (mostly) ignored 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. wlcore_remove() returned zero unconditionally. With that converted to return void instead, the wl12xx and wl18xx driver can be converted to .remove_new trivially. Signed-off-by: Uwe Kleine-König --- drivers/net/wireless/ti/wl12xx/main.c | 6 +++--- drivers/net/wireless/ti/wl18xx/main.c | 2 +- drivers/net/wireless/ti/wlcore/main.c | 6 ++---- drivers/net/wireless/ti/wlcore/wlcore.h | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index d06a2c419447..de045fe4ca1e 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c @@ -1919,7 +1919,7 @@ static int wl12xx_probe(struct platform_device *pdev) return ret; } -static int wl12xx_remove(struct platform_device *pdev) +static void wl12xx_remove(struct platform_device *pdev) { struct wl1271 *wl = platform_get_drvdata(pdev); struct wl12xx_priv *priv; @@ -1928,7 +1928,7 @@ static int wl12xx_remove(struct platform_device *pdev) kfree(priv->rx_mem_addr); - return wlcore_remove(pdev); + wlcore_remove(pdev); } static const struct platform_device_id wl12xx_id_table[] = { @@ -1939,7 +1939,7 @@ MODULE_DEVICE_TABLE(platform, wl12xx_id_table); static struct platform_driver wl12xx_driver = { .probe = wl12xx_probe, - .remove = wl12xx_remove, + .remove_new = wl12xx_remove, .id_table = wl12xx_id_table, .driver = { .name = "wl12xx_driver", diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index 0b3cf8477c6c..d4a89401f2c4 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c @@ -2033,7 +2033,7 @@ MODULE_DEVICE_TABLE(platform, wl18xx_id_table); static struct platform_driver wl18xx_driver = { .probe = wl18xx_probe, - .remove = wlcore_remove, + .remove_new = wlcore_remove, .id_table = wl18xx_id_table, .driver = { .name = "wl18xx_driver", diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index bf21611872a3..9dfd832b1d06 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -6737,7 +6737,7 @@ int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev) } EXPORT_SYMBOL_GPL(wlcore_probe); -int wlcore_remove(struct platform_device *pdev) +void wlcore_remove(struct platform_device *pdev) { struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev); struct wl1271 *wl = platform_get_drvdata(pdev); @@ -6752,7 +6752,7 @@ int wlcore_remove(struct platform_device *pdev) if (pdev_data->family && pdev_data->family->nvs_name) wait_for_completion(&wl->nvs_loading_complete); if (!wl->initialized) - return 0; + return; if (wl->wakeirq >= 0) { dev_pm_clear_wake_irq(wl->dev); @@ -6772,8 +6772,6 @@ int wlcore_remove(struct platform_device *pdev) free_irq(wl->irq, wl); wlcore_free_hw(wl); - - return 0; } EXPORT_SYMBOL_GPL(wlcore_remove); diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h index 81c94d390623..1f8511bf9bb3 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/drivers/net/wireless/ti/wlcore/wlcore.h @@ -497,7 +497,7 @@ struct wl1271 { }; int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev); -int wlcore_remove(struct platform_device *pdev); +void wlcore_remove(struct platform_device *pdev); struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size, u32 mbox_size); int wlcore_free_hw(struct wl1271 *wl); base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d -- 2.40.1