From patchwork Mon Sep 18 19:50:54 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: 141537 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2914544vqi; Mon, 18 Sep 2023 12:54:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+GA7HDwQHn6LA+lDvEdEmGjPIV+IeEAWAX5qwPFZn0kXEP4ebta4owKFb/bRRcOgFUmcR X-Received: by 2002:a17:903:120e:b0:1c1:fe97:bf34 with SMTP id l14-20020a170903120e00b001c1fe97bf34mr10578883plh.24.1695066887773; Mon, 18 Sep 2023 12:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695066887; cv=none; d=google.com; s=arc-20160816; b=U5s8Z32AxYC52e64FTcV8pk81E238qDbyft8OqtCxSq3UCqArZDiQoFuI4Kj6yxXo1 Gv1IWx89hUIx153jwej29QxyMAaPXymAMySXJZuxmkHEN8MDsrwfQ1xaxG/0YJsmpHqq MfXNiaQ3yKKpqihUIAR1sMTpwD/0rDqj/w8/b9w58ldGvszfW0SfZLJ95R2MsYISlXd9 TZwPKwzO1ZAn4XlpdH8ZXz9AJuRSsLuep3iOYh0U559PsjA+yxfCTr1SXKZ93sBEALmm NfsOXEblh8qsQAo+2oX09hazG8qrKYFk6NqrP6CI61D6WHMq6fKQr7o7tNK8vjxYT3s4 6wtg== 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=t1aWGFVfBzD2jUxcUPeWev2nzn9QgbRjDZUX594Q1K0=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=ilLPU3mPFnAP08Mnda5bQdLfGqIkb4KMPVX50ju57tkoXS/ay6Bt0YCtMrpJA1A2JO A9DuyiqfIyOY7U9rXVw0UxTRVFzG6R/GQdR/J2la7vPPaAoWYfikYweK5sN3mz+KSA88 pD3cRwKo7E3PMXFa7qh1qmRZP4kJKqDXlwl86L4XojCNA77He81Qh/jo1hmrC6gjTrmt 1frWPjXK8PqZLParveOnSatv4lhjM6bkzsbqgY6MrehU6lQv1LEv+v9wWfw+iF8AyB8O GqzbV1Agbz8wyhCTh9ujsWQSCZMrCAr0LCJBBOSzNV0uviOlJJyyBgZHCwB+zXtkoxG/ BNag== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q15-20020a17090311cf00b001b02e044c87si8794887plh.320.2023.09.18.12.54.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:54:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 3FE0A80253AB; Mon, 18 Sep 2023 12:51:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbjIRTvj (ORCPT + 25 others); Mon, 18 Sep 2023 15:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjIRTve (ORCPT ); Mon, 18 Sep 2023 15:51:34 -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 12E0810A for ; Mon, 18 Sep 2023 12:51:29 -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 1qiKHA-0003rg-4F; Mon, 18 Sep 2023 21:51:20 +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 1qiKH9-007I91-Nd; Mon, 18 Sep 2023 21:51:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiKH9-002mCg-E3; Mon, 18 Sep 2023 21:51:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrew Lunn , Heiner Kallweit Cc: Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 11/19] net: mdio: mux-bcm6368: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:54 +0200 Message-Id: <20230918195102.1302746-12-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 X-Developer-Signature: v=1; a=openpgp-sha256; l=1838; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6qkpqqWeBAEoQyATr+QvDzRx6/mxbOOENw9LdzhgKdY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoMyP14QCF/JVsZFet49UGwAoxTv+4aHq13e BILCdjrG0GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqDAAKCRCPgPtYfRL+ TnJyB/9YXVheidEVmz/ftnWiEuSK7kbHVsjdjVTuW9L7RUY0STLT5MF4/LRaswQoEbX48nUfQUE 0a7mSgsH9LGCS36w1uLPb3uL0DrA2bRX6u7zjryLj3W+forg25D4oiJ2u6YKE+KOXaNLKWznj0Y wHpNGpy+O8JYrCrYPx2LhjMb8ptZMiR/eFYYIsP3mgHBiv1SPuDJlQRPM0HnIFNX1yHcZ1PwwYn WhS34/l+ZAjrSaF40Uaw3hr+1C6jF05vS2VvudyFTBiWz7AxMVGaUobVaIhgwRQnj1mvrTEJkdo S2gVreg/AeSPr2lg6Ja0lWpH+RYLpSFN7RnR/VIh2hsHhyki 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-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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:51:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406456886863070 X-GMAIL-MSGID: 1777406456886863070 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-mux-bcm6368.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-mux-bcm6368.c b/drivers/net/mdio/mdio-mux-bcm6368.c index 8b444a8eb6b5..1b77e0e3e6e1 100644 --- a/drivers/net/mdio/mdio-mux-bcm6368.c +++ b/drivers/net/mdio/mdio-mux-bcm6368.c @@ -153,14 +153,12 @@ static int bcm6368_mdiomux_probe(struct platform_device *pdev) return rc; } -static int bcm6368_mdiomux_remove(struct platform_device *pdev) +static void bcm6368_mdiomux_remove(struct platform_device *pdev) { struct bcm6368_mdiomux_desc *md = platform_get_drvdata(pdev); mdio_mux_uninit(md->mux_handle); mdiobus_unregister(md->mii_bus); - - return 0; } static const struct of_device_id bcm6368_mdiomux_ids[] = { @@ -175,7 +173,7 @@ static struct platform_driver bcm6368_mdiomux_driver = { .of_match_table = bcm6368_mdiomux_ids, }, .probe = bcm6368_mdiomux_probe, - .remove = bcm6368_mdiomux_remove, + .remove_new = bcm6368_mdiomux_remove, }; module_platform_driver(bcm6368_mdiomux_driver);