From patchwork Mon Sep 18 19:50:59 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: 141556 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921597vqi; Mon, 18 Sep 2023 13:06:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECqw6FIQO/ebrPmd6NaPqoyQDVCayoqblgnUC5vyT7RkoEaFvllA27kO1YAECf5lfIMX1O X-Received: by 2002:a17:903:1c2:b0:1c0:afda:7707 with SMTP id e2-20020a17090301c200b001c0afda7707mr760781plh.34.1695067581749; Mon, 18 Sep 2023 13:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067581; cv=none; d=google.com; s=arc-20160816; b=fMEE+/pJ6z0qv/bpEstT/e3v7Yv22qvb0muV1xmf03+k4iREkkZm9c0t1oF9VejecK 1j65LlaXmG5wYDhvTCnmC73yB7lu2U8dk7KLHB52Yj5lV/4p6gZj5t0Jhrklv501RVaz 97P/waFvuEF4FyzuirpN/7dgSZ0JwrCt6+4VW4VKnUZHlQmIWoGy5nkO6dJ5glFrNkc7 D8BHjBtyECvazofmeJETbzxAiMV6uFEbsiRRCaLocryuf0XcYqc471cLQA8nARtNBvWT 0GocxavfBn9xQNm/YujjYOFxcOQY17/SCCxOsxx3Fltc62y9WcYXWZRtzPM0gijw6ugx dHZg== 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=1byyVzydE1oPK+ORrSmdbDRObXYRiWilxVYUiQgTiCQ=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=ZeXICGLeq/TBvYVnvhQ9BaZRpW5G/3yg3tq7vgbMraVWr+YXI+XoxLVQ3ckEJrsRot bK3DATIokU8OcZod0ELhn4TPKzmQl09kjmfmLt65Bu8tdC/MZhZmfoN/39EdTGb8t1zf rFlefcDCrw0RiH6Yiwneg1vFwhsvf7DAQtPv521Ouyj0oth+ipFKmX4EBxZoOCX6fgq9 ssWK6KuaPQzRhlItdVaYvlK9GI8XMoCaXSKrcj7waTSeJoCiT1snyAvfcUNha1+801KL zDSYl+m9qLafeXJoip9B33sM+YkBFG1vwQIW8dF8ccdZkd+IKW370sIATt6DMcw6Wfa8 XKpw== 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:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m1-20020a170902d18100b001c4401a7e18si5356262plb.382.2023.09.18.13.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 0933C80C9C91; Mon, 18 Sep 2023 12:51:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbjIRTvq (ORCPT + 25 others); Mon, 18 Sep 2023 15:51:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjIRTvf (ORCPT ); Mon, 18 Sep 2023 15:51:35 -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 6FACC112 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 1qiKHB-0003u8-Av; Mon, 18 Sep 2023 21:51:21 +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 1qiKHA-007I9M-SL; Mon, 18 Sep 2023 21:51:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiKHA-002mD0-Il; Mon, 18 Sep 2023 21:51:20 +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 16/19] net: mdio: mux-multiplexer: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:59 +0200 Message-Id: <20230918195102.1302746-17-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=1993; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=aBuTX9v1GXrVkGebzfqqZP9JXk2psQGbdaJCDMk0zD0=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSOVUKaTpYZHBwGXckGwc1dy0TedJ25fMU2oe2a560Mq bNBVy90MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCRCY7sv1k1pkt72uT/4/96 4vTpGS3FBcJJTk+ZApcbZUSIH5D8yy98g1lmsdTr95Y/3G4kB8VJc3toLz58sm/+z1nZ/ndPHXZ /etEnQ+Xlb6/w8AAdXdXsfT0a/nvEJZl2WIRdl3N+vYd1af5iu+gi+f7bocJ/r+6cJXUrq32xjc TjJx9+9h4T+jGdUTCAt/m5uvHyDhk3kfxXCo73pKTb152fXf81V/fsjDCNAkWZj0+5d2zykPjH8 ZVn3ypem8U74pMCuzdP+sP4yPe8eq2Nr1321+YNTdzHl9W2PN/ussJWL0aEzfb0+6Wavvd2b+ae duAVt6p6xkzuAP9LCaJ/OUNCdsuGyHYbfZI6dqtxr/M0AA== 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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:51:52 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407184802941481 X-GMAIL-MSGID: 1777407184802941481 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-multiplexer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-mux-multiplexer.c b/drivers/net/mdio/mdio-mux-multiplexer.c index bfa5af577b0a..569b13383191 100644 --- a/drivers/net/mdio/mdio-mux-multiplexer.c +++ b/drivers/net/mdio/mdio-mux-multiplexer.c @@ -85,7 +85,7 @@ static int mdio_mux_multiplexer_probe(struct platform_device *pdev) return ret; } -static int mdio_mux_multiplexer_remove(struct platform_device *pdev) +static void mdio_mux_multiplexer_remove(struct platform_device *pdev) { struct mdio_mux_multiplexer_state *s = platform_get_drvdata(pdev); @@ -93,8 +93,6 @@ static int mdio_mux_multiplexer_remove(struct platform_device *pdev) if (s->do_deselect) mux_control_deselect(s->muxc); - - return 0; } static const struct of_device_id mdio_mux_multiplexer_match[] = { @@ -109,7 +107,7 @@ static struct platform_driver mdio_mux_multiplexer_driver = { .of_match_table = mdio_mux_multiplexer_match, }, .probe = mdio_mux_multiplexer_probe, - .remove = mdio_mux_multiplexer_remove, + .remove_new = mdio_mux_multiplexer_remove, }; module_platform_driver(mdio_mux_multiplexer_driver);