Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp224807rdb; Mon, 18 Sep 2023 13:05:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGM/8IBunOs3QEXjh+ICS5rgorxQesHgtCe4UmIzd8tB3P7KRNHIzXKSuILP7rKDmomZdNm X-Received: by 2002:a17:902:7b82:b0:1c4:62a:e4a with SMTP id w2-20020a1709027b8200b001c4062a0e4amr7176962pll.64.1695067500974; Mon, 18 Sep 2023 13:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067500; cv=none; d=google.com; s=arc-20160816; b=bBmhE6DcJ8EJ+YqdfTop+DiLTgO9YA24gt3wbPy2TCFZJZJgDVBUCSvArbJmkeLXqf U22qcPKWOYnAEIWF6kKx9FjcvaSdS/bC/Gir10E27ivxKDQYYa8ZDpq/OJyoEB9hLRsb eG8O96KyaBHheq7YM056EsygK8UeVQPI8m9aVbdrp6EeUxWBGUD+qZtqlMHvtgcVuqkK nmH0x1ZAmAaC7XITSzrVts+t9H/X/ba3/GMRtCsESHaune5omBPPYKjSdNU7uTjypM0n g+PWW12JIl35nIbMx8KX4NvGcIBVzY1aQoZj0NCP1ScXzVLDvrtgOPTOYknnkcWTHOjj rg7Q== 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=lbfJ4Sy2fHcRBejLL2zv7x750baM+sLw+CWvexnvRkA=; fh=GvIYmjLR1Utx1IdeqlBSOAzglESxWH9Pyf3qZMi41VQ=; b=LUxytdprsBqFp81n4w1n/A8GsdR4qzHa6a2oOXgemrDUfKbEU0PHC36snMFOGy+6WL 5blmPuTl9ZeD6Fkvh13sj8tp/Na3aYaVHtnV/iYKL+uWEMSTxBAA0hyPaKxEVRkEzVCg SJeeHbpsha2Kxardo7tQ2UV3udTa0xS8+sfR0u/Gw2U511a3KQS/fFTP1qAk+GKAgu8K 65usEXqvgu+uNO9eA6awNOytreJJLhck1sGDD/3E6oUJG/0hweZ1q6lup+l7gcAZh372 Fz0Kt1kUpyxjlisj1i1SavZllYL7wflr1u0bmBzym3h9ZRxWv3EaISWKz6nVZMXcJO4+ 24rA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id kd7-20020a17090313c700b001b02e8d8976si8628107plb.300.2023.09.18.13.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9369C80A07CE; Mon, 18 Sep 2023 12:51:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229595AbjIRTvg (ORCPT + 99 others); Mon, 18 Sep 2023 15:51:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjIRTvd (ORCPT ); Mon, 18 Sep 2023 15:51:33 -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 530F0109 for ; Mon, 18 Sep 2023 12:51:28 -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 1qiKH8-0003kO-PL; Mon, 18 Sep 2023 21:51:18 +0200 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 1qiKH7-007I8W-To; Mon, 18 Sep 2023 21:51:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiKH7-002mCA-Jm; Mon, 18 Sep 2023 21:51:17 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andrew Lunn , Heiner Kallweit Cc: Doug Berger , Florian Fainelli , Broadcom internal kernel review list , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 03/19] net: mdio: bcm-unimac: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:46 +0200 Message-Id: <20230918195102.1302746-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918195102.1302746-1-u.kleine-koenig@pengutronix.de> References: <20230918195102.1302746-1-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=1828; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=H1NiB/erDsanzSmLc7kgYHyi3+QZdqx9CiVgqb8zgCo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoCXwJzqqcLSLM8g2ttOEMGsP8vURHQfl2P7 WxS+ETwTjSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqAgAKCRCPgPtYfRL+ TqlXB/4rYSwVtTPMP7SsF2DbRSI+mT9eQ6BHFfDqMc1rZTgX8bSV/mlJbbfqI/i2CX4Z2B09WhI DwPhWB55DDCqsiqvL58tDN2+fY63QkJKZC/R0xfHsvc6fCD5wxe1YfKqY2Fs7tDM+Y0UjdOUMKB PgySOjW4d6k7xfU1JiJIIaSqE/v6r2pVyBZexi6HY9Tt6nxze5ZBtFRjcqqC4EBZPXU3IzNP9Bp qcP/Mw9fz2SXPyhjMyiy5weOGkYX+m+thCDh/MlCp3NokL5/l81mqqoMGeH0umdRZqVc+23ejr8 bNBUnckwLuqyFTDiJeDhow6iQCJGeL0iwwgGDBiPDMrh39EI 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-kernel@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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:51:42 -0700 (PDT) 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() is 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/mdio/mdio-bcm-unimac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-bcm-unimac.c b/drivers/net/mdio/mdio-bcm-unimac.c index 6b26a0803696..e8cd8eef319b 100644 --- a/drivers/net/mdio/mdio-bcm-unimac.c +++ b/drivers/net/mdio/mdio-bcm-unimac.c @@ -296,15 +296,13 @@ static int unimac_mdio_probe(struct platform_device *pdev) return ret; } -static int unimac_mdio_remove(struct platform_device *pdev) +static void unimac_mdio_remove(struct platform_device *pdev) { struct unimac_mdio_priv *priv = platform_get_drvdata(pdev); mdiobus_unregister(priv->mii_bus); mdiobus_free(priv->mii_bus); clk_disable_unprepare(priv->clk); - - return 0; } static int __maybe_unused unimac_mdio_suspend(struct device *d) @@ -353,7 +351,7 @@ static struct platform_driver unimac_mdio_driver = { .pm = &unimac_mdio_pm_ops, }, .probe = unimac_mdio_probe, - .remove = unimac_mdio_remove, + .remove_new = unimac_mdio_remove, }; module_platform_driver(unimac_mdio_driver); -- 2.40.1