From patchwork Fri Nov 17 09:59:28 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: 13458712 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=none 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 1AC8AA9 for ; Fri, 17 Nov 2023 01:59:56 -0800 (PST) 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 1r3vdc-0000Cw-A1; Fri, 17 Nov 2023 10:59:48 +0100 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 1r3vdb-009eFp-Ra; Fri, 17 Nov 2023 10:59:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r3vdb-002zWC-II; Fri, 17 Nov 2023 10:59:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH net-next 05/10] net: sfp: Convert to platform remove callback returning void Date: Fri, 17 Nov 2023 10:59:28 +0100 Message-ID: <20231117095922.876489-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231117095922.876489-1-u.kleine-koenig@pengutronix.de> References: <20231117095922.876489-1-u.kleine-koenig@pengutronix.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1762; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6b1/r3nohYrC/70zxlL2kNntlccPvHvYfH1SCl9wYnk=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtRwy4bwsK+9BS1FH9/paXnyqJwN0rzUHNP+68yP6enfv QMyeMs7GY1ZGBi5GGTFFFnsG9dkWlXJRXau/XcZZhArE8gUBi5OAZiIrS37P5N1dxvC1m5Ry/MX 3OaY4xE+a7LLP3fN236hTI/9NBdGTTH7M1foQdnswP28HbIqJ/U6lr3lYwnbaPmfX/bAxe5YKzf D3cmFdsVsCtmLLmr6m7su/8awOmQud/gBjfJtW09vu2P/4sbKT/bTZgbt3Xo5T+yghOCnggU3Qo 8ZB4Y6egUKOLgtsVx3VTI4plfz/enjn4wnPzhi/jN94sInpmuCZqRPW8f3c1qpQOjCaw6H21iZv V/85Np/lUtfMEXMIcdscmFXd+I2qVlFH1zCaj7VVt76fODg04uqS8vb2CuOGbdOsolZ6GYu+/DF 94jIz6deNYqyFDmpiXncKnB4y1pd0t2qXniCk80g3akXAA== 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: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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() will be 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: Russell King (Oracle) --- drivers/net/phy/sfp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 5468bd209fab..859b4749e8e2 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -3096,7 +3096,7 @@ static int sfp_probe(struct platform_device *pdev) return 0; } -static int sfp_remove(struct platform_device *pdev) +static void sfp_remove(struct platform_device *pdev) { struct sfp *sfp = platform_get_drvdata(pdev); @@ -3106,8 +3106,6 @@ static int sfp_remove(struct platform_device *pdev) rtnl_lock(); sfp_sm_event(sfp, SFP_E_REMOVE); rtnl_unlock(); - - return 0; } static void sfp_shutdown(struct platform_device *pdev) @@ -3128,7 +3126,7 @@ static void sfp_shutdown(struct platform_device *pdev) static struct platform_driver sfp_driver = { .probe = sfp_probe, - .remove = sfp_remove, + .remove_new = sfp_remove, .shutdown = sfp_shutdown, .driver = { .name = "sfp",