[net-next,04/19] net: mdio: gpio: Convert to platform remove callback returning void
Message ID | 20230918195102.1302746-5-u.kleine-koenig@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2914489vqi; Mon, 18 Sep 2023 12:54:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEb/Sk4CZKp0GGZPB0hPx4GmbcPBua03nJt+Wct0ehybESbf+Bmzd8wI4Ah1VhocjDG2qKv X-Received: by 2002:a05:6a00:21d5:b0:690:2ecd:a597 with SMTP id t21-20020a056a0021d500b006902ecda597mr12461413pfj.21.1695066880270; Mon, 18 Sep 2023 12:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695066880; cv=none; d=google.com; s=arc-20160816; b=hw9hLu1m64v3o2N64R7TthCK8QXP6XMMqNIU0N38fdluy5j7aYuHcdaUxB8o5kiOFQ zhRxO2/fpQCt8dEIAxUWiduMwBRvKgArXMBje0SgyQJNSjVVumKtXSqIQwpRIF3Y6ssD mFi877PAnmEa+mz0vNSc6LKrQDQOMzlqKshTbiBy9RDP12DPXpFSbp73BH/MADIOUfOL XtuFleQQtJMEOcO7G+vkorJp2jEVQPgLbN/fkagnjet60mexjfLHwk6K1iNCIcJc/77W NpIKTNB0VksrlTZqQXU5p9a7tPZ150SCVP3u/mRbpOzarxFVFHps+u5TqeVGJCHQxtjH /X5A== 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=QY1z0fnA6lKnbhVhwJ6yfis+wXVbgA8TpywSf5B3IQU=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=n5EuKC2xgtDE51ry0QVhfk+w+nDyDx44kDotOY5r2ogOibGC80+PeihsfeZ1H+oIYI 1s3shBxCr1RfskSaAcWxuq0I8F3KsrrTGLZPzoQVoiLJz81dXyvEObsA91xYO8QrRPmO X3rz2KBM2vdvY4PMGPFU9GFcE3rb/Qy5SBcH4aAoDKTKBYb2iSD+PckkNbDovfSWqMbS P0hR1IqTS+tqdJ72UsUiilmmPeKby264KgZKTEkr+UDJfW475vAlcmTOvTAraVzNdsOP /RIIWEJuIcHoR3YsDBYRKens3L5QUEvrHV3TRgrX7H7F1yYK7gevwirvdGsLk2Rz21Oa f7Hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id w10-20020a056a0014ca00b006896e2f30f2si8715909pfu.365.2023.09.18.12.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:54:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 807F0811F266; Mon, 18 Sep 2023 12:51:42 -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 S229518AbjIRTve (ORCPT <rfc822;kernel.ruili@gmail.com> + 25 others); Mon, 18 Sep 2023 15:51:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjIRTvd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); 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 E7B9310A for <linux-kernel@vger.kernel.org>; Mon, 18 Sep 2023 12:51:27 -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 <ukl@pengutronix.de>) id 1qiKH8-0003kP-Gd; 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 <ukl@pengutronix.de>) id 1qiKH8-007I8Z-3S; Mon, 18 Sep 2023 21:51:18 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1qiKH7-002mCE-QD; Mon, 18 Sep 2023 21:51:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com> Cc: Russell King <linux@armlinux.org.uk>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 04/19] net: mdio: gpio: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:47 +0200 Message-Id: <20230918195102.1302746-5-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=1684; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0fNciZ2Ogo3cRtSdHu7jp42q5VnQbmOVsBeR1IsGiJU=; b=owEBbAGT/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoDKN2oRdQbFtSgbfoqfsLkF7IUlYn8fcDwA asJQQvjP4yJATIEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqAwAKCRCPgPtYfRL+ Tr0jB/ik+LJiTWaMBLvw+6/R08c4EbPKLgRS8hCo7Y7iEhw+l4I26e13xz57D0EnbjMDeTRQVlR VD+LXfdocThsnzCVKo2SBC/IORQCZby7B4AE5fePa0yhHXdfrJTu3ZfbpkgJYyb8MGLtVzcOCwR FoOu+w8lbJm+eDokkardtEVPji4h+0EmjscmS8Mvv3uweKYW5HBoPHoITXJwnEOEKTTebQfvNX4 wfmrQqs49aJZploLjzhDRU3mT5UmEaPca6NDRyfnnkaCqE5DQCgxLeqFCzv5zeojly1TO4pN5Bt 8K20npHnzy1AaZCi0INjAPWUZYVI48/xJTlpuhfX9Lh5bd0= 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 groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> 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:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406449069753576 X-GMAIL-MSGID: 1777406449069753576 |
Series |
net: mdio: Convert to platform remove callback returning void
|
|
Commit Message
Uwe Kleine-König
Sept. 18, 2023, 7:50 p.m. UTC
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 <u.kleine-koenig@pengutronix.de>
---
drivers/net/mdio/mdio-gpio.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mdio/mdio-gpio.c b/drivers/net/mdio/mdio-gpio.c index 0fb3c2de0845..897b88c50bbb 100644 --- a/drivers/net/mdio/mdio-gpio.c +++ b/drivers/net/mdio/mdio-gpio.c @@ -194,11 +194,9 @@ static int mdio_gpio_probe(struct platform_device *pdev) return ret; } -static int mdio_gpio_remove(struct platform_device *pdev) +static void mdio_gpio_remove(struct platform_device *pdev) { mdio_gpio_bus_destroy(&pdev->dev); - - return 0; } static const struct of_device_id mdio_gpio_of_match[] = { @@ -210,7 +208,7 @@ MODULE_DEVICE_TABLE(of, mdio_gpio_of_match); static struct platform_driver mdio_gpio_driver = { .probe = mdio_gpio_probe, - .remove = mdio_gpio_remove, + .remove_new = mdio_gpio_remove, .driver = { .name = "mdio-gpio", .of_match_table = mdio_gpio_of_match,