[net-next,08/19] net: mdio: moxart: Convert to platform remove callback returning void
Message ID | 20230918195102.1302746-9-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 h50csp2914749vqi; Mon, 18 Sep 2023 12:55:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGC6zjrNOnOXeYBu/piehUxa+DEcqZ3nuGq5eVTwx/0iffR3OuvE6eZTDBhrg8eZldCYhPr X-Received: by 2002:a17:90a:9bc6:b0:274:638d:409e with SMTP id b6-20020a17090a9bc600b00274638d409emr7283747pjw.22.1695066916925; Mon, 18 Sep 2023 12:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695066916; cv=none; d=google.com; s=arc-20160816; b=mO9n24IxICuPlin2tkuVssIm6Mohcxivt8hsfox4dkvI6fyEC5eXa7vlM6sf7sB2Zj 3Yt7BTKdCuS5MJo5y6ZK80ORrCk8t6J796PPegiiy782ajXPFvh8/zp+arfVm0ORniWf +qKpXrNPGjJGUnqbqZA6mhzZHLToduDBB7psjobHqwpgLLI6KUst06ycLs2pA+f5dUIN T9iAOPKa/5oYp0biB+PJEwAV/QkN0+VvVmpnzqrBY45wRn18QPMKpySmscKZSMg8XWhM iw6RpZwN8DlbFXuKLKpLFgrF/AOft3rURl9AVJvBYgWDiM5y6pqp63NI5aXefxwadFN2 Ineg== 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=iVdUskuHvwe3G92QW9/nnGlgWWFW0MpXuFB28y9VWPo=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=nJwWQctt1GvPUcGqknpafUV4mprIRl6hugAZ7L3iXzkH6gdgVOrPsQ79sAweFOvrz4 MsKTIsfmMlgrYw+OZ4TlBCRU44vWNMt883RCR5aem6wFYAesFroZ626idJQTEw2p2lvf YZB+rVuEIsYQ3naeYRYew/fS+z3840DrvD3ih4rAIFGaR3kD29mc+IFJtIoKAkp7hZ6U wV/BcASrDes9tLcOY9JE4/OjoB6JgK86aVeuUNup39mQM1Pt65MGlkNgsJm4WXKJhdts XEKMyEWj8gvV2Na8gEwwXrv1a6VY9+h6mZA2+lD9bJbqcBwhfeQngLjST8sIlGO9buO6 5H5A== 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 x10-20020a17090ab00a00b0026845738569si8368583pjq.169.2023.09.18.12.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:55:16 -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 A3AC7823267C; Mon, 18 Sep 2023 12:53:23 -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 S230085AbjIRTwT (ORCPT <rfc822;kernel.ruili@gmail.com> + 25 others); Mon, 18 Sep 2023 15:52:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229796AbjIRTvn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 15:51:43 -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 E2E3013E for <linux-kernel@vger.kernel.org>; Mon, 18 Sep 2023 12:51:36 -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 1qiKH9-0003kw-Cy; Mon, 18 Sep 2023 21:51:19 +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-007I8p-Vo; 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 1qiKH8-002mCU-ML; Mon, 18 Sep 2023 21:51:18 +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 08/19] net: mdio: moxart: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:51 +0200 Message-Id: <20230918195102.1302746-9-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=1778; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SFVwuXQK4Rw80RKojtArHfklGiZ6u9GU+saHQozaYGs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoICWEdzJfaEl76LwLVd512ApQNok+R9R413 y2q9PruMoGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqCAAKCRCPgPtYfRL+ TrLSCAC2G8q+sOPQp8rnFbnD2/tKzYNHPuCUGr4UeA4sKpSN8Wxc9WNXX3QmrtvyAzlJ51L119u c6mgbD5zxg6jgRaWjbZvaadLHiBIX42Tf2XQe71NtlFh9p7TvqjIG7NOcr6YPBedCIpEGf/gSyp xEfiyMkY3A8fYBHUH0gdj2kn+zUKL5Li4j/E3nT5M8TM+20iCH3ifLoq4YrgakzCc/KhNJa8r+h vPqJUFASsv5JbFuIwUp+o8qIm5krqe7PAbd+3QEz0KpBBKAQ4m/nBcLHQRW0Sy3eryrW7zA+dMA oDQFVjragHodAh+loyoY89ena9ILU2/xXUsPjW65/2QMAYRe 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:53:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406487693771750 X-GMAIL-MSGID: 1777406487693771750 |
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-moxart.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mdio/mdio-moxart.c b/drivers/net/mdio/mdio-moxart.c index f0cff584e176..d35af8cd7c4d 100644 --- a/drivers/net/mdio/mdio-moxart.c +++ b/drivers/net/mdio/mdio-moxart.c @@ -155,14 +155,12 @@ static int moxart_mdio_probe(struct platform_device *pdev) return ret; } -static int moxart_mdio_remove(struct platform_device *pdev) +static void moxart_mdio_remove(struct platform_device *pdev) { struct mii_bus *bus = platform_get_drvdata(pdev); mdiobus_unregister(bus); mdiobus_free(bus); - - return 0; } static const struct of_device_id moxart_mdio_dt_ids[] = { @@ -173,7 +171,7 @@ MODULE_DEVICE_TABLE(of, moxart_mdio_dt_ids); static struct platform_driver moxart_mdio_driver = { .probe = moxart_mdio_probe, - .remove = moxart_mdio_remove, + .remove_new = moxart_mdio_remove, .driver = { .name = "moxart-mdio", .of_match_table = moxart_mdio_dt_ids,