From patchwork Mon Sep 18 19:50:44 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: 141550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921283vqi; Mon, 18 Sep 2023 13:05:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdOKZZ/1OrwoluJi5+lgP4kmULVlHDIa6k9U86ACi0hXVNLXtTomao3NzGj1ja0p9UfONy X-Received: by 2002:a05:6a00:1487:b0:68c:1004:1feb with SMTP id v7-20020a056a00148700b0068c10041febmr13263477pfu.32.1695067554831; Mon, 18 Sep 2023 13:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067554; cv=none; d=google.com; s=arc-20160816; b=PTWaqUkaV2xCnoC8BfAQEV4Ldh+JCya5/kqKa4rcFK3Mm+mi7r2iN/9lc6a+lB8rix 2rNFR5XLz/Dx1yQ1gdHwHWi1hQQHSpJYshLQtk5J6BkpkaCSC2wy3iL3hkDiTF6sqfYQ 0+i1wkKEHRSsl2ikLQYfmdbXfClOLA1K6MZcez9pUafUq7qBBh+/AZYxoHaDE9DsVUek MUMPcUhgzlTMnvf9jjyKkQPjf2cvjL2bnkM3AirxV3VA3LYqSsEwvzmFovMHplM09Kxh oR7BNm/vnCJPFi6DJQwVyo6YVKxy8yGSHUJpfKxzzu2fT9WXfxOGHiiB6Now5BDtMd9f j00g== 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=9Y984OjX79RkMgRHXkZzy8X31oIvBxas+JszTMMgUOc=; fh=XDqoAVwMzrC6R7rzXxTnrN5KWBJDTIdYVLVDNO6skS4=; b=B+Tz5qORI5Hs/qeRAT9KdQnxPbHpO7CMI2l9F737Sto3FJfgrBQvXOeiRjVsg7BHfy rgdlabqgzjiSOSDcqS8CvEjWvhy9ebDRZFHVST4NC+nxRWmA11VId+NXcfQsok8yUQlH 6oyMuFm28hoK5FzL7jlLmR5jetUeKzWuRvNlss+Yv8V4C0RHL+e/aQjBr3HSo3ImzQXl DOM4vlS5mh1QDvnaY83TbVQgC23MMYCkRNw/qcwNPD6dGK92S7HciXs0uTrqJ3qtW1zH B81JEr5wk//2as3bBeVM/wFvsfXrsK9Fn3HQfcEP9ZNDixJj/FgqRlhmPejC7wxXOAXL DeEw== 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 4-20020a630004000000b00573f83d85e8si8567484pga.467.2023.09.18.13.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:05:54 -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 D7FB881BA653; Mon, 18 Sep 2023 12:52:34 -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 S230154AbjIRTwc (ORCPT + 25 others); Mon, 18 Sep 2023 15:52:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbjIRTwA (ORCPT ); Mon, 18 Sep 2023 15:52:00 -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 0FC3D1B0 for ; Mon, 18 Sep 2023 12:51:42 -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-0003kM-8w; 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 1qiKH7-007I8Q-Ei; 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-002mC2-4v; Mon, 18 Sep 2023 21:51:17 +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 , Joel Stanley , Andrew Jeffery , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 01/19] net: mdio: aspeed: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:44 +0200 Message-Id: <20230918195102.1302746-2-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=1821; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+rLYLOsUpr8kyy+QFlBR3XWIcdLjwnZ/LnhP5xUSMTQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoAeA+IS0yQi6cSoY2pH7ok+WjtIDnAYn1k9 fgK9LXFin6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqAAAKCRCPgPtYfRL+ Tg6MB/9RzPdhExQILy67IDnTq81/pUsM2T6QgTRxzoOE6vIqMyoKjvG5Ep1oj4jtvqjXcSom28W La0nOZIorIudcmyTU81CVvJt/2uzvLIUbY2DySyTfpVCg6VXUrrvFme+raLXLLm7UVlwBfgwYhr IYhRPmDLyIyamGf02ZQ6D+GvY5cgIj308E4nC7TZpGebXQugLlQAcATzjBG52rnt4kJs+xiOYVy M5KKEELd2Fr1PUJeE2xWJl721EU7OOE8jcR/fp/Mds9v0KaY9X8+qJExQvhwPr8+shvEjYxvP84 adrN5A/M+Bg7wuoCPU36gwxA5XHm8oC8d6QlBrm8aMil5+QA 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:52:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407155913549042 X-GMAIL-MSGID: 1777407155913549042 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-aspeed.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-aspeed.c b/drivers/net/mdio/mdio-aspeed.c index c727103c8b05..70edeeb7771e 100644 --- a/drivers/net/mdio/mdio-aspeed.c +++ b/drivers/net/mdio/mdio-aspeed.c @@ -177,15 +177,13 @@ static int aspeed_mdio_probe(struct platform_device *pdev) return 0; } -static int aspeed_mdio_remove(struct platform_device *pdev) +static void aspeed_mdio_remove(struct platform_device *pdev) { struct mii_bus *bus = (struct mii_bus *)platform_get_drvdata(pdev); struct aspeed_mdio *ctx = bus->priv; reset_control_assert(ctx->reset); mdiobus_unregister(bus); - - return 0; } static const struct of_device_id aspeed_mdio_of_match[] = { @@ -200,7 +198,7 @@ static struct platform_driver aspeed_mdio_driver = { .of_match_table = aspeed_mdio_of_match, }, .probe = aspeed_mdio_probe, - .remove = aspeed_mdio_remove, + .remove_new = aspeed_mdio_remove, }; module_platform_driver(aspeed_mdio_driver); From patchwork Mon Sep 18 19:50:45 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: 141552 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921457vqi; Mon, 18 Sep 2023 13:06:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbBxHB7rOM79NkYZhcWyjs1w8m5IpQjZxaoBAl9v03hjxg6cDsbHWkdmm6XvJKZHUVZzLu X-Received: by 2002:a17:902:c714:b0:1c3:b0c7:38bf with SMTP id p20-20020a170902c71400b001c3b0c738bfmr560277plp.12.1695067568155; Mon, 18 Sep 2023 13:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067568; cv=none; d=google.com; s=arc-20160816; b=CGiM580SuYReKn5VQFyBgGrY3+erWloRbVbVrn9KLNkDPMZc4cRiIGkvrJoXR3MCiV 1Vob6bAp/Nlb2bssMgjzCZ+1TrHVG/FNShwt/5fy/aV3+SmmSj7urxJeJt9nKK++RzXH swbU+/qbmZtcbfgKmdXcrTdnMvvv64OIYHDUORw8ElqCiGljQrYl6qhQp9nGRVwM1/Tn uA4err1nzdk0NkANmPgAIUlB719V/1I8z17nv6QS59tlXHsU+I2YhX0g+rhWqUCvKz1P pxN0rwpN/s2Cqv3IPa0NBHQNVsWuJ/svklZa7oWH2wjmaIYwBbEEjnCq6HH0cLxRGFDY e5oQ== 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=2xLNX3zgsch7Y4ptVCQ6RqTzMZiKCIqHBe64otxYRjo=; fh=3w/gWP9AjeP35Yt+9ETEM//9CZFAojrIL8kNXmM6h8U=; b=l9SW5bhyZYJkQ6WiDUiWGt7QkeMY3KHRO/vbOPr6WoPS1mu7GlBzzd6pc4gTnU/7Li 16Pz7SlXkc9XOCWyhhlRqVY4FwKZy7U7XmmfZasYA3qCH/pqjr9nya1HkSpiI+yGzehK LI1BRW8rxexTPx/cVMQOE7IvwnuM3QXf1Ce/FScOE8q5bNjwXZ2DQbLRiyaNM3wMQyxi aTJXMC1n2jbQdJCGOVMaG/R2y/Gs18XnUDxnFYkT3nzRhuSB9NutPUWt43wnlnaxzcvB mT4MoGBa1UFxl7E2qtaKOzar8wX0ROx56zNuW93gXHqV6gWL8IEHd0SNqFp73KLhYXeD YqBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q16-20020a170902dad000b001badbe8e441si2702214plx.106.2023.09.18.13.06.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:06:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 ABC4881B8959; Mon, 18 Sep 2023 12:51:56 -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 S229735AbjIRTvv (ORCPT + 25 others); Mon, 18 Sep 2023 15:51:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjIRTvg (ORCPT ); Mon, 18 Sep 2023 15:51:36 -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 1A0FF10A for ; Mon, 18 Sep 2023 12:51:31 -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-0003kN-PK; 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-007I8T-MK; 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-002mC6-CQ; Mon, 18 Sep 2023 21:51:17 +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 , Ray Jui , Scott Branden , Broadcom internal kernel review list , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 02/19] net: mdio: bcm-iproc: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:45 +0200 Message-Id: <20230918195102.1302746-3-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=1713; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wWOk5ISRV+Cu8beJpj4odlkFSht8tvcCLTItEfQP5kQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoBowTF/6mTesdVE3rQTlFpYwkX8+FZIowHa JOgBIu64zGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqAQAKCRCPgPtYfRL+ TmjjB/4lCfQp5h7nyKtACQrfiQ6ZTgSB75P9Q7dNR1kc+jd4DE4cOLP0GKrF1iaocN5wCzQSulb PvNFwvsGP2VtbKCwF/ceWh5EyY6MnGYxoZmYrhJlmUUoXDOvf25qlGhaWL/463JpR1fdqxkwjFo QeE2lTCbPcFVmHZ7W6YveCd+xt4hMTyuHwSn8pCdFPMaEvpXUP7hvr+WmC+ChjKRmMIQhvWIFV/ vBLDP9+OI12BR4g1Wz/C/VvdGXVbgRkjoyiv/7qRu2fhBQ0MxwMnhBIZEgbruIy2l1B7km1H7PO xGlVlpMbAQSekrDtS8NWqWAm5KWxqfgm06RBOZL5FIp9ELvo 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:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407170767614678 X-GMAIL-MSGID: 1777407170767614678 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 Reviewed-by: Florian Fainelli --- drivers/net/mdio/mdio-bcm-iproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-bcm-iproc.c b/drivers/net/mdio/mdio-bcm-iproc.c index 77fc970cdfde..5a2d26c6afdc 100644 --- a/drivers/net/mdio/mdio-bcm-iproc.c +++ b/drivers/net/mdio/mdio-bcm-iproc.c @@ -168,14 +168,12 @@ static int iproc_mdio_probe(struct platform_device *pdev) return rc; } -static int iproc_mdio_remove(struct platform_device *pdev) +static void iproc_mdio_remove(struct platform_device *pdev) { struct iproc_mdio_priv *priv = platform_get_drvdata(pdev); mdiobus_unregister(priv->mii_bus); mdiobus_free(priv->mii_bus); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -210,7 +208,7 @@ static struct platform_driver iproc_mdio_driver = { #endif }, .probe = iproc_mdio_probe, - .remove = iproc_mdio_remove, + .remove_new = iproc_mdio_remove, }; module_platform_driver(iproc_mdio_driver); From patchwork Mon Sep 18 19:50:46 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: 141543 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2915995vqi; Mon, 18 Sep 2023 12:58:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/EuO8T8HduOSJJBXh4jnrrdv7KOvF/QlhvSZ0WwdZ1ZVQT3beOH5FBU7M8qiIH7mB2iqM X-Received: by 2002:a05:6a20:3255:b0:133:bbe0:2ff1 with SMTP id hm21-20020a056a20325500b00133bbe02ff1mr8170829pzc.44.1695067088482; Mon, 18 Sep 2023 12:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067088; cv=none; d=google.com; s=arc-20160816; b=KYTHbR2V/90Bq2+7iCMLWg+e46ZT/tQREUrGoUjtz2dfZPrhxEEJuaXsVEeY0PFxsM l2go7EWmd3vWjWwjKWyjRq1GoUIKNGz8BABninx+zCnf+qS3znoYpag6zR0pKgpPPwi4 CMSpprRh6Da2/ntuY+z8zt6plrTLNvZL3r9uw8+Umi298HmRYahgbi7GOwBxI4E697a5 ELaRa+qD2wI2QVXsv2P6AnuUs2LSPLpB72ILdqJBbJavUHuKw+8sjOKUaRDZT5c5kVyd THPb5O7n7r64I1c3mkb89gCvtbnS5Pii0jb2e8nor5Uj88GxtIdMEU6oLtmE5AMWC+jX tkbA== 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:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id d15-20020a056a00198f00b0068ff3a3c9d0si8709756pfl.91.2023.09.18.12.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:58:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 8D9F780758EA; Mon, 18 Sep 2023 12:51:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229598AbjIRTvg (ORCPT + 25 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_Kleine-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 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 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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:51:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406667641635402 X-GMAIL-MSGID: 1777406667641635402 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 Reviewed-by: Florian Fainelli --- 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); From patchwork Mon Sep 18 19:50:47 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: 141536 Return-Path: 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 + 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 ); 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 ; 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 ) 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 ) 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 ) id 1qiKH7-002mCE-QD; Mon, 18 Sep 2023 21:51:17 +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 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 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 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:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406449069753576 X-GMAIL-MSGID: 1777406449069753576 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-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, From patchwork Mon Sep 18 19:50:48 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: 141555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921588vqi; Mon, 18 Sep 2023 13:06:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9vIv2sFCY890/lvMJrk1vsEoP06oVvJOAjN8IE2SvXC30JlvHbL0MddGxY0AU7zCAWoWQ X-Received: by 2002:a17:902:db09:b0:1c4:4a4d:cc6 with SMTP id m9-20020a170902db0900b001c44a4d0cc6mr830081plx.19.1695067581181; 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=wi0MHvqeTgDHRSdpdDdfqGTJ+geTkh5OtX/mt++wpP9EngWFuNXLcH3akr1niiwd5b CDEejmUrZ5Zzq0HXnCBQkjkmbWV/2i38yz2+AncTisy7e7hEv5f6oqn8PigwQld3U1+x 2HAWrjB/I52zkIu3EfqKKsgCPvyvFgxlTSUC3/6jnj74lPIMkouW1r9xn3PXfxJeSO4X d2SEoDIQkew6m1j9IYxNDAhnkabzh3Wsf69D/35i8fiGUzEAegvDGNPWhVAu4zQu6vo9 habOB/8lXwVT499v+pzaBZDfkZ3X2go6z3wr/E7ckijMWN3yTScTv8vAuLuOXVIsANNq FVmw== 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=WGI9phaUF3kfEvo6N5Dh4AKVLel/sladJI5HIKqwEQY=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=Df0lnXmgviHQex4WZStBt3/e6cDoRtbzzS3U3rnUwACCbMUvQGvwm+wZO+VwCtqCGF TYHyBhFp05FbvDexoBRgSNywDNBgQuGlj87sJJYdQJ+XUt2cb/1cYB6pdpb8Uos8Hwve uzLFHspp601bLpcOCfke7HJN1MN2u+GlSTDvsdCdORczl2LPU79kHbVAPQ2TxR5+Qg6O ZsDkg7jo5ia0o3++rT2Igw2T2c+t3H962g7vmEfNkSPOAQwLipYrSIt4dA6bLJm4pGJk i9td1ojcl+O4S09QqaGx9/aD1I0gpmJKtJowSKEyn8ETYZRBJ1K0FfpipW0oCrD9EOsF 6z3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id t22-20020a63eb16000000b00573ff1f360bsi8335510pgh.479.2023.09.18.13.06.20 (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 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 0750881B93D6; Mon, 18 Sep 2023 12:52:05 -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 S229937AbjIRTwC (ORCPT + 25 others); Mon, 18 Sep 2023 15:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbjIRTvl (ORCPT ); Mon, 18 Sep 2023 15:51:41 -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 EB96B128 for ; Mon, 18 Sep 2023 12:51:34 -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-0003kT-N6; 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 1qiKH8-007I8c-9v; 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 ) id 1qiKH8-002mCH-0K; Mon, 18 Sep 2023 21:51:18 +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 05/19] net: mdio: hisi-femac: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:48 +0200 Message-Id: <20230918195102.1302746-6-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=2009; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=HQon30rRgBBgFtnAN7jXNVSSzpSUENvH/4/wmd2IRT4=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSOVSy9rSkl6fWq2v7mOcFFEQmKorExfe9VJxXa2Zw0z 8rl8uxkNGZhYORikBVTZLFvXJNpVSUX2bn232WYQaxMIFMYuDgFYCKb73IwdAekO1m9W6DqI/T+ 442fxw1kj2lseLrhzpell+dZV905WnyzVH6tyYfpgf9Us655T3SXk95RMbd7fpKO0AtNsVjVi9+ 4xTyT2D49DI1bpOD6TzjpU2TS79Bkr3KXtxMPJi3/8OOn9j/hK7oTyr++P/DU6Yq2pV54YzHD4W ul6iwVPxkjLrGZGoXu+qGfeSP59LT+KUtLttd8FvTyMwnwtRQ9Kntsz67rT/PEzHKjmq9IvIquC 65jepHZ87f7b9GsiTsLqu6XbfaSuKLSXhw741Ry7rWe/3PTpfW3m3VPE43+b3aqx+a/vopBctiS u+wfQhQzAjUZT6ldf65yeQOf7MdIncl3bTyW7NPifx4NAA== 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:52:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407183821895751 X-GMAIL-MSGID: 1777407183821895751 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-hisi-femac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-hisi-femac.c b/drivers/net/mdio/mdio-hisi-femac.c index f231c2fbb1de..6703f626ee83 100644 --- a/drivers/net/mdio/mdio-hisi-femac.c +++ b/drivers/net/mdio/mdio-hisi-femac.c @@ -118,7 +118,7 @@ static int hisi_femac_mdio_probe(struct platform_device *pdev) return ret; } -static int hisi_femac_mdio_remove(struct platform_device *pdev) +static void hisi_femac_mdio_remove(struct platform_device *pdev) { struct mii_bus *bus = platform_get_drvdata(pdev); struct hisi_femac_mdio_data *data = bus->priv; @@ -126,8 +126,6 @@ static int hisi_femac_mdio_remove(struct platform_device *pdev) mdiobus_unregister(bus); clk_disable_unprepare(data->clk); mdiobus_free(bus); - - return 0; } static const struct of_device_id hisi_femac_mdio_dt_ids[] = { @@ -138,7 +136,7 @@ MODULE_DEVICE_TABLE(of, hisi_femac_mdio_dt_ids); static struct platform_driver hisi_femac_mdio_driver = { .probe = hisi_femac_mdio_probe, - .remove = hisi_femac_mdio_remove, + .remove_new = hisi_femac_mdio_remove, .driver = { .name = "hisi-femac-mdio", .of_match_table = hisi_femac_mdio_dt_ids, From patchwork Mon Sep 18 19:50:49 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: 141542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2914922vqi; Mon, 18 Sep 2023 12:55:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnOmmzqTiXWQuiCcjAdGjBu6wjaPRn7rdCxLlpBNJrS7l9bS4P4eOz+5h2CQifi2j0ESAF X-Received: by 2002:a05:6a20:7483:b0:158:1387:6a95 with SMTP id p3-20020a056a20748300b0015813876a95mr10157307pzd.19.1695066945677; Mon, 18 Sep 2023 12:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695066945; cv=none; d=google.com; s=arc-20160816; b=V9hUnVbG8CNi/ibfSkAHkeeosOSWlZt5S5ia1Rmk9cn50/YD3+N/j1nisFp+0Ut3vP x6d2Zjw4UCxj5yLGQN5NJwAYyDZ44NsBgvbNNKG7hpmYISiM1MY3MzF7Ejr5zNhT6fIs m506FbOLRfstVYo4hUYZWzQmaJLxWS3+fFDB7Uiww5Bn7Sv3wpSHi9fAudavU7jidcnA i+suhoOp3T24nmO3AiUTMc4oaXuj8ePDaK75A9YsX344UnY81yQGKuROXEJkAvuixzBG fECtrGpzdPzDK0MxZxaOHPnisA86n00M1GYdeGW+7S9F0RCooPBfqv5R4Ec2OddXtOjn N1zA== 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=zHhBcFN9+9Al4FocXipS/rOCwpRWZx7m5H3DRuOmBok=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=ppGKpngvHIJm81mXPmRnwrr1OL9mOAomofxDAqwGMH0R3zKF93AsCcQUfh1/mqR+nd q7aYJXZGmk4dz9kiB6rhy5qje44faLJxY5pVgH+4lQ6cr03/NjVNke1lZjDpzO09ThLT m2Z8WWq/oR4mwrXOGcLBDuq3bEBxsafbpUCB9/7SmUoIpsNfj0zsA7ZRqZ9Xquu19gUo nif5ytYKhL/vNd8bgk9XpiyhEY714HEqyYFscIlH8xesWgwLlt0244zK9TjaX6JIRRCd 1qBdddYhX6gjbFsqPrUN8v+01cFG5I30yqCnPyeThSNUe0pLzgaGJYGmzMiAbiBn4GhT PDmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id j190-20020a638bc7000000b0057795a17f4asi8537996pge.177.2023.09.18.12.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:55:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 6959981FEC53; Mon, 18 Sep 2023 12:53:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230052AbjIRTwK (ORCPT + 25 others); Mon, 18 Sep 2023 15:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbjIRTvm (ORCPT ); Mon, 18 Sep 2023 15:51:42 -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 64B89137 for ; 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 ) id 1qiKH8-0003kZ-Tz; 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 1qiKH8-007I8f-Gf; 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 ) id 1qiKH8-002mCM-6z; Mon, 18 Sep 2023 21:51:18 +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 06/19] net: mdio: ipq4019: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:49 +0200 Message-Id: <20230918195102.1302746-7-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=1770; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=53bQT0brWvmojLGsSw5tHyo9YgNKA/khjFsSsXxipzQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoGR0bUSJIrhX5xYRQRyvkwUi0NYN0zO0Ope erjMwwMe0iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqBgAKCRCPgPtYfRL+ Tu67CACdG5bLLV7eYrWGT4121uBTVyyV7xYiIROvhUFh3GM7WkkB0slPoUmP5BwLp3EbT7NHEL9 A/AbC6K8ZWU8dixOBt/RQnaXiMENdoLzL1Iw41fHQkEpQUnjA/qY4A2dNTOR2FyIzO4aTxkRJJq TBGykg/j3vqkTk+B2gnyL1zcYXivhJvKyVzJxOBcYEs+d3t4++L5XA+lj9muKQymm7OHp8RXMhc /dNU7DGF/cjQbr3ez+iPCzk2pAbhvg+P61lqMrp8tQKLDAQ3mvvJiLL/LhmnEGPev2l6aYMU0xN hebULZjHkGh41EtRutuCyk4JWOye7SuRijRE01DI4tc8iW5P 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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:53:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406517595198342 X-GMAIL-MSGID: 1777406517595198342 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-ipq4019.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-ipq4019.c b/drivers/net/mdio/mdio-ipq4019.c index 78b93de636f5..abd8b508ec16 100644 --- a/drivers/net/mdio/mdio-ipq4019.c +++ b/drivers/net/mdio/mdio-ipq4019.c @@ -278,13 +278,11 @@ static int ipq4019_mdio_probe(struct platform_device *pdev) return 0; } -static int ipq4019_mdio_remove(struct platform_device *pdev) +static void ipq4019_mdio_remove(struct platform_device *pdev) { struct mii_bus *bus = platform_get_drvdata(pdev); mdiobus_unregister(bus); - - return 0; } static const struct of_device_id ipq4019_mdio_dt_ids[] = { @@ -296,7 +294,7 @@ MODULE_DEVICE_TABLE(of, ipq4019_mdio_dt_ids); static struct platform_driver ipq4019_mdio_driver = { .probe = ipq4019_mdio_probe, - .remove = ipq4019_mdio_remove, + .remove_new = ipq4019_mdio_remove, .driver = { .name = "ipq4019-mdio", .of_match_table = ipq4019_mdio_dt_ids, From patchwork Mon Sep 18 19:50:50 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: 141554 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921563vqi; Mon, 18 Sep 2023 13:06:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmKh7m0B8zkqL5/keM/0oDrUvrJbZEO7PyNhqoSEGG/1mVpdqDYtg0fdKUGLU/GBqMRZJs X-Received: by 2002:a05:6a20:7483:b0:158:1387:6a95 with SMTP id p3-20020a056a20748300b0015813876a95mr10187831pzd.19.1695067578353; Mon, 18 Sep 2023 13:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067578; cv=none; d=google.com; s=arc-20160816; b=S9X5k8v8gKthJbDiERiEAtpjVJlL+qv3K3kB7GOgjWvkOLyLBjLlkAunuEVHvCIVS+ NmfOrbHJx2j+GSlwyA5V8xgljALiWDa+NtRrEOA5KLudZrSrOsi5CbH2tnpkgurKh+VC BIlRtHvKgS2AnevpmE8OYK35hGS4QCrDvxMoTQ3zbMImDd/HJq4UsDg0lDuUaHHVcSwP JfTzOrpFe4Wh38veE3RByw/V+lCV/bCjTZIvsGRn80j72VhA0Rbul7afO8a8bdsgpRqD uhmgLuTRrhGNW6rM6lDkCDymoq/no7/P/NWKqoYlxEAG9PYz8YC5rhaAYJwSJRejqWl4 F89Q== 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=F3vJJIP2UYP7HB6eo2aBugvpXzlyrF8Xo1hxIR8WuNc=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=hx7u7OYKXq+DoVfo5Dsg9cg5pSkA7EVwltNwZyk+LbZ+RJlcTHDWOLTwkNhpCgmefx a47T2e0iLWZdLojEJmbWNMUiis6UYaCVz6Ds7FPasqoLmoW3L58mzDMapjp6lTFb53Jn rsCy18liPQ2j2f7B1JNwsxxEc4mZnz3bY/4eSanMHTfSRwEsa0iff+QstoVOOWmZJrHm oHAwgf21+09mZjVPvfIFqugd/3/ydfplZ7inia9+htgPNQy0NJDjGHW7FRkNEt3jsncP 9FRw5rOSyYAcGyGjyFxTPeObXbeGDKgmhqRBwXiAB1MH6Swy+ekFQjZ/rLibC4yJRvxx pkmA== 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 r18-20020a632b12000000b0056c3ee09b75si8398886pgr.563.2023.09.18.13.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:06:18 -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 8A0BB81B93E8; Mon, 18 Sep 2023 12:52:08 -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 S230012AbjIRTwG (ORCPT + 25 others); Mon, 18 Sep 2023 15:52:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbjIRTvm (ORCPT ); Mon, 18 Sep 2023 15:51:42 -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 2AB78132 for ; 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 ) id 1qiKH9-0003kt-5G; 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 ) id 1qiKH8-007I8j-OS; 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 ) id 1qiKH8-002mCQ-Ef; Mon, 18 Sep 2023 21:51:18 +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 07/19] net: mdio: ipq8064: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:50 +0200 Message-Id: <20230918195102.1302746-8-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=1762; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=miGmpzcVxDh0lJ0Y47z/irjCSAlu12OWqTaS3ah8Cn0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoH1VkGIYYdyqftOgEqKWtvPUrGb2Q9i1Eds h9R/LfWhc+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqBwAKCRCPgPtYfRL+ TuXOB/0Vo6HeAm9CXB3VfnLjjtTyZxnjdd3rHx/Cn54Ig6livRNGk8z11WX6xi69v2CxNR3mx+O 0Dqlk043Mj9J7wp5vEKX6eKuGmJolEEQfN9e3XyRLgsRyrRwOyfalyPATGynWpFbnsnQsPk7h2g oo0Ty51+61jlV8CytWEu0wefsJ6w51HQ/LaQ8iJZh6v48OsOkt6RJFc1K4WWH7rCT2et5ZteKRr 0eWEHy8cd6BF+8CABZLdPQJp1YKB1Tg4BbBeKIf3uz5E7Cl6fyvoGTCocePjH2/XA5Elzb1Qjdm bUDM7PM/f3v/ICEfTQC45i5jOY/VPbFfFBMohAsdhGFSCtGa 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:52:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407180698764581 X-GMAIL-MSGID: 1777407180698764581 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-ipq8064.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/mdio/mdio-ipq8064.c b/drivers/net/mdio/mdio-ipq8064.c index fd9716960106..f71b6e1c66e4 100644 --- a/drivers/net/mdio/mdio-ipq8064.c +++ b/drivers/net/mdio/mdio-ipq8064.c @@ -147,14 +147,11 @@ ipq8064_mdio_probe(struct platform_device *pdev) return 0; } -static int -ipq8064_mdio_remove(struct platform_device *pdev) +static void ipq8064_mdio_remove(struct platform_device *pdev) { struct mii_bus *bus = platform_get_drvdata(pdev); mdiobus_unregister(bus); - - return 0; } static const struct of_device_id ipq8064_mdio_dt_ids[] = { @@ -165,7 +162,7 @@ MODULE_DEVICE_TABLE(of, ipq8064_mdio_dt_ids); static struct platform_driver ipq8064_mdio_driver = { .probe = ipq8064_mdio_probe, - .remove = ipq8064_mdio_remove, + .remove_new = ipq8064_mdio_remove, .driver = { .name = "ipq8064-mdio", .of_match_table = ipq8064_mdio_dt_ids, From patchwork Mon Sep 18 19:50:51 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: 141541 Return-Path: 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 + 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 ); 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 ; 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 ) 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 ) 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 ) id 1qiKH8-002mCU-ML; Mon, 18 Sep 2023 21:51:18 +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 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 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 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:53:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406487693771750 X-GMAIL-MSGID: 1777406487693771750 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-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, From patchwork Mon Sep 18 19:50:52 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: 141538 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2914545vqi; Mon, 18 Sep 2023 12:54:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErn4t0bD87eT+K3CmvQ42rXBSdwKmdwpShonEs4W+MpgsVBFIwMKGJrkb7WO4ETVPkY3PM X-Received: by 2002:a17:90a:d18c:b0:273:e090:6096 with SMTP id fu12-20020a17090ad18c00b00273e0906096mr667097pjb.11.1695066887807; 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=XVXyhUXQaA+U1rQCwsTOclZ35rCdBg7uBva3NI4CcJU2A7Ln2fm+TPpwOLVG3PyPpu bLpJjTwBbUhVuxX7Oaofb30ysSD1YwGsCVj7IEDwaMitp/bnDeQtudX7w8/wGMK6Q/yN gKZjk9W/5QDv+ysV6fyaexgycMzFXz7fRexNMrJVMLnggzgV3z2zaRIGMJ+bY79Usa+A ZE8VU2Zg0dlHdgMkJ71hddqE+4oic9/iz0Vqksp3df1DgF5jG7u/4V0fG+7uyeyKMxhL zrSzW36oSa00g4hMADloLaw7XNBt3dhD/ZFhLOJUk7blMKJo7sn8omKKT5SkRVKj1FoF KOwA== 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=O9Nv2m3SWZ65AGRWaX2RZ2mlbD0UQSb99pt5xE4dnUc=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=fmz/RsYTfFhhO2hySleBP1GufHumpQQYHQFtEeq4kHNy4yfoUDUR6+Y5RltQ1H2eLV /6no0mty9nhV8BTJdr+F6q+BQ+OduKl0VZCren4nJ2Cm6Y5rugLJ0Yr3TxBHIMTWgp3L 310T/qVmQuLwwFc2bGf3cOgn9ZfrstW4XVboiMY0C1GQmKgIxGGSfCocUn0tURgT9fMQ z2TKkDOBQSroTSF1o5Rc1tMbZhayNXcpThR/hUQ6b5BYwLgQNMNbGqwjF9iJcgXnN24S L3LUEkF9sKbQ7v9Y6JUcYX83ihjrHFP0XioU2ibJCTv0tBk5wG+QpXj9eclSdl9SSUKu ovig== 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 i20-20020a17090a7e1400b0026b74f6aaa8si10413489pjl.63.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 7833E810AF7E; 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 S229627AbjIRTvm (ORCPT + 25 others); Mon, 18 Sep 2023 15:51:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjIRTvf (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 6CC76109 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 1qiKH9-0003lJ-LJ; 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 ) id 1qiKH9-007I8t-7G; 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 1qiKH8-002mCY-U9; Mon, 18 Sep 2023 21:51:18 +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 09/19] net: mdio: mscc-miim: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:52 +0200 Message-Id: <20230918195102.1302746-10-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=1832; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=041TtYXxE7dnRKGf01E0nKWqzpFWJPRnpGRIyKv8VLg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoKsaAjqfD4HL51xNTtF1K7xknpVDy1TRBo5 xjWiIf1Yu2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqCgAKCRCPgPtYfRL+ Tr/KCACYwA5Axo2xV8jZiqHtAim2rPaK47qldTD4vu/bNJo/SSEIRt+qv8oUvzi6XWr+6NkEOMU KOS/v4UDnM8V0gdPCDDbwoZkyBCR66yCN0xCYMkxaHGUjSNKjyKFpj6cZgaQh390SQfbs4h0XSB aM++rseZQdmkpsdOaU2/K2Hm4U1e9u78jY5UUIiU1dLGYGYK/WTU0md8n59F9n8JHhZSftQl68J ESuSnayftPl/WAgak6cq8Aksjc+HcsToh/VPE1e07PQiA78Qi1C0TluDojxJI4n0ZSRJ363EoPT M3/K0majEtAzi8k9Vj/i/xJ21emdKJ/jnkYJpr6w+tkKLKEk 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: 1777406457141118484 X-GMAIL-MSGID: 1777406457141118484 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-mscc-miim.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c index 1a1b95ae95fa..c29377c85307 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -335,15 +335,13 @@ static int mscc_miim_probe(struct platform_device *pdev) return ret; } -static int mscc_miim_remove(struct platform_device *pdev) +static void mscc_miim_remove(struct platform_device *pdev) { struct mii_bus *bus = platform_get_drvdata(pdev); struct mscc_miim_dev *miim = bus->priv; clk_disable_unprepare(miim->clk); mdiobus_unregister(bus); - - return 0; } static const struct mscc_miim_info mscc_ocelot_miim_info = { @@ -371,7 +369,7 @@ MODULE_DEVICE_TABLE(of, mscc_miim_match); static struct platform_driver mscc_miim_driver = { .probe = mscc_miim_probe, - .remove = mscc_miim_remove, + .remove_new = mscc_miim_remove, .driver = { .name = "mscc-miim", .of_match_table = mscc_miim_match, From patchwork Mon Sep 18 19:50:53 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: 141548 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921226vqi; Mon, 18 Sep 2023 13:05:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGecgMkulx6F5uVDUlemfXEIJbpmOXPT9podPuakUkr/wA82V7veJA660tCgz+G1tmftFW9 X-Received: by 2002:a17:90a:c4f:b0:267:70a8:abff with SMTP id u15-20020a17090a0c4f00b0026770a8abffmr8532510pje.29.1695067548627; Mon, 18 Sep 2023 13:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067548; cv=none; d=google.com; s=arc-20160816; b=ogDDHIK0sWK6CFkb0fgc6547zRPtihoxfTfkPiOjGTChNzMw9PW5M+Tl8HLUyBtE52 EWjxoKAi3iIyoiGGlznCLQcvomMdhGjkJuIJcIrB6UfhqK/oLK1L2yomnBp5f5ZknImL x9W8cxJSCEBICtAsJ2UIhAXdA2taSIlQTFBoa/oS1O5gZ5nyQj5VEl8/jhdujwspFWMD RtW0WfbDCcO8KxdqiQBJOfwmw+tmE4cinywGIzPXti9G0Eu6uxps4HtyUJs0FY2dQxNZ P0HMDSN1HeZZgHGzhsXjVTJu8b4694gq+dX+NKpwGPK62cHvj9kwErKL0vyotnY7TVo7 gBUw== 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=oH+T2XuhA9i+z2wbZ72nF9rrswTXO71txadIKb7Df+I=; fh=3w/gWP9AjeP35Yt+9ETEM//9CZFAojrIL8kNXmM6h8U=; b=N51WiROEEle4/kEJMn3MKFuugglIjYMFmWfunUHkeb1OExvcKRyozzCf0v3XwqzEhF GVmnDIjHxkZTvL+HDUP/gtfgytxSp+qyKhcslTXRGOFoox0nZj5VnR4xjhmuhluXJ5Nu DXmaHtb5pqKRTA619xjIjPQ/g1vVQ5NbVtyUQF/OaygoA0G0TxWaQafMPC3qosKcIW9o u3wTZbKMMtQD50nyb5+gYSna7HFOrOoWwD+dOf61qDqdFzHCnxcwGJ9J2uspbB/c46UY daRFlYZYBEuJR8NCCcWISvVR2qYTtRRL5sj+uV/eQFDY3iZji8xwjvnOjpaMtuaP/Y6I UlnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n5-20020a17090a9f0500b0025bdc2a0b15si10617015pjp.135.2023.09.18.13.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:05:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 77304822CB21; Mon, 18 Sep 2023 12:52:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229985AbjIRTv6 (ORCPT + 25 others); Mon, 18 Sep 2023 15:51:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229605AbjIRTvj (ORCPT ); Mon, 18 Sep 2023 15:51:39 -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 8779E10F for ; Mon, 18 Sep 2023 12:51:33 -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 1qiKH9-0003og-Uw; 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 ) id 1qiKH9-007I8x-GU; 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-002mCc-5i; 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 , Ray Jui , Scott Branden , Broadcom internal kernel review list , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 10/19] net: mdio: mux-bcm-iproc: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:53 +0200 Message-Id: <20230918195102.1302746-11-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=1834; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=M52LgWHkFZ/4d48b6ksHEiG2E1+/CV6YxGBCzg5tYiU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoL1nUgsydk6XQA+RbH/xkc34Zk0EDvzUx2w +VD7AMY/YqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqCwAKCRCPgPtYfRL+ TiPIB/9kGsTktZ5XGR76AWUBluoKx4ggJTt+L92ib8tyoU82m553O0Ah2JdARGVnCmMaA781hN3 ro4SnJWwnRzKoxVqLiep+XhI4svyu6mXqsTjAihRf4JTdb0KKrPL2B0yemtzs330yJyiW6v7u2Y MH/z9yB/CGM3dzsMuxWMTPVnxdaJraa4cmQBLgsW6ie2LMn9Uhv7QemRA0p1g1TNHXwXhID5Utt SLfuYnqNXEiRr/dftP3gvZaaYGEeC7B+6XsGIRwouJgSDYH81cmy4HerpdYA98XuLUcmYzWdo2i 4HY3GNXxp+lrRO1E7qVdb+qk0To6Oz3EBUTEwI/T6XNlhGV5 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:52:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407149526056429 X-GMAIL-MSGID: 1777407149526056429 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 Reviewed-by: Florian Fainelli --- drivers/net/mdio/mdio-mux-bcm-iproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-mux-bcm-iproc.c b/drivers/net/mdio/mdio-mux-bcm-iproc.c index 956d54846b62..a750bd4c77a0 100644 --- a/drivers/net/mdio/mdio-mux-bcm-iproc.c +++ b/drivers/net/mdio/mdio-mux-bcm-iproc.c @@ -287,15 +287,13 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev) return rc; } -static int mdio_mux_iproc_remove(struct platform_device *pdev) +static void mdio_mux_iproc_remove(struct platform_device *pdev) { struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev); mdio_mux_uninit(md->mux_handle); mdiobus_unregister(md->mii_bus); clk_disable_unprepare(md->core_clk); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -342,7 +340,7 @@ static struct platform_driver mdiomux_iproc_driver = { .pm = &mdio_mux_iproc_pm_ops, }, .probe = mdio_mux_iproc_probe, - .remove = mdio_mux_iproc_remove, + .remove_new = mdio_mux_iproc_remove, }; module_platform_driver(mdiomux_iproc_driver); 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); From patchwork Mon Sep 18 19:50:55 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: 141553 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921513vqi; Mon, 18 Sep 2023 13:06:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGw2ZY22hJZIgnH0NjqJh+KmRLj9aZg26vzQAhtF6wxwunpTOoIyVt6qNdGs1kHtfsW4GmD X-Received: by 2002:a05:6a00:1ac6:b0:690:45cc:bd37 with SMTP id f6-20020a056a001ac600b0069045ccbd37mr10263165pfv.18.1695067573435; Mon, 18 Sep 2023 13:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067573; cv=none; d=google.com; s=arc-20160816; b=Z2/bt3sLSPWHi1CU5H03XMH5A+7WL0Qh/rbK2g5ypy8DK53AF4d1HfWPD1peb32F9w kihMwr2St+bWR/lVNECTfcvhZ8sa4kXmEGt9zR8CFH7FhMQAf8CbuV47f/f2ZF99ZxX4 EpKACoyzGUoVZQhRJ4lChWikUVlZ7L53hIWujE3LvklnzI+hCne18sS4nFok2klSjayI 3053Zs9NCsMJsVC0Mh7p9WtnSE+u324pqrXc7zaIcOyipegtptUDue/scvgVTNynvNO4 Lt+mkNbWsN0h7PbCP4CEzvvlmbwIvOjOycU1NiCuQSKXIonQ98P/66ftO0gbvYUQsNvc jGlQ== 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=uGluRPa0tx6/HQsPOnatD0dUn1jagiimi5Nyl5RyVmA=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=k3ZAhNhhu+QAXj9t66SCmrT/8VNVPBNpOJ6+HjT50qU5oArWf7rqtcB7rLsxXbEAKk qAJDHTK6otUuexpyR/Tf4gIzebtCv4dLlLTzyW5zMMInaSgLsHc7yHz3/qfLIrA3C3JH aTPFMQ+PAD/PbK8DTdn7Svz91o0pgdT8QpplaaOteBvy2rlwm89O3uSii+mQOFlNAQ0b DTQhzB3u0k8n/4Y13XStBe2bsTyakU4CXbsfYW1TfSl0tbq01ukwpJJa08ajXI9Lt9J2 uBQGDVLmbjJvbk+AiYILQGuBeap+meu7ZGIOsxJXg8IllfUsnrn/NJFMfwL1Ly4Xz29f f+/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id fb20-20020a056a002d9400b00686e01db946si8694190pfb.64.2023.09.18.13.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:06:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 52A1E81B8958; Mon, 18 Sep 2023 12:51:53 -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 S229938AbjIRTvw (ORCPT + 25 others); Mon, 18 Sep 2023 15:51:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjIRTvh (ORCPT ); Mon, 18 Sep 2023 15:51:37 -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 8DE0C109 for ; Mon, 18 Sep 2023 12:51:31 -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-0003tL-C7; 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-007I95-VJ; 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-002mCk-M5; 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 12/19] net: mdio: mux-gpio: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:55 +0200 Message-Id: <20230918195102.1302746-13-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=1760; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hQqRNV8NsCd4cBul46DdSDBZQJNVvAuFrQayXN//utY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoOwxkwQFWAkwvVquicdsXySMLhBTb7umS07 Os3/QW54DyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqDgAKCRCPgPtYfRL+ ThfrB/4gxxOgjOJ8EtCV/RM63KVb5TugxUI10+z/PiyrPUM8rYtn4wjMlFImlITihxAAhNu0sqq v2DeaR0GE/EI9Vx84zkgyLVOmYFWa+FT5VN1Fm8EkqNZFfnj/ND3NAF2zxo4R4h5ds+avN12Ts1 VGhtQ+uSTyzpOQ4Hrro7wiEk9cq+LD2ydfHoCmBbNtylbx7DoZi30X5eEMIfuwL29JCZlVRwBD0 Cwz5EQpmQLAESKhhJHBdrpwHxKyNX9iCfYTth12y5vBBiLwis/D0wBMeBm+d1RhYQlq0InXJVNH n1t0SC9Ph1DGBstl0aBnKOmlYS4zV7SmxKsrvNyWnwGkDDVU 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:53 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407176082042584 X-GMAIL-MSGID: 1777407176082042584 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-gpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/mdio/mdio-mux-gpio.c b/drivers/net/mdio/mdio-mux-gpio.c index 3c7f16f06b45..38fb031f8979 100644 --- a/drivers/net/mdio/mdio-mux-gpio.c +++ b/drivers/net/mdio/mdio-mux-gpio.c @@ -62,11 +62,10 @@ static int mdio_mux_gpio_probe(struct platform_device *pdev) return 0; } -static int mdio_mux_gpio_remove(struct platform_device *pdev) +static void mdio_mux_gpio_remove(struct platform_device *pdev) { struct mdio_mux_gpio_state *s = dev_get_platdata(&pdev->dev); mdio_mux_uninit(s->mux_handle); - return 0; } static const struct of_device_id mdio_mux_gpio_match[] = { @@ -87,7 +86,7 @@ static struct platform_driver mdio_mux_gpio_driver = { .of_match_table = mdio_mux_gpio_match, }, .probe = mdio_mux_gpio_probe, - .remove = mdio_mux_gpio_remove, + .remove_new = mdio_mux_gpio_remove, }; module_platform_driver(mdio_mux_gpio_driver); From patchwork Mon Sep 18 19:50:56 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: 141557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921641vqi; Mon, 18 Sep 2023 13:06:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHyf4gh01Noksx+CMD5UOOYhL1mtHoiNksOwytvPxIrfGBuztIjixt7f4EY73359VxtmX4 X-Received: by 2002:a05:6a00:f8c:b0:68f:c8b4:1a2b with SMTP id ct12-20020a056a000f8c00b0068fc8b41a2bmr662589pfb.17.1695067585154; Mon, 18 Sep 2023 13:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067585; cv=none; d=google.com; s=arc-20160816; b=tzBuZOZnDdHnF/Bd3vv14vJPv3MRjpCbtqFb6rjdukUYpWpVMamzLqTBx0BQzdBTPi 4eS+TBPxxBSBNTJr+ZWXQUS1bLsqdcwraWw2cQgz8RJ3HyIgONaqYAux8IdFI245HIqU VA4ROs8/CP84DX2nWFVTseE7TTTGAbSaPZ+rfs30pAsfzPYCWw7RUq9O/bHquoaKU3Vq sIAxbGNhWuk/xv1EH+qEoQjEJ6Z1l6z0YL2Jv1u47jj95uRFOF/Nk0NMtKXqXKpLyJoG S1zZcQL5VQD9Yh4ByJoCvygh1KMSBaAI9QCL+DzgVqrBTnOX7331wqJqV2acR/3LAY2z 793w== 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=oc7VWdjZZ8VtCXZ6zMkkgmt7ZXvt1QDQz+GRP+EyO0g=; fh=UZ329nBpra7mB1BIR8jRJO4AMyEYTgxkzvDNxCZOPhs=; b=IdMr+ml6MuihtgZGf2ZFH6KBHY9R8/B5K/5x7weBTssb1NU/I7q1tggslKXmnSzn7R 5rHr/qdRi5MROmDHrpcHijc1OgNVj1JrbP5EWmF5ydWcZ1YK2OTv+LagC5z7T5MSZFEW TVqSZKy0uHn/jwt3dK9E5BVTqOpUZipKinMl14hH4U4YRpuS5R4Q8v6utkGg2LbQrwd7 eyj/KrTtLBwLk1oCEHWDkMms9kZR3UeAF18nwNTSvrN6+bQnP2VHjr71ScsujJhqUzSK 9qEnVOCWHsYHnAHWE+mw4tHRGUXlKbmPdDm4K6NReiswIrcfrWwNj7z4ruAO/mTo8d1/ T2BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cv10-20020a056a0044ca00b0068e3d277ffdsi8489539pfb.187.2023.09.18.13.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:06:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 72FD281B93D5; Mon, 18 Sep 2023 12:52:04 -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 S229969AbjIRTvz (ORCPT + 25 others); Mon, 18 Sep 2023 15:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjIRTvh (ORCPT ); Mon, 18 Sep 2023 15:51:37 -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 4B834118 for ; Mon, 18 Sep 2023 12:51:32 -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-0003tb-JB; 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 1qiKHA-007I99-5V; 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 1qiKH9-002mCo-SC; 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 , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 13/19] net: mdio: mux-meson-g12a: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:56 +0200 Message-Id: <20230918195102.1302746-14-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=1826; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=EzJFBBjWak83XqZfwXAmsPeATMXEasxL4vEIaynihO4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoPKfUwDQDhH8du0OvFGHGy/cy/8NHJo8l/V BExs0+U2kmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqDwAKCRCPgPtYfRL+ TnypCACUDyS5DHFzFzNuBt/1GnxBHxRj+FItq3pn9j1bAuTt0BtINBnJ2FVOxKZ+HWIeM5lgJXy G1MK3iGEBVHvLVu6TLS8UpA8aJ5rUdfFO3KyFKmViyoLkQpusyo4wqA9wj0QSdZ5wk/jDXrHivX cgIYGngVkHSzlzeMTA8nJNmdcDDQHc4g5iJ9fzVmJODorwn06JAs7ttSAbkRsqQU6kGicXkCcLU dN5nz/WyYw8xn3PgbaN9bGDo1kfVAwTDN3Tm6VW5zVS4ief9o7IcZ+66f5i9W5oxUIjQoC5Z+tJ Jk5GHCetMEO5hxLCA1MdOapxlaZcEa7htdOFyd+X5q7ze+ZL 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:52:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407188324708032 X-GMAIL-MSGID: 1777407188324708032 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-meson-g12a.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-mux-meson-g12a.c b/drivers/net/mdio/mdio-mux-meson-g12a.c index 910e5cf74e89..754b0f2cf15b 100644 --- a/drivers/net/mdio/mdio-mux-meson-g12a.c +++ b/drivers/net/mdio/mdio-mux-meson-g12a.c @@ -336,7 +336,7 @@ static int g12a_mdio_mux_probe(struct platform_device *pdev) return ret; } -static int g12a_mdio_mux_remove(struct platform_device *pdev) +static void g12a_mdio_mux_remove(struct platform_device *pdev) { struct g12a_mdio_mux *priv = platform_get_drvdata(pdev); @@ -344,13 +344,11 @@ static int g12a_mdio_mux_remove(struct platform_device *pdev) if (__clk_is_enabled(priv->pll)) clk_disable_unprepare(priv->pll); - - return 0; } static struct platform_driver g12a_mdio_mux_driver = { .probe = g12a_mdio_mux_probe, - .remove = g12a_mdio_mux_remove, + .remove_new = g12a_mdio_mux_remove, .driver = { .name = "g12a-mdio_mux", .of_match_table = g12a_mdio_mux_match, From patchwork Mon Sep 18 19:50:57 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: 141551 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921366vqi; Mon, 18 Sep 2023 13:06:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBWNp92kSjwot8g+Ph5j+NxFeX8Gy/iVeLFE3gkld7EnyLSQGrDimBDQ+Y3Rf7VF/dvjRA X-Received: by 2002:a05:6a20:6a20:b0:15a:290:d82e with SMTP id p32-20020a056a206a2000b0015a0290d82emr10198362pzk.52.1695067562831; Mon, 18 Sep 2023 13:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067562; cv=none; d=google.com; s=arc-20160816; b=GZs5kfGbvzj3rXSHsMY5jlWTMFog1T9x+2HRKzwMglu/txhN1smnejvb5hBTSdU7Q1 5QjFPaAEDE7+YboqlNAUs9lAEG3VDCOAQP9qYMD0vy5lcGFp4+dedZQ/bjN2taBOpfZK 8/JyiA+DjnizM2JHNmzYKGndjkQ+sGVsWU5wCoUPzWipgNAaORuRhFnVYklTuh8FqPhu AYeWEziP70V2rwVHcaGuAJqzNV7mu7Ic10TTNVn+0jK77yAupaD6+68AH3tWnpbrbQyq 29o8o8ccC7DZ+98iq/FixozJY0WoLZomhh8g0YMM4NP9s+cudooYst+9q14iDTuzWJo6 wJ5g== 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=wNkMJD99lJjQKE2I9bS6rLHFKf79xzcZiBt9HjQq5V0=; fh=UZ329nBpra7mB1BIR8jRJO4AMyEYTgxkzvDNxCZOPhs=; b=msQV2ydmygdprV2KCWs9wLBr4lvqVXO5qu5xp4jjBPQogAb2psmmBXnWPF4OxIdPIa P+7w0ZOCdw9Hd/4KT95JOY7+/p6CNqXW4cYrxyrhX2KXVm9s4L8uvguKlJFTqHHWKSaj 8ovdBFQocgbAdyBB8gNVh8yQh1UnAT7MQWX8xLWtmSsUQiJVnnS6HAKPqszhbEUCnQA7 1XK2DDQ1ziNXDYicSH9tfhlHUYP1pSKDmmKKQ937J+zYB+3BCNUaRDN8vtHm7n+vXkKc lk9IbU4sk/LsdOsXXk0mMDEqeL1Ytb1bJ6fOnBE8KnYlpXgyuoAfjvNcGEM4LGciPV32 f/IA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bs123-20020a632881000000b0057408ac52aasi6524923pgb.381.2023.09.18.13.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:06:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 4170982429A6; Mon, 18 Sep 2023 12:52:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjIRTwi (ORCPT + 25 others); Mon, 18 Sep 2023 15:52:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230017AbjIRTwI (ORCPT ); Mon, 18 Sep 2023 15:52:08 -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 A1E63129 for ; Mon, 18 Sep 2023 12:51:43 -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-0003tk-RZ; 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 1qiKHA-007I9E-DA; 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-002mCs-3W; 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 , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 14/19] net: mdio: mux-meson-gxl: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:57 +0200 Message-Id: <20230918195102.1302746-15-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=1689; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ozIWasGq3N/xU1iR0Yrnd+TYz54kh5bAZ+sTOn8pRXI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoQ0fJ6ojipVcTwNWKvfLBM8FcQpdBBlYn/S vCT+JOQEtKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqEAAKCRCPgPtYfRL+ TtTSB/4sCglF6vJ5Wp7MSvPiGxMQhwl9gEoGl7FOl2982E1bRen7y+6KM/7EvTSNNCmEUf8rTVE DLjZQnsVNHbz2YtuZ2viSjO/tzDgeMJVIheCkEw9WezNtIkYXMQNCUYt17CX7ph9FvrGDESDLw3 q+QcajXEZ89FjJQt3ZLVSaTl6hzIf4PQC7EbMEbWSp/dat9pN0quna3kzgSmCpW/7CfkH2kxlfy lHtIvEny8INNFJl8GS0dO2UOB1Bm4KKEFtukCYlRl/zPiCgnGaJZ6ikAFqGBhZ+GyIsKb0xL79S W219IQo4hv5EZnfLdrexM/ZuCPg5BvDEG6xeHndx1O/5Qw5K 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:52:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407164718382585 X-GMAIL-MSGID: 1777407164718382585 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-meson-gxl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-mux-meson-gxl.c b/drivers/net/mdio/mdio-mux-meson-gxl.c index 76188575ca1f..89554021b5cc 100644 --- a/drivers/net/mdio/mdio-mux-meson-gxl.c +++ b/drivers/net/mdio/mdio-mux-meson-gxl.c @@ -140,18 +140,16 @@ static int gxl_mdio_mux_probe(struct platform_device *pdev) return ret; } -static int gxl_mdio_mux_remove(struct platform_device *pdev) +static void gxl_mdio_mux_remove(struct platform_device *pdev) { struct gxl_mdio_mux *priv = platform_get_drvdata(pdev); mdio_mux_uninit(priv->mux_handle); - - return 0; } static struct platform_driver gxl_mdio_mux_driver = { .probe = gxl_mdio_mux_probe, - .remove = gxl_mdio_mux_remove, + .remove_new = gxl_mdio_mux_remove, .driver = { .name = "gxl-mdio-mux", .of_match_table = gxl_mdio_mux_match, From patchwork Mon Sep 18 19:50:58 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: 141549 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2921281vqi; Mon, 18 Sep 2023 13:05:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF91bDR+svtReSlGjOuf4Gu5WfNH4Yh6WTGuVK6SuYVjcu1owZyLclid4TH/hWzw/lKZxpL X-Received: by 2002:a17:90b:1490:b0:274:98c4:b6e7 with SMTP id js16-20020a17090b149000b0027498c4b6e7mr7210662pjb.24.1695067554737; Mon, 18 Sep 2023 13:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067554; cv=none; d=google.com; s=arc-20160816; b=TB1oZm14HsqYncsWmdywmjSMXZpr+O2r4gq22ATj6usrCDucekPR/eT6Io5GvOhdJ6 0vd14lIywWoppGvbQ+5NPeSIGy6J6qRdZ2JSDSQC/hBadk8bp3rzw4X3soumgE50rINp XCE1yHJx+3pIwxiRjJaQdNpcPc24eQyIZzRfmN/EpiqFNogCxJnWB5G+oFsBPh6lFzix PX4UtZkX8wdIksmHkUGkwO4KzQWlq/8jdgURR/6vYCBmAJNeEGxRpSAvkAwJMdRGNToY 3+Dr1KTqP3Ij5wtaiU2SRfKOsmdGwSyUoNaMJ80gtIOlWriXLtk4YI5asWeYBg+Lv/nc FF0w== 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=KzAmwwfh4A7XqlKT+KK7a3VCpZU9n/VGHgt7olvHTdc=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=iXcC4pHSslEUD/mU5206IqUO+kuUSl0+BZdv/x3GsCrR3UC83uzeycdOGSRAKbXbdk YQMiFNJViUns2F2LZYOv4dcl/0fGDQnSXXiel1/KlyxTaCHKDaG+5z1gtaEv8veU4OWD Dkk4Iy3R2vwEZxivVMKSQuXz027g6kTwTJFqFUM+neV3Ht8gskMngL6Ekgvzz3DiOi+o HAs5Wino3cskIbW7Nj253kSu98XMb7LlS59RHrsd1+kOUEKZfn0OR1VJnzFbBekm330S vqwE4pqLulv9zdr5dGCnndJl/aUGnghwJrkCTSlUJ9N5ZDPTuRbpb6N0Y4qsjdwuJdcg 1eKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id n16-20020a17090ade9000b0026b208f7b8csi10625998pjv.89.2023.09.18.13.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:05:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 5870881BA652; Mon, 18 Sep 2023 12:52:34 -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 S230075AbjIRTwQ (ORCPT + 25 others); Mon, 18 Sep 2023 15:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbjIRTvn (ORCPT ); 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 747E6138 for ; 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 ) id 1qiKHB-0003tq-30; 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-007I9I-KW; 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-002mCw-B6; 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 15/19] net: mdio: mux-mmioreg: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:50:58 +0200 Message-Id: <20230918195102.1302746-16-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=1819; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=h77ZoxiZILJ2uftNiEK49Y/i2dgAg9dOqTvmcC7eB20=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoRGsMzHv7bGXYkSmLQKpNxzSN8UoMzYZeCj OBrHu6dHmWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqEQAKCRCPgPtYfRL+ TuY+B/4llkrJrV/Nref3OzOaBFdS31P40gXJUMnIjaw+WQYSbPcIYmJswUGisfpQM/BndF/MHFE XlhPSl/mCv3r1iwssmEofBO3ZdlrtV5PcobhkAWp2k+0yMChTk9OPMOf+UaBHRpxhLS7x1H9nic HYFEbgD+ZBN//1kJy3FMoI5p0mQZhLz0y7/3d53rtPnv9SyOCr8+n6KzOTMmd2qfmlgBkHnD1eL kgETkh44aqw4YbOwGDdazQW8upR/yF8ivcdQW4M7Om/Po2+9gH3idNG1F/oE2ps/hQ1X7oZ47zs CZAxfJ3RrM/TY6rcc1mbfKP0NLKYQ+pK5y0Dm2tq/1Yrdm7Q 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:52:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777407156081877769 X-GMAIL-MSGID: 1777407156081877769 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-mmioreg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-mux-mmioreg.c b/drivers/net/mdio/mdio-mux-mmioreg.c index 09af150ed774..de08419d0c98 100644 --- a/drivers/net/mdio/mdio-mux-mmioreg.c +++ b/drivers/net/mdio/mdio-mux-mmioreg.c @@ -169,13 +169,11 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev) return 0; } -static int mdio_mux_mmioreg_remove(struct platform_device *pdev) +static void mdio_mux_mmioreg_remove(struct platform_device *pdev) { struct mdio_mux_mmioreg_state *s = dev_get_platdata(&pdev->dev); mdio_mux_uninit(s->mux_handle); - - return 0; } static const struct of_device_id mdio_mux_mmioreg_match[] = { @@ -192,7 +190,7 @@ static struct platform_driver mdio_mux_mmioreg_driver = { .of_match_table = mdio_mux_mmioreg_match, }, .probe = mdio_mux_mmioreg_probe, - .remove = mdio_mux_mmioreg_remove, + .remove_new = mdio_mux_mmioreg_remove, }; module_platform_driver(mdio_mux_mmioreg_driver); 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); From patchwork Mon Sep 18 19:51:00 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: 141540 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2914745vqi; Mon, 18 Sep 2023 12:55:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGT4h/uOreuwahWqByEKl/ZZa97zReAwvcDXMrLah5RiwPfpFYLicbL+L913HMzjv5wzFz7 X-Received: by 2002:a17:902:d491:b0:1c3:e3b1:98df with SMTP id c17-20020a170902d49100b001c3e3b198dfmr10807508plg.52.1695066916525; 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=SbxGu/nq3/HszcKCWC7+hr6m/Zq7tglOnHmdRYMg1O3hGO2Fl+iYgRjvzcc188mTKZ 82afiYnRscj3ZghdrW0oSoHD/V9QGG8azVu23+uR+7Qq/M3EOGu0/g7OOSW6yk+dG0zN ETbF+1/9tx8XosKy/JFI0TLNLCSMwLnGPylvFvK+S/rdxM5EtCUzQqXk+snDO+xIjDPc xfUAvfCOzMCSySKsyf9UPwD7kwkDwE2j3t4zUf54qua9yi06O3BYbau4V0MhPoR8S0TT HMhkEZbpPUp9H+vbBNQCvGRqfj3YJqGkSCmprIMyGmjWDeVytBSWMR4qzUOMGJDa2HpT 7/qg== 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=WuN3B9R15Q3Zd/nIo5fJNG+ufWo57N3aUad0JKt9D3M=; fh=2LoUldgIftbCGGYNlIKiEffIWCdRcQL9EB8MUfMGcWk=; b=Wt9E2y71mf5QHgAtwM7oCRZjfKrOsGXONnCYFp4a1V7txSPIkodTtedlZYx3gPITiR xKs4KP19uJL8AUtsb93LoYAXoPzP4/6ptYuCx3ET7XGVir11kVgAB//OINGSoMFYEbRa OMIDRg2aJGLnX3u+gsX46teDZ5Gaz79nHNcQ5f/zG1rs9gAxFN8MKctBSgnBkWMf+SR3 WkeHThCdgesVzp5hzYQj+KyIRmC/KgT8lBJjBOcj3EsUjtYA3YE/eKxwVWXGUE6rGBDt MNXoM9ENMr/9NULaTyy7vV/cha+LAoA3HwPFVvgv+Sd5FDZpRKVoXYKCo9TOnzhmVMjG dKWw== 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 m18-20020a170902db1200b001c474ff2fdesi3298856plx.378.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 C17D2823578D; Mon, 18 Sep 2023 12:53:18 -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 S229904AbjIRTwN (ORCPT + 25 others); Mon, 18 Sep 2023 15:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbjIRTvn (ORCPT ); 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 89E0613A for ; 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 ) id 1qiKHB-0003uR-K7; 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 1qiKHB-007I9Q-38; Mon, 18 Sep 2023 21:51:21 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiKHA-002mD4-Pk; 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 17/19] net: mdio: octeon: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:51:00 +0200 Message-Id: <20230918195102.1302746-18-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=1922; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=JgSJpI+VgVasj2hx9BfwfaykoqbFS61hnmgshTkmMks=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoTbUB4KBW9aATzEPLdw6uEFKPaCItJVlsBH o736L7smEWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqEwAKCRCPgPtYfRL+ ToxUCACIr1RfOW1GF5asJluuxSIZo6fSkOMkZ3BXImWLOugohvvLL33TVjHornpg87S3BXmJf/e sbn51ri7AsGXTVCZHlaXIWm+cDeTOTAztOQpYQ+P7G480pbnehIJn9B2dUpoOvhoW8lcChX3GsY 7SjpY19IK0rSNlou3Qq8vhPB2pR/CgPWEdm5Zt25BEQF9S6a3L/Z050S41TPcyR2GV+FAF31jbC 2zIaPsZ534nbQcz/M3niwn7OeEmkuR1avl4IJWi2RW+mgtoYqJGK2zy0EbKcTijAmkvLF/0ThFf a6kf9+TrzLUS92Fc0/FX8qIZS+QVXQBCupb9JDto/aAb4Je9 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:53:18 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406487067812155 X-GMAIL-MSGID: 1777406487067812155 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-octeon.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/mdio/mdio-octeon.c b/drivers/net/mdio/mdio-octeon.c index 7c65c547d377..037a38cfed56 100644 --- a/drivers/net/mdio/mdio-octeon.c +++ b/drivers/net/mdio/mdio-octeon.c @@ -78,7 +78,7 @@ static int octeon_mdiobus_probe(struct platform_device *pdev) return err; } -static int octeon_mdiobus_remove(struct platform_device *pdev) +static void octeon_mdiobus_remove(struct platform_device *pdev) { struct cavium_mdiobus *bus; union cvmx_smix_en smi_en; @@ -88,7 +88,6 @@ static int octeon_mdiobus_remove(struct platform_device *pdev) mdiobus_unregister(bus->mii_bus); smi_en.u64 = 0; oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); - return 0; } static const struct of_device_id octeon_mdiobus_match[] = { @@ -105,7 +104,7 @@ static struct platform_driver octeon_mdiobus_driver = { .of_match_table = octeon_mdiobus_match, }, .probe = octeon_mdiobus_probe, - .remove = octeon_mdiobus_remove, + .remove_new = octeon_mdiobus_remove, }; module_platform_driver(octeon_mdiobus_driver); From patchwork Mon Sep 18 19:51:01 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: 141539 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2914747vqi; Mon, 18 Sep 2023 12:55:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE27mwF+EUqPEBGMvbFj1nGX4NKP1DTj8089Y0LTsw3RTMg2643LBl7t7fYSUTyeCJM5kxF X-Received: by 2002:a17:902:d502:b0:1b8:9461:6729 with SMTP id b2-20020a170902d50200b001b894616729mr12410828plg.2.1695066916591; 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=L0iaqpZ8hgnx8cEqPxvZpwCZ+sizsoeZqd555USHcgY6oib89y9XVuo2bePQndbBV4 wi5qggmuxlWcf2/H8KNvo26kjVBfTtb75uVDdiU6UOB0pdp0M1IOXS3hLFpEZKBc2qbo 4Bn/bZ24ebCig3FdK6giQNbeS/rQUFjem4L5xWDAPOlgIduo4CNdi1/JTcRNK8pMkVKI HfpJCpqcSH0qWwhWujdvoi72AxLQtpTmW2lt29GTu4z/TxLC2CLuB17R7e15uslyYbWn 7XLD32gozKDLLUoq3JEuY/jlvCPy+VOA5D5ySsBzdGl/he6L5m4ou5YG0QMmehwBQHy0 UpGg== 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=Qoo4GjIfxFizF4Acdd2tgkaJOBuWclv9s4iCoL4OTCA=; fh=uhD2ZwP4J/lkNxEaKJ7WTxhHoU4lPeCgYDr3A5EXueU=; b=HFdc6GN2FZbYjs+L4bjpplWLOlFluu01MBPaa72bJxa9PDJAzntav4F+e811w8tIzv TBcjuaIqWuLGbAGWm4zXUPFxZ0UYf2UpObKOg3+ALbfXNZVAD3GESfrZKSDzRIl9QMKt 7opWAMh2spsc0UYrxR4TcKsp2iNJOiMtvHAtnF779OwBxyW3aamQm5p35RJGoDJwSkBK KdKlO9Hry+qVCGPgV2rhLBcVZY4LE+OS9HFU868Yf90saIpcWx6kfX3djU1wOHyZiFsG p9lPFn9fupty9yCnYaNLyemY/tDM5ss3QQhqVdH75VuSHrkSyV19/s4i4ljGjdgl9XdB 2AdQ== 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 j14-20020a170902da8e00b001b82da85c5asi8947863plx.336.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 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 DE62582357BA; Mon, 18 Sep 2023 12:53:18 -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 S230099AbjIRTwX (ORCPT + 25 others); Mon, 18 Sep 2023 15:52:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229826AbjIRTvq (ORCPT ); Mon, 18 Sep 2023 15:51:46 -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 DC48E10F for ; Mon, 18 Sep 2023 12:51:37 -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-0003ud-PW; 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 1qiKHB-007I9U-BF; Mon, 18 Sep 2023 21:51:21 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiKHB-002mD8-1H; Mon, 18 Sep 2023 21:51:21 +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 , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH net-next 18/19] net: mdio: sun4i: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:51:01 +0200 Message-Id: <20230918195102.1302746-19-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=1918; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=DxgwDrTNtar3WQDWuF/eoiYnPZavw7pBqQg5E7ipNvg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoU61GepEzgl+fGpmUa34PTQOtixU0+QHOcm 4RqWewvs0WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqFAAKCRCPgPtYfRL+ TrSZB/4wwL0kIdl7KHlEmjF6EEGnJoKJ6GOEo1Or9142qoGDYE2jjd8cDTaknANzPfclJq3fJsc kKf9b4p2e5kb7Ru5ZgUE/cdHUbOZeQ6DT4l1v1EF3dYYtXBT6dcdUq665sgBMlV11ksHgwLfz1h HD8IsSThQdEnU9nSi8JbV5bNkO8IhSUG29Me9MlT333FTcJe+JtXruLy/sLz3ViCvnEmK9oig0Y XBFUebRgRfPT9/g8r90hTMo2wFe60lOQHFM7ffNXzqM2OKjMihiwLB4DX2qcrJBteXCfus2q765 V6V5RlO2yD2JstOsFYak2nMlyX4KuC+n7mAfK7E2M2IYRwHX 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:53:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406487308048545 X-GMAIL-MSGID: 1777406487308048545 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 Acked-by: Jernej Skrabec --- drivers/net/mdio/mdio-sun4i.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-sun4i.c b/drivers/net/mdio/mdio-sun4i.c index f798de3276dc..4511bcc73b36 100644 --- a/drivers/net/mdio/mdio-sun4i.c +++ b/drivers/net/mdio/mdio-sun4i.c @@ -142,7 +142,7 @@ static int sun4i_mdio_probe(struct platform_device *pdev) return ret; } -static int sun4i_mdio_remove(struct platform_device *pdev) +static void sun4i_mdio_remove(struct platform_device *pdev) { struct mii_bus *bus = platform_get_drvdata(pdev); struct sun4i_mdio_data *data = bus->priv; @@ -151,8 +151,6 @@ static int sun4i_mdio_remove(struct platform_device *pdev) if (data->regulator) regulator_disable(data->regulator); mdiobus_free(bus); - - return 0; } static const struct of_device_id sun4i_mdio_dt_ids[] = { @@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(of, sun4i_mdio_dt_ids); static struct platform_driver sun4i_mdio_driver = { .probe = sun4i_mdio_probe, - .remove = sun4i_mdio_remove, + .remove_new = sun4i_mdio_remove, .driver = { .name = "sun4i-mdio", .of_match_table = sun4i_mdio_dt_ids, From patchwork Mon Sep 18 19:51:02 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: 141544 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2916086vqi; Mon, 18 Sep 2023 12:58:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFllna/p3pUyXRVztSvRbX6HapakRQEawmBMGMWV4CW4HNtr7KlZDeUWDMcGXWtVzbLcvPX X-Received: by 2002:a17:902:d4d0:b0:1bb:9c45:130f with SMTP id o16-20020a170902d4d000b001bb9c45130fmr11941395plg.69.1695067097508; Mon, 18 Sep 2023 12:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067097; cv=none; d=google.com; s=arc-20160816; b=NNKTihHOwYPhtphxA9oRSk885dreOTKmfVZaOSOnxi8dOY3OHHWFH/oZmhrriZ7vd5 4WgI6ZauvDS9ohzAxLkjosXSISsQ+bZ6iFVZ1qbTxh2Ds1YJWzIg91m4kpl+JpcrBsJe 7brSgKazydQMgVuLxaVIWLUx+r5vC5INTIkMbYG/pHQ4HUTMgIaaGPScuxr/1utOlemG TR59L/U+XNLR4prfAMxCCVY8ojOt+r0yOzgbysVffetsCf6JbXcrR73RaD3JZnZMeea4 +slP1KrVmC8gkXx6BSdowoI4F0ZQtNMmXxOH9gYx3ajjkH70rnC5MAWPHRw469Hk9Sz/ JCUQ== 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=+wmlsC8cQQnUD+IQPsTuDlloyQg89J9HIZGpjDSA+Uc=; fh=Mpq8JQcdAeUDY+nJx2fwp08sYbwq0jpH6D3eLSAGGIQ=; b=f8ZbjIN75gFubo/+f9ghjRgOi9uW9ayIdcRm/b1MMHLqNgbkU1tdgONUZIKjJF/Sga VyIHgmjIPEa2H9wujPw7MQU0yo12tCi7mkn+yyNJQUeKhZyKhi6WXCIwFVbMDuNFI8e/ Lewz9TvDP1RhC85lY/vkkwWans6Tgfdl7GNV6CWWtJDMJ7pWG383r01QyZAFvho06pqj +eWG+kcDtoR5x2W0SO8F1a2Hb9/UWPg5HfcBJ8oRgD9jS6HG3KqJ9MdUnRhoB0OLHnNL ZtIFGyh0CRzdBlXrH/9QJGIVqgbBMO69HDNndAb15u9pNHNmstR8wsjhOBL79uZzkcvf 20xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u11-20020a170902e80b00b001bdc9c55295si9064703plg.593.2023.09.18.12.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:58:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 0B7D0803EE25; Mon, 18 Sep 2023 12:53:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230114AbjIRTwZ (ORCPT + 25 others); Mon, 18 Sep 2023 15:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229881AbjIRTvt (ORCPT ); Mon, 18 Sep 2023 15:51:49 -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 21CB4197 for ; Mon, 18 Sep 2023 12:51:41 -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 1qiKHC-0003v0-1P; Mon, 18 Sep 2023 21:51:22 +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 1qiKHB-007I9Y-Hh; Mon, 18 Sep 2023 21:51:21 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiKHB-002mDB-7z; Mon, 18 Sep 2023 21:51:21 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrew Lunn , Heiner Kallweit Cc: Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 19/19] net: mdio: xgene: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 21:51:02 +0200 Message-Id: <20230918195102.1302746-20-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=1888; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+lRpMpTPOqtxkBsIhgMJZMmhqpybzGn51IpnndXHe20=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCKoVxIes308o6YqvuoA1oRizRNhw4eywBhr9t iUjxlYbnGaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQiqFQAKCRCPgPtYfRL+ TmxCB/4/Kgd4hHK5avDIvbMAescmiI8fyE6w2FIEs0ibcV7oQkt20IzJE0kJVpEr6iarQJ0MhDM FXMPcHgHiqhnkz/JvfVz8xVGfy1PMyCv69MMZrD5g62mbrfIQKjx10WtjEh+AA6SQgYvSd4LnZj 1SZ0cWAs3nLYYxzlleFvhT1ulbRemLTAyQZYXTX9sfyM/r9iGYCwnok69zoJ1cOw8enpQexgKjV uxqdu+65O5XnO7BAqkpPeEEG5wcI4USfDPJx7cRmdKYZjCYr77tcfyXdlw5qh8p3YeK7oqqlX5E rTqWpH7erqc4dcDwSMxpEkUflHlA6Y2V4n/OJ8OkJS/AY+8J 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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:53:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777406676720005531 X-GMAIL-MSGID: 1777406676720005531 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-xgene.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mdio/mdio-xgene.c b/drivers/net/mdio/mdio-xgene.c index 1190a793555a..7909d7caf45c 100644 --- a/drivers/net/mdio/mdio-xgene.c +++ b/drivers/net/mdio/mdio-xgene.c @@ -432,7 +432,7 @@ static int xgene_mdio_probe(struct platform_device *pdev) return ret; } -static int xgene_mdio_remove(struct platform_device *pdev) +static void xgene_mdio_remove(struct platform_device *pdev) { struct xgene_mdio_pdata *pdata = platform_get_drvdata(pdev); struct mii_bus *mdio_bus = pdata->mdio_bus; @@ -443,8 +443,6 @@ static int xgene_mdio_remove(struct platform_device *pdev) if (dev->of_node) clk_disable_unprepare(pdata->clk); - - return 0; } static struct platform_driver xgene_mdio_driver = { @@ -454,7 +452,7 @@ static struct platform_driver xgene_mdio_driver = { .acpi_match_table = ACPI_PTR(xgene_mdio_acpi_match), }, .probe = xgene_mdio_probe, - .remove = xgene_mdio_remove, + .remove_new = xgene_mdio_remove, }; module_platform_driver(xgene_mdio_driver);