From patchwork Wed May 17 23:01:04 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: 13245944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48AA8C7EE2F for ; Wed, 17 May 2023 23:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1SD+yeVAbrSecfXiCTHVS753V2/wmSJoMIQXIImAqCM=; b=wHVg5Ca1vwLltn uYTikXAf4GNGLzqkiAOSeyiPsxqaKV1r4fk9AAY9SPamHDkyM4v0CiGotCI4E0kTkCiiqtWCrWFAF P5F2x8jYvjo9fVV/Bv9zms8tBYoWX+TG7q3f0GYc/fuP325nkewWG+BSS+TBccba8Alot9rA/wbJX spPfsSCpN46Bxsr9Pz6fF0qB+tdP4NfDwmI4P6TatdN26kkmzf5F6GHS0u70fmfODx8nwceUWV+il aaGUcaCWWjFdHFmwrMco7QUuO+cgb/2TPGMWYEfMxJgUssoEOp83dhBzmhEnAZUNVGrD3vkjJEmYl NBTo9oZRmt5x0oMCaT8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB2-00BIJz-03; Wed, 17 May 2023 23:03:24 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI40-1y for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:10 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAO-0007jB-Vk; Thu, 18 May 2023 01:02:45 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAN-000wnh-7g; Thu, 18 May 2023 01:02:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAM-005UVM-FB; Thu, 18 May 2023 01:02:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Peter Chen , Pawel Laszczak , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer Cc: Roger Quadros , Aswath Govindraju , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 02/97] usb: cdns3-imx: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:04 +0200 Message-Id: <20230517230239.187727-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1861; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=i3Ljt+mhX1a8pXNB9oz0DmFo8/3jux/qS6o8QqN5XYQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVvsGVkXDa2IxloDSH3LT4AKJxqGnXwaWdik4 5U/LzcJvmuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb7AAKCRCPgPtYfRL+ TkSkCACGVcExiEq/wEzaC6IJh4ykWTgH99Je3S5N72owWnxzKbqXtaJHkwOM67RWgmfCLOuv345 /X56zlUVMuLUzii6Qo0l3Eno7yRLS8gYqvbqgEOpzMfUTZ0XX3ImghWkCcdB4Djl6b3AzV5xt0K b1P1ll/o5QaojZApu0zRys8TaP33zeiIWTw1+vm4fy3+/cUp+MTF2virr+q6n3+WMAKfGiua3D5 KKb9p3cmbXPM63fY8cWeZ8tL2md1CCwHINaMaUk22PI31YkVfrRgHiBxIavoid+tE/d8A87JJ/s vbQbTvxr1uZqvh/9FrxMzkahNvOXsrTDI2Q0j5OhrAyrfKFu 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/cdns3/cdns3-imx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/cdns3/cdns3-imx.c b/drivers/usb/cdns3/cdns3-imx.c index 59860d1753fd..e5930f894315 100644 --- a/drivers/usb/cdns3/cdns3-imx.c +++ b/drivers/usb/cdns3/cdns3-imx.c @@ -218,7 +218,7 @@ static int cdns_imx_probe(struct platform_device *pdev) return ret; } -static int cdns_imx_remove(struct platform_device *pdev) +static void cdns_imx_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct cdns_imx *data = dev_get_drvdata(dev); @@ -229,8 +229,6 @@ static int cdns_imx_remove(struct platform_device *pdev) pm_runtime_disable(dev); pm_runtime_put_noidle(dev); platform_set_drvdata(pdev, NULL); - - return 0; } #ifdef CONFIG_PM @@ -416,7 +414,7 @@ MODULE_DEVICE_TABLE(of, cdns_imx_of_match); static struct platform_driver cdns_imx_driver = { .probe = cdns_imx_probe, - .remove = cdns_imx_remove, + .remove_new = cdns_imx_remove, .driver = { .name = "cdns3-imx", .of_match_table = cdns_imx_of_match, From patchwork Wed May 17 23:01:07 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: 13245945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57F7BC7EE31 for ; Wed, 17 May 2023 23:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7Fa1EaW5fkA13DuR4K1m4JqI9OiN/IrD7YieQKp2lho=; b=mDDqLGKmCsNLyz OCjkrq4/kbi7g1+k2//X39rkGU+BeRgR0JMBaL1V2EH4cIZph1iNZhDRHhTFdpS0o5MhKaaBIpfnS 73B7EhQL4CxkKjqQ1U8RPq8mMKTjZ/rugf5SyCkBRAUUy8800jzZy9sQPrTeXwH8vDnOLmN85dDlp /q5/vZntSxkjUXzHRRApZqCMaB/2+4jC9siWTJlEmRyFHgcmIOMuPjXO/9FMp/3lVE1pVAXKELh7o tCNBjH7sF4jHlCk/V+/nxav05HKnxFkEI3qeGEfBmaqV34KDqsrh/ibdEsr6AK6EpWXb/C+2S5mDq +qBxg1d0ur9bZ+xAX33g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB1-00BIJ7-14; Wed, 17 May 2023 23:03:23 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI3K-1y for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:10 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAO-0007jN-Ou; Thu, 18 May 2023 01:02:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAN-000wns-Pr; Thu, 18 May 2023 01:02:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAN-005UVW-3A; Thu, 18 May 2023 01:02:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Peter Chen , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer Cc: Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/97] usb: chipidea/ci_hdrc_imx: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:07 +0200 Message-Id: <20230517230239.187727-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1933; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=sHvodwK19h3h+4n4dSSPzKTcWBvUom7aYEkaMtq7fKU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVvw4WmtONgsfRlsxH8HGIqVnOV6sdCvctBtG +a/kcdpT/OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb8AAKCRCPgPtYfRL+ TjJDCACMC+WnCN88yj5eRDzv94ZnxwM7GeuV37g+Hy9dk9UHKbBIFLWiKuIXyz6qg6CZj2Cwj2n a/f80Guc2tK8rwbWyJeSDWh79Ddi3QJzREae9H7bpRZyv00c10QKEnDxahB3nPXnb/YfQCo0sCt 9dm6yZ6Sh9rwpO4yaUjDsUYQAPnYDmMfVXxs+moe3FZX5WFfR+YAob32zD6g4mTw40F5zwTizgY 6jr1gYnavHhlE3g3qPQzjdOThxd6eZVerFHGO/nCaq6/5DAHbPmCxyB4cULMvUG3u0DhizgdonH fOTfra55Tpx1J1flU7EZQFj+H+vYcnN8kcreSHXQ3ROGLW4t 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160308_753670_6F52D01B X-CRM114-Status: GOOD ( 17.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/chipidea/ci_hdrc_imx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 2855ac303001..9f0f4ec701c5 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -502,7 +502,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) return ret; } -static int ci_hdrc_imx_remove(struct platform_device *pdev) +static void ci_hdrc_imx_remove(struct platform_device *pdev) { struct ci_hdrc_imx_data *data = platform_get_drvdata(pdev); @@ -522,8 +522,6 @@ static int ci_hdrc_imx_remove(struct platform_device *pdev) if (data->hsic_pad_regulator) regulator_disable(data->hsic_pad_regulator); } - - return 0; } static void ci_hdrc_imx_shutdown(struct platform_device *pdev) @@ -650,7 +648,7 @@ static const struct dev_pm_ops ci_hdrc_imx_pm_ops = { }; static struct platform_driver ci_hdrc_imx_driver = { .probe = ci_hdrc_imx_probe, - .remove = ci_hdrc_imx_remove, + .remove_new = ci_hdrc_imx_remove, .shutdown = ci_hdrc_imx_shutdown, .driver = { .name = "imx_usb", From patchwork Wed May 17 23:01:16 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: 13245947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A20AAC7EE2F for ; Wed, 17 May 2023 23:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BpHuIx0gww2mI1Xj/YsWoqo40AgIHv3LQogC215axI4=; b=jTQvfanZcl3hEv 8NEhqGTYf7OvLuz9Zk3bDgSSCvAkO8enbbVafmbr4YWs841hY/ekrb7rMOW1IL4bedQFx7b6m64WQ zmLr7RBCCdt0G668ONDLUA8XniUkXbOtv732KXoiYBeamN5e2nJC486iVHNNnXfSNDW38LJhusGCk eoDGSCSN8tgj8uJEQmq6yB8ZmQqNkiyN+QR4Al21AMty3NBhg8bWJqYzsA9BuQwYZRwvlI0Rwk/Rq F+giOMQW9nhsr0MVEbyhwIebHWWDMC6z6g5yDeyJEpXqNhRYoD0re347fypNNG4+vqRlaFEtqPp27 eZcxS/GtIexEgqMHct2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB4-00BIMT-16; Wed, 17 May 2023 23:03:26 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI2N-1z for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:12 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAR-0007m6-0E; Thu, 18 May 2023 01:02:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAP-000woa-Fx; Thu, 18 May 2023 01:02:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAO-005UW6-Rh; Thu, 18 May 2023 01:02:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thinh Nguyen , Greg Kroah-Hartman , Krzysztof Kozlowski Cc: Alim Akhtar , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/97] usb: dwc3-exynos: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:16 +0200 Message-Id: <20230517230239.187727-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1921; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IdD60lOwq2wDg14YlBnrN2r7Raes/oLMlAITP/+u2gQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVv65NrKhXHRhmvFHF3UGCM5SDddKO01GSNOQ 3eeeR4dGiKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb+gAKCRCPgPtYfRL+ Tg+PCAC00b+j2VDaanaKl8Dd4SS9CTUFqY9OEdpUvVxoOY/BLEA6gSocxns5jPvImWpsVo5OTZ5 VLWFYO5g4VtBbv5VjTQcVgyz5stdMhNuaI/QPgBDLF7ZczZgtmTTbwNIYmcgTG9dRe/uUwozuA8 YxHCf2HIvcqPtQJ2i2DqK/LX8y/PJi1p6Uu1TITeA+qdI5GUVZE/jXHktSuIJtMhVVYvhmAdBD7 nxlUC373gN/MPScp+/nlK3vm9//K2jZkJnnvqTDZcxpWHYagxJRWXgwJ6h+fd9rwY67oMWX6cX0 xooDohOZjj30v8Izd72vCksrj6QVmO6cu/sFASutnsbrHPhr 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160308_793445_1A2A610D X-CRM114-Status: GOOD ( 17.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Thinh Nguyen --- drivers/usb/dwc3/dwc3-exynos.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 4be6a873bd07..f882dd647340 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -128,7 +128,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev) return ret; } -static int dwc3_exynos_remove(struct platform_device *pdev) +static void dwc3_exynos_remove(struct platform_device *pdev) { struct dwc3_exynos *exynos = platform_get_drvdata(pdev); int i; @@ -143,8 +143,6 @@ static int dwc3_exynos_remove(struct platform_device *pdev) regulator_disable(exynos->vdd33); regulator_disable(exynos->vdd10); - - return 0; } static const struct dwc3_exynos_driverdata exynos5250_drvdata = { @@ -234,7 +232,7 @@ static const struct dev_pm_ops dwc3_exynos_dev_pm_ops = { static struct platform_driver dwc3_exynos_driver = { .probe = dwc3_exynos_probe, - .remove = dwc3_exynos_remove, + .remove_new = dwc3_exynos_remove, .driver = { .name = "exynos-dwc3", .of_match_table = exynos_dwc3_match, From patchwork Wed May 17 23:01:17 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: 13245943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84D39C7EE2C for ; Wed, 17 May 2023 23:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jE5afRC5Rh3QFgSlD6RMcyD73AQEVUh5lNXXuDw7cnU=; b=Ik/OTML37/4Xqx vrau43yYU+JDibr+etRqk7ZSPvTex5v0lbOxqhfiZwYmx5qT6h1jbqvnlquH/YINCW6gubokiW16C yQpGJW4I2Njdegg6IqE2m25gWErM9MQbH9QKC9Khu10IYq9FATs5+9AOgONWagftZUYiSXdR/RKGU f6xgbkm6U7bwSWN5UJIMs1Uotp4QnRm2apBDraCfNp4Nmtq9hK6L6BJKvwF8786VbiRfOKdThugVU Bq6M8qtjgxXIOJUw8QBMiVAaAowvdEePZ2cB6n634+5r6EGiZqjlDUKrcrr+LED09fVHXRjdK0HFq FQjKDI9weWjiPPrFKKiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB3-00BILZ-2H; Wed, 17 May 2023 23:03:25 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI3N-1y for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:12 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAQ-0007mb-D1; Thu, 18 May 2023 01:02:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAP-000wog-MK; Thu, 18 May 2023 01:02:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAP-005UWA-2r; Thu, 18 May 2023 01:02:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thinh Nguyen , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer Cc: Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 15/97] usb: dwc3-imx8mp: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:17 +0200 Message-Id: <20230517230239.187727-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1961; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Y50UTmH5h7TgL9YmdQgZF0UwMlcQILrKLKScyZezHW4=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTU6N/PnP97cKsxba6zufpy5eF9zlzOD97xzu4LaD957 Y+o7Nu+TkZjFgZGLgZZMUUW+8Y1mVZVcpGda/9dhhnEygQyhYGLUwAm4hbO/lfIcJmTvOBc97Bl W1hCzZzMLVZ1VnpWKc6frL9wqS/TQZ3jc133Xuw3vKWelWJiUpB4uN6/3Lc87XLvRG+/jphiXUP +9DBpndcFiur/2XonMP9MD1w60bB1/V5JHRlNx+4vCQ+1G5gzGgqTn5ee1V//R897kdO/pTdtZl uubjuSUZpQH/k/XS8tRZvH1m6efpSy4NS7rFdEHzXyVSflK925zJWV/XSBsdLcjTx9d1iSZ9/6v O6l1de7m4ofpdfvqXWZ1S12zHTH54g7KodiX2658/ZajICVX/bsV7m8nLO37F+Yv9a21t3y550m z3kmjxaLu/8SSDj097lOSErsY8VTORPWb4vkdnwX3vMUAA== 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160308_759313_31B3AAA1 X-CRM114-Status: GOOD ( 17.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Thinh Nguyen --- drivers/usb/dwc3/dwc3-imx8mp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index 174f07614318..8b9a3bb587bf 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -266,7 +266,7 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev) return err; } -static int dwc3_imx8mp_remove(struct platform_device *pdev) +static void dwc3_imx8mp_remove(struct platform_device *pdev) { struct dwc3_imx8mp *dwc3_imx = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -280,8 +280,6 @@ static int dwc3_imx8mp_remove(struct platform_device *pdev) pm_runtime_disable(dev); pm_runtime_put_noidle(dev); platform_set_drvdata(pdev, NULL); - - return 0; } static int __maybe_unused dwc3_imx8mp_suspend(struct dwc3_imx8mp *dwc3_imx, @@ -411,7 +409,7 @@ MODULE_DEVICE_TABLE(of, dwc3_imx8mp_of_match); static struct platform_driver dwc3_imx8mp_driver = { .probe = dwc3_imx8mp_probe, - .remove = dwc3_imx8mp_remove, + .remove_new = dwc3_imx8mp_remove, .driver = { .name = "imx8mp-dwc3", .pm = &dwc3_imx8mp_dev_pm_ops, From patchwork Wed May 17 23:01:19 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: 13245946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91E47C7EE2E for ; Wed, 17 May 2023 23:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7H7GQCOeu17/0EqXoklpS6LVUONv79aJ7p9NnoBJxXo=; b=RSyyVxtSclkuub xuqc4kPP1K7croS/GO03gy4o5NrO254Pm7M/rs6MLs33bfm6im3RzZ08HMpXNbtNeBe5o/AtOGmx1 9gzAWRGbL6lJ+nt1MyP1ew3vw+k3vFGntQx0FnVTS2u97tOryisER1UWwbyIQOr+ZgmZddT//KbTW s9GjJ2Ah1PtU2e1RYn7cpoLPsZ4ORmhsWIEx15eKq13hNUt0X7IaCYD2IpYOoKUDm75vHO1ih6hg2 vUFw+vhxgHd6ZvJ9tcjYPhxIMBCqO4j4JAXlSFgFTOjbPuScTJUd3bltMc2FhK2MHR0PY3nX54Vl3 2I/njhITU9PKcCa0iC8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB3-00BIL9-0c; Wed, 17 May 2023 23:03:25 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI2c-1z for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:12 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAQ-0007nB-RW; Thu, 18 May 2023 01:02:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAQ-000wop-6D; Thu, 18 May 2023 01:02:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAP-005UWI-FF; Thu, 18 May 2023 01:02:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thinh Nguyen , Greg Kroah-Hartman , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 17/97] usb: dwc3-meson-g12a: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:19 +0200 Message-Id: <20230517230239.187727-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2023; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bBrKVx6OfZrSZVEoSGBtaNr7cq96r3z82Q7VQ738QaA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVv+Ga7t9fqZ/L85VfZ8l5ysQ6NNnQv1sZU9k 6uofkm64QOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb/gAKCRCPgPtYfRL+ ToHwB/0VhlUxmaahZ5cCzjtZfjbg+2Pcrb4WLXHPsXbMpPruGDJgYSv6if5+8c6PT2WDa/7BIVD gBx3lFgN37y48gZbTkPNrbn+rpnamKZnGUXfcyJtZma7eR/RiClNPo5lnY1f1QFeMGd2xXIiJ7q ouIZp03Pru/t+t9K+PzkCETDPPBnhfGC/OKVodus58h/Aqy2bjp2XsVhPtzhBg9wk5fuIVkyZcU KFqOVVbMRies1lkt67mFYiLji9tXpdkubkE2fUNMKAZoRU8Cc1C2bxL2BhhzSpb0oeSzomO4cXW yRgSZPTXnHDRqNj06Hu0+skz9rvTWr3vIYXUJAlOJVNgvceQ 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160308_761977_8148DCB7 X-CRM114-Status: GOOD ( 17.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Martin Blumenstingl Acked-by: Thinh Nguyen --- drivers/usb/dwc3/dwc3-meson-g12a.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index b282ad0e69c6..7ed5a21fb441 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -835,7 +835,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) return ret; } -static int dwc3_meson_g12a_remove(struct platform_device *pdev) +static void dwc3_meson_g12a_remove(struct platform_device *pdev) { struct dwc3_meson_g12a *priv = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -859,8 +859,6 @@ static int dwc3_meson_g12a_remove(struct platform_device *pdev) clk_bulk_disable_unprepare(priv->drvdata->num_clks, priv->drvdata->clks); - - return 0; } static int __maybe_unused dwc3_meson_g12a_runtime_suspend(struct device *dev) @@ -971,7 +969,7 @@ MODULE_DEVICE_TABLE(of, dwc3_meson_g12a_match); static struct platform_driver dwc3_meson_g12a_driver = { .probe = dwc3_meson_g12a_probe, - .remove = dwc3_meson_g12a_remove, + .remove_new = dwc3_meson_g12a_remove, .driver = { .name = "dwc3-meson-g12a", .of_match_table = dwc3_meson_g12a_match, From patchwork Wed May 17 23:01:23 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: 13245961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A36C0C7EE22 for ; Wed, 17 May 2023 23:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Osk5duek+o5qZlb7MkQ//kWmwS+o8RmaRat8F0PkZDI=; b=UU6Kbv6UyKl19O Ussx5S3dkQJuAe6ZfPPRURVMtlT830LJxzUD94JWVGNU8K7x3gIIP5IK3JzRfRyZZhM4EGrx5ddGV pcIEiHWRn4dBehwVmz5fvSe+FFw7uecMfNpkWWUYoeRT8sAczblxk2C4+fs7neOs7vMA3UbUAdyzQ QBxzFU2GbhlcChKoT1P/DIXikrS9b3Q8YBp35IDL5IPS9+xG6r/nk4YmAebYqXVuxxTi8nTY0vI+D xkfPg5EbMYLv9oMLMJMPUoGrFD+V4dEkbY8yH78V4uPx8NMQZVCvds/1F5glvW9Jtx1yv7nvJxuMt uglXa2dxBxBcG3ls7tsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQCr-00BJqP-2X; Wed, 17 May 2023 23:05:17 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI2n-1z for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:13 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAR-0007pF-PD; Thu, 18 May 2023 01:02:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAR-000wpB-0e; Thu, 18 May 2023 01:02:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAQ-005UWY-96; Thu, 18 May 2023 01:02:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 21/97] usb: dwc3-st: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:23 +0200 Message-Id: <20230517230239.187727-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1813; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=K8cwbiNwd+f+qmr+JugO2uK7CLbH7gcETdaoCKNxExU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwC869KaQR6o4cPUZRT2exnJfWyXW+ffMRwO ag0v6D6kdOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcAgAKCRCPgPtYfRL+ TiA5CACzuW1C4/VGO1XToOtEj5wBjkPoFNxWYvcKmnW1qDXW3xTD/1j4B3CJ0Mqehvf89V6xz5I eXfbTU2PLhxKzQb27B5qeG2vRmFO7OU+G8VnfaleZp+lkFmvI/zKlZdYjVoUMFGrZ201zXqd0z6 FekLmQSRBKxJ1gamu+O9cB4YSxlmASZAPBYvwh/n3B4UQWj8x7lBivrUSVa8w7RhfuMNGLFZNku ygT6qy38snUSidkh0Kd+qItMCCNY4/ENBKGILiWm3EOyDzfaFYU408qC6//kNevnrdcg0Jn8hFk dcXCoKVYC38lN9xh8xZRN6K8cRE6naAPR9KdrgNV5XnWZM4m 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160308_787358_F4773F1E X-CRM114-Status: GOOD ( 16.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Thinh Nguyen --- drivers/usb/dwc3/dwc3-st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c index fea5290de83f..211360eee95a 100644 --- a/drivers/usb/dwc3/dwc3-st.c +++ b/drivers/usb/dwc3/dwc3-st.c @@ -305,7 +305,7 @@ static int st_dwc3_probe(struct platform_device *pdev) return ret; } -static int st_dwc3_remove(struct platform_device *pdev) +static void st_dwc3_remove(struct platform_device *pdev) { struct st_dwc3 *dwc3_data = platform_get_drvdata(pdev); @@ -313,8 +313,6 @@ static int st_dwc3_remove(struct platform_device *pdev) reset_control_assert(dwc3_data->rstc_pwrdn); reset_control_assert(dwc3_data->rstc_rst); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -364,7 +362,7 @@ MODULE_DEVICE_TABLE(of, st_dwc3_match); static struct platform_driver st_dwc3_driver = { .probe = st_dwc3_probe, - .remove = st_dwc3_remove, + .remove_new = st_dwc3_remove, .driver = { .name = "usb-st-dwc3", .of_match_table = st_dwc3_match, From patchwork Wed May 17 23:01:24 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: 13245948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03F7CC7EE22 for ; Wed, 17 May 2023 23:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RQHdJ9+uyOYIZcyDZgN4Z0uTlFaRcrK81knT4tnQp8I=; b=RiLpwLydNYDYWC 1WUqZchNUuIdG3KGSTrIyijmQmC8slFNGaPu//Ae/B+Jc+bswcN4YPE1ZmOnclEU+qi6xw8N3Te0d hV/KIBz8haw26/XvEzSGZ67w7Sc5mDxbm/8C8i8tePha7jmdSuRz8SSbSCiwAL89WNB7PLzNUNDJm TmC1v+F6HGxtoVfJob8muAAEvxljWx0bs46LIWNbsUeCq64dAFDByOchjLfP+YF3mgtbLXZyIPq1p QRNDQ3dNu6ao92Vz7tqoj3Sn68K0cHH9Ckcx2JV5Dw2FvJaGI0GeDdqw1GZGHUXb/Mp5Q7AVkuhoY Cl/vwi0kpev3f7Uz9YJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBg-00BIkE-0x; Wed, 17 May 2023 23:04:04 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI2x-1y for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:13 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAS-0007pV-1M; Thu, 18 May 2023 01:02:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAR-000wpH-8t; Thu, 18 May 2023 01:02:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAQ-005UWc-FT; Thu, 18 May 2023 01:02:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thinh Nguyen , Greg Kroah-Hartman , Michal Simek Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 22/97] usb: dwc3-xilinx: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:24 +0200 Message-Id: <20230517230239.187727-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1955; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=t7VzUnIkM2e38shH9Y4kGTLDFowMlVRPRL2pu+1oAeM=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUGOajrJxxQYUtd4p5fp85e09ikszcvqNlu+9+Vyhs5 +0Q837dyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBEtBg5GBZfUy/M+yHuzcfk NENAu5XrlU9t/a/v1c1mHQlremexRkmfYvvGkGNgLWOi051TLrzJsELtVOvlj4e7J2f/N5p77Ez Gl7sGxbJi7KUr5wsvEuQyP+Z/pl77gY/D4997FRc1r2X8dYz7gVN8bOqfU9I2f8peXdDgYpLYlC LGZvjButHv3Lr8ez1Cq7xTltoGtNvuSPnWtVC3tGMhy3rx8oT2LuMtj9JDJSPU997iEC2O+N55U H513omuE7qqb9dvnrPpfSp3a7qNS5LoBS7u2XPTlU5GMx9auJf3IHfmPnan/KLC2tf39x7MqY8T mnv+M1/Vtkr3nxFGUy2ncmZvtPxfyPBwm9Gtdam2RzcDAA== 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160308_811750_353A99B2 X-CRM114-Status: GOOD ( 18.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Thinh Nguyen --- drivers/usb/dwc3/dwc3-xilinx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c index 2c36f97652ca..19307d24f3a0 100644 --- a/drivers/usb/dwc3/dwc3-xilinx.c +++ b/drivers/usb/dwc3/dwc3-xilinx.c @@ -305,7 +305,7 @@ static int dwc3_xlnx_probe(struct platform_device *pdev) return ret; } -static int dwc3_xlnx_remove(struct platform_device *pdev) +static void dwc3_xlnx_remove(struct platform_device *pdev) { struct dwc3_xlnx *priv_data = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -318,8 +318,6 @@ static int dwc3_xlnx_remove(struct platform_device *pdev) pm_runtime_disable(dev); pm_runtime_put_noidle(dev); pm_runtime_set_suspended(dev); - - return 0; } static int __maybe_unused dwc3_xlnx_runtime_suspend(struct device *dev) @@ -388,7 +386,7 @@ static const struct dev_pm_ops dwc3_xlnx_dev_pm_ops = { static struct platform_driver dwc3_xlnx_driver = { .probe = dwc3_xlnx_probe, - .remove = dwc3_xlnx_remove, + .remove_new = dwc3_xlnx_remove, .driver = { .name = "dwc3-xilinx", .of_match_table = dwc3_xlnx_of_match, From patchwork Wed May 17 23:01:27 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: 13245962 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31484C7EE22 for ; Wed, 17 May 2023 23:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=h+kH6lFeOQsWRNpJh8qJlFIaQBEHhoakqzfbO7YlroM=; b=PECc675rFLtb3L hLWy3E0DpsV+brfNFArxKNhm8kDHJ6lkOiM+bb43/cNKW5WM+VKrBMMOZ3eqDPjm1C7/DHpSlfYe5 2b3UBJORyt+9gtDqB65UW8PQgaSLe6dE7J0EkiNPbinT1C7QrEqwDe9xSKAouKkweM5RGFiohJZlL 5TQAPQJ+IQRVqOPHUqmVdkPdmXhdgtxXGOJfsFzJz09QypYanecMcNUca4KfQy6p6VBV3fnXLTYeV xrX/Yw6c2iB2p8rKhbzkMjyPHgyHQFr8i2FQVpersvn1e3NP6LTnvwuf6kXRvsA/i9SNayJMoP5fW zm+47/q7A6ROtoBYn1Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQD2-00BJvC-1i; Wed, 17 May 2023 23:05:28 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBB-00BIQk-1T for linux-arm-kernel@bombadil.infradead.org; Wed, 17 May 2023 23:03:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=dYCxTkLbgHeOresU8eqxefpUbHqoeGsQiqggNCzrBbQ=; b=HRwLHHUPA2Jj3ZPMbnYkC8tvOi dfDinJV8t8trUZkqYdH8PJWWCzsVrXu1sCF3PvJjCxNVaX0sAembCJGxJnOdgNjEH9KtJYmRUF5BU DAFluXNqWKnDuUemAVaJ8pBrEmZOpIssOEURnu4cP+4G2c1z3b56NS9YcFO/sSMZ1V8AVkKoS2rui 6yW2CI7Q/ErUD6p8ghYZ2cQckItjaUPdIdjXbcJ+uXWMbnu26HHbADAWWKJ7HZDYTXMTju40G+rUR 1hVpprTsIFmj5Q0aOz+xblN2m8Ex04vkuT1KLSopar39I72FRfILXRJyaZwVFyGT+/E1oHOv1nCgQ 9CkK3zQw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB7-00DMeJ-2R for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:31 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAX-0007qP-CM; Thu, 18 May 2023 01:02:53 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAR-000wpU-UF; Thu, 18 May 2023 01:02:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAR-005UWo-3g; Thu, 18 May 2023 01:02:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Joel Stanley , Benjamin Herrenschmidt , Lei YU , Neal Liu , Henry Tian , Andy Shevchenko Cc: Andrew Jeffery , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, kernel@pengutronix.de Subject: [PATCH 25/97] usb: gadget: aspeed: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:27 +0200 Message-Id: <20230517230239.187727-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2088; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MV0ThmzJUmcovzeeBYch+5BKOdB2tqS68iBUtqxhmXA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwHMxMU+ji6YX4DtbKukTr1obOqsXHNjQN2z w8O6lFzjmyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcBwAKCRCPgPtYfRL+ TvxDB/9MQtYjU8ldqJ1jR0G7lan8lFckbGe+rBHmW6p+mC7W8OxY4P9/PRB8UIMcqoUwy19ZPHq k6g68tYoUisF0+QR+FCOlpOhBcShZd2coljtyvR2/GNgPzP9sQ1skNdJWECZFss15ris3dNOoqw qPJgl7wBBo7vPM0ccOH/uo31B+mqCVCZIW1eUIVkvu3Q0PokcWZCHu7npHSzcv5Ce/nV8IwJnbN b8FV5DU5t5KgMz5B+2+mr8G4VT0iouiMlj9jrtFDOPbIoUA2vOwmg5EmDQGhCwh9HsdonZA6/tc S1rf64nBzQG1F57fNgTnPwTIXeg6AdOpct14FRF9shTlL6DW 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_000330_384130_6438F83B X-CRM114-Status: GOOD ( 18.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/gadget/udc/aspeed-vhub/core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/aspeed-vhub/core.c b/drivers/usb/gadget/udc/aspeed-vhub/core.c index 86398a04a012..16f2db8c4a2b 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/core.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/core.c @@ -253,14 +253,14 @@ void ast_vhub_init_hw(struct ast_vhub *vhub) vhub->regs + AST_VHUB_IER); } -static int ast_vhub_remove(struct platform_device *pdev) +static void ast_vhub_remove(struct platform_device *pdev) { struct ast_vhub *vhub = platform_get_drvdata(pdev); unsigned long flags; int i; if (!vhub || !vhub->regs) - return 0; + return; /* Remove devices */ for (i = 0; i < vhub->max_ports; i++) @@ -289,8 +289,6 @@ static int ast_vhub_remove(struct platform_device *pdev) vhub->ep0_bufs, vhub->ep0_bufs_dma); vhub->ep0_bufs = NULL; - - return 0; } static int ast_vhub_probe(struct platform_device *pdev) @@ -431,7 +429,7 @@ MODULE_DEVICE_TABLE(of, ast_vhub_dt_ids); static struct platform_driver ast_vhub_driver = { .probe = ast_vhub_probe, - .remove = ast_vhub_remove, + .remove_new = ast_vhub_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = ast_vhub_dt_ids, From patchwork Wed May 17 23:01: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: 13245942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94810C7EE2D for ; Wed, 17 May 2023 23:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m/se08w8/ZGuD5uqNBq7TBbDZLDyOftyqs61y9k3vZ8=; b=q3R6a6NZJyqKuu czt9d2xkhbHONf5nP3ObohgiPSkfmdbSlthAj3YT4vYK0GpUQ1xqCfpJoarNdkFZu3wV1GxqRzQY3 ZwMMNog3R6HSggRQVIUQ+Kpcm9i7wKwj2ujxXWRwhdMBBtA14+RFyyw4XM+DkH+k4An6gSruYfsTk SnTaEZZmAGd8/ji+0DmDPMCWxOlJ4JQDOPgTa1DPeW14UujWWSkyhb2Mz0+iw+VitRyfAtpaXnWSx 5tcW8NnCV/9T3U2Kj1lfLy0PoWGDPHnFzcmaj9VKQFtksR5GnCF7VvDT1WQABnbUb6Z3V6DAwKypk XsLhT+Iq3xjQ5o7JjtVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB2-00BIKR-1p; Wed, 17 May 2023 23:03:24 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI47-1y for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:12 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAV-0007yD-EW; Thu, 18 May 2023 01:02:51 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAT-000wpv-5r; Thu, 18 May 2023 01:02:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAR-005UWs-9l; Thu, 18 May 2023 01:02:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Cristian Birsan , Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 26/97] usb: gadget/atmel_usba_udc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:28 +0200 Message-Id: <20230517230239.187727-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1912; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nIGMRwP16/S7YCje/oPKRJD33QIYgeCG6HhFveJ7vVs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwNFXiyM/lMJwozsWfxT2Vqi+7y1Wa3VPJZk fh6CfkiupGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcDQAKCRCPgPtYfRL+ TmzoB/sGkWa9eIFSQQbRUC7bOWpFAGc28nOJxQsgHIjA66LBDZr3JvOB4NunleCRlDrRAROOd0I F/7/tc67b2nIcM7QX3bu99iuW0s2s0fbx0LlHKITF3UckAd0sxYpar2icywAGh+WMAlzmzBaT3C nFIq2R06iZ/Ukc3nx1WZL5joDKfVmj/WQ5k49T3Q2Jrny1LPQvlNyVjYMmR2t2UK4cfFgSIf+1D ZH04pkfW+zNNCcpE4F4bqC29geA5Se21IfbTxMZV6sSy+DUUL8/1Lt4QPYJXXQJRAbEWKXctifg TwlO65lOE34FHdvPXTndb8AkoXYC+F6QYa5R+j/0LSnm6t03 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160308_741191_C4A68BB7 X-CRM114-Status: GOOD ( 17.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Claudiu Beznea --- drivers/usb/gadget/udc/atmel_usba_udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 53ca38c4b3ec..6c0ed3fa5eb1 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -2369,7 +2369,7 @@ static int usba_udc_probe(struct platform_device *pdev) return 0; } -static int usba_udc_remove(struct platform_device *pdev) +static void usba_udc_remove(struct platform_device *pdev) { struct usba_udc *udc; int i; @@ -2382,8 +2382,6 @@ static int usba_udc_remove(struct platform_device *pdev) for (i = 1; i < udc->num_ep; i++) usba_ep_cleanup_debugfs(&udc->usba_ep[i]); usba_cleanup_debugfs(udc); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -2450,7 +2448,7 @@ static SIMPLE_DEV_PM_OPS(usba_udc_pm_ops, usba_udc_suspend, usba_udc_resume); static struct platform_driver udc_driver = { .probe = usba_udc_probe, - .remove = usba_udc_remove, + .remove_new = usba_udc_remove, .driver = { .name = "atmel_usba_udc", .pm = &usba_udc_pm_ops, From patchwork Wed May 17 23:01:39 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: 13245951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B13C4C7EE2A for ; Wed, 17 May 2023 23:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mL9HgUXwHrR1gxXxlroLOgg7tdbkSuNnpgWcqkFVrgc=; b=zTP+j+BpzxeseD ti7TAaLRCOGtTFY8rkO9zNl5vm87KAZW0y4Cw5FWd9eQKBHfEREDxGFA96VwltthYQ3SScObWuaE/ usuSjLpBWJVWrgUdjcHICSePhpFKdUsvo6djri64OHFbHAoGEbeY4OFZVzruM6WCyPmSdMB/4XRbd Zbealm5/JQIGkQJaLV2AWrViCm+R8A2J84Nui5J0sliUC8gMtSTx1sefwWsri2NHmdIliVEUw9ycx YIMITWXw7jizQNO51nEaW7D1hUqLiaTvxHmM5SzuFuhQ5bGqv2OvxMFGZq3NNQeArpPW24RKzuCeR uslpgVhwL8/n6JIWnMaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBi-00BIlp-0v; Wed, 17 May 2023 23:04:06 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI3v-1z for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:12 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAW-00083T-Oa; Thu, 18 May 2023 01:02:52 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAU-000wqQ-Ay; Thu, 18 May 2023 01:02:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAT-005UXY-Dj; Thu, 18 May 2023 01:02:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 37/97] usb: gadget/pxa27x_udc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:39 +0200 Message-Id: <20230517230239.187727-38-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1958; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=AB6Qc5t/8gqVgqQitKrVK5pHAZ3kpC/w1Xz6/501WaY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwusaOORV0/PZ+MFMU1KGWA+wYFWmTfhVjF4 XvSeOEID4SJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcLgAKCRCPgPtYfRL+ TvI2CAChfq00NMwsfSmmb4w2bXtwhuQHTHrmSm5wscUPeK1Hi0phdb/6mJ5Tn8M75kgdFwXD+gP 8GubIYYl0HKF9h66Znm4JZSUrv1TAGHBgrduYCTNRQI7zXe9nxHCwk7dZFeMzhDAx76aPp1FPKu TkLItUX5g6i8gQBl351OBxDyNXqVcKx8ZL8iGYzzzd2ZOdX/3+655m6jSD4xaZh2CVZYf8B0vxs vEYPbvtyF7HTW3upZSpLKnmmtU3Qn+MUK51nNOp16sZsojcMqnHC61gkGylO5a4cIf1DcATzPEK piKzKnI74nyVF+usymQFpGE4I7pbTy1te37lbdT2X7DFQw5y 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160308_766432_7B23EBE1 X-CRM114-Status: GOOD ( 17.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/gadget/udc/pxa27x_udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c index 0ecdfd2ba9e9..ab31fe35f059 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -2445,7 +2445,7 @@ static int pxa_udc_probe(struct platform_device *pdev) * pxa_udc_remove - removes the udc device driver * @_dev: platform device */ -static int pxa_udc_remove(struct platform_device *_dev) +static void pxa_udc_remove(struct platform_device *_dev) { struct pxa_udc *udc = platform_get_drvdata(_dev); @@ -2460,8 +2460,6 @@ static int pxa_udc_remove(struct platform_device *_dev) udc->transceiver = NULL; the_controller = NULL; clk_unprepare(udc->clk); - - return 0; } static void pxa_udc_shutdown(struct platform_device *_dev) @@ -2547,7 +2545,7 @@ static struct platform_driver udc_driver = { .of_match_table = of_match_ptr(udc_pxa_dt_ids), }, .probe = pxa_udc_probe, - .remove = pxa_udc_remove, + .remove_new = pxa_udc_remove, .shutdown = pxa_udc_shutdown, #ifdef CONFIG_PM .suspend = pxa_udc_suspend, From patchwork Wed May 17 23:01: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: 13245949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DC6EC77B75 for ; Wed, 17 May 2023 23:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MSJYXdXmiXj9cn2NIzBmtgF/b0tb1QzBBgaV1NxF+3Q=; b=mkH6OCwd21ee2r bQjN6SaGo8N0l+tQ8VDo9UL+gm8HmsZCNpUkqll9rtRaDDBteEOWWvBb/1VChVq2OLZjs02BA7szz GMC85bDg6aftK1SgJ5vCsbt4zpvGoq5P2vfT6AOUmvSowf0NPwGa/4kYe5ZLjFJRopN7wsV4NIEE1 7NjjS7WviqGxw4A6UZWTmveeVHg8hryQ9KB2k+8RGlkAgSBATvLGzbxMigKoKtWlRNEfHn6A0yD9X b/1Iyv+wFYhsJ9Ye25QagVOthQk7xYfy2dyzyvK+ArR+tG6Z+3SAbt/NQGxEtQsVwlJuv5EjOqncK lvOKZMMjT66xUHXx1m6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBh-00BIlB-29; Wed, 17 May 2023 23:04:05 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAn-00BI4J-1d for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:14 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAX-000887-Mp; Thu, 18 May 2023 01:02:53 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAV-000wqq-It; Thu, 18 May 2023 01:02:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAU-005UY2-NB; Thu, 18 May 2023 01:02:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Michal Simek , Piyush Mehta , Linus Walleij Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 44/97] usb: gadget/udc-xilinx: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:46 +0200 Message-Id: <20230517230239.187727-45-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=QsdnblWZ0QaAurbemW3eC0q2Zlao3gglAXiwBLLPdoE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVw6limcoxTEQTDKvhjB/VyXf4EZbU+W89dSa kJsjc0nJMqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcOgAKCRCPgPtYfRL+ Tt0sCACIWdhgDgL+00OGO7bDFOCgi4VDaR0QoEV4DjPHEpG3DKuDTR8s+ytCnmVtduXUxwcAKVV t7Mkn9CfDlR/aGdMF5W9lp+Jo1YbzulEymUxoqt0Un3Jqlp19m9EVg+GP2FUgWfmVBSa9zczThb dhJna8DxA/d5oYKS0e4DDPJZ+II4dWG7MWlR1gekPtaAdelndjHP859SfixQ2voFL0yAr/CxGx5 l1G4NbV/6aqDFuDiaz28AkrCHGV5Zsy/HbHg2/2h1Od0XTHK99T2MbynkiBlLfCRa03xL/bsG1L H1eK5amamFlIqGsEfcQeCl4vs3OAnrnmMhOY1PqauMieZUez 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160309_551332_C8D38769 X-CRM114-Status: GOOD ( 16.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/gadget/udc/udc-xilinx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index 4827e3cd3834..d73111b5cd84 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -2178,14 +2178,12 @@ static int xudc_probe(struct platform_device *pdev) * * Return: 0 always */ -static int xudc_remove(struct platform_device *pdev) +static void xudc_remove(struct platform_device *pdev) { struct xusb_udc *udc = platform_get_drvdata(pdev); usb_del_gadget_udc(&udc->gadget); clk_disable_unprepare(udc->clk); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -2257,7 +2255,7 @@ static struct platform_driver xudc_driver = { .pm = &xudc_pm_ops, }, .probe = xudc_probe, - .remove = xudc_remove, + .remove_new = xudc_remove, }; module_platform_driver(xudc_driver); From patchwork Wed May 17 23:01: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: 13245950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3DE82C7EE22 for ; Wed, 17 May 2023 23:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GKgR0sCV3ScFhH+PRRHsWlTk1mwEkLgn2MtKAlci+xQ=; b=dgJ1O1g5dMqYp4 fyAxnpptQnWcBqrWaPqkfqTRtbfSaTFnZVJJf/leBL1ncYuGJ9Ot0MJ41Zx1CU8R8MSNawsJLIAfy GoGjG0t19Q5uGr5LfH6zLrypkPFF+dMXe4UMYv3t90oDdvDdexq+EQldWPIwjPZ+alMDo+noIkqk9 l0AygvaKNJ7d3iM5XucHtxo2PGTB60E9dYbVE2/vnHHbslcFE6xiYEGQpHF4MSDGua/v22rGbZv/s 4ETjiKBJodHA9Lu7lYkFDMWkQjy0QvT3t2FkUFaZk7rMtbcMT2snwb69025p5JA/XHlAHwYtGe+aO akxDhbd8UOHR4Va3l1Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBk-00BInu-0v; Wed, 17 May 2023 23:04:08 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAq-00BIC4-0Z for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:15 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAY-00089P-47; Thu, 18 May 2023 01:02:54 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAW-000wr2-2R; Thu, 18 May 2023 01:02:52 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAV-005UY5-0L; Thu, 18 May 2023 01:02:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-usb@vger.kernel.org, "moderated list:ARM/Microchip" , kernel@pengutronix.de Subject: [PATCH 45/97] usb: ehci-atmel: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:47 +0200 Message-Id: <20230517230239.187727-46-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1911; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ulAxmCHRWMykEde6D6EcrVSrSjxFVHlauwoooCF5sYo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxBuvbIF60jJfbtcBL+G0g+NyxzPPibkoKMD m3vAARHunuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcQQAKCRCPgPtYfRL+ Ti8AB/9YVz7ioXf039zx3iZrIJsQq1uWGuCeeJhCdZIVH9Jf9CyK85JQhrClsXyNkLJLGEddAS/ 3tgCmNbLX7leUl6R++tgg5wKxfTFZ7M+JdrI/cLBHLpsk5vM6+eJALKwdjMNkr/1DMk3jvN420k 7t0sRCZtMHsCLT9fyNq5c8w+4TESzBDGDIoCv83MUcWVOs0PrVOzNRbBbCG5ZEZY2pEaHBzkzIg iqa4vdhOk4zkNjk+WlusEJ9/RKkiBTPapO7WnFvs1KmCYRPUUnjOoOmY+EZFjBKPDRe/jkeQ7/B XwRsNTpoaEyo7WSaq8vHNoaIedWeHAEp6PI3xFGtVn5/QrtP 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160312_239123_ACFD7463 X-CRM114-Status: GOOD ( 16.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Claudiu Beznea --- drivers/usb/host/ehci-atmel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index 8b775e7bab06..61808c51e702 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c @@ -173,7 +173,7 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) return retval; } -static int ehci_atmel_drv_remove(struct platform_device *pdev) +static void ehci_atmel_drv_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); @@ -181,8 +181,6 @@ static int ehci_atmel_drv_remove(struct platform_device *pdev) usb_put_hcd(hcd); atmel_stop_ehci(pdev); - - return 0; } static int __maybe_unused ehci_atmel_drv_suspend(struct device *dev) @@ -223,7 +221,7 @@ static SIMPLE_DEV_PM_OPS(ehci_atmel_pm_ops, ehci_atmel_drv_suspend, static struct platform_driver ehci_atmel_driver = { .probe = ehci_atmel_drv_probe, - .remove = ehci_atmel_drv_remove, + .remove_new = ehci_atmel_drv_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "atmel-ehci", From patchwork Wed May 17 23:01: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: 13245938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86382C7EE2D for ; Wed, 17 May 2023 23:03:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Cp5M5PTk89pJHSfMkGWqGTM8atF/bcA2+X8StP+qzI8=; b=HOTjDjAZmkpi3P 9uaMeTEbrIpNaQToU3du8UnSBF/7/nKbKG9V/fPlsiJGzKP1vK2iZ2CxDIeJc4PIoLKjsbvyH4hxh Hj9CaidIdbBDszKzWHjFT4ES12KaIRAQL/YPib6YU3oG+DoEjHNN2RkP9bhwr5ZxJSDuIV/Q4A8Au 0iP1dBSuW+mDd1Qch6Eb8Xp++0JBJ5S/kOkxmZ6DFbRNCCoNARl2ygLvhvsbA3PKp/9jInjjfZKYM VbZUGACzBMTPvu0K7eP9uIU3qGeVtA5ger0bCn9O7fuEd1SXUYBEblufXwFBRAEWgsJcDMKdTu1t1 T6Me18jMNr6oQWgpx2fg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAp-00BICB-1k; Wed, 17 May 2023 23:03:11 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAl-00BI4r-04 for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:08 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAY-00089k-GS; Thu, 18 May 2023 01:02:54 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAW-000wr5-51; Thu, 18 May 2023 01:02:52 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAV-005UYC-D2; Thu, 18 May 2023 01:02:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman , Krzysztof Kozlowski Cc: Alim Akhtar , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 47/97] usb: ehci-exynos: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:49 +0200 Message-Id: <20230517230239.187727-48-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1894; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=sdaNvSMllo7FJ63Vr0mA/chKoNhlxVQIVWkT2Ljhub0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxDmaaDrhv91DXiU7i7NVl741g+M8SJbCsTJ Sgb1xbXKyWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcQwAKCRCPgPtYfRL+ TjyrB/41RYWaqrAk8sl+HM93vnNGtFVoBUcC77MY3ceLYEqZUUrBJt/euLJ2rjmPFdgW/23Wm1N XUR7azX1aPOfT+RMfhEK4vN6b589iblCvhwm7iJNdPpMYj/49gKGTJ5Hrk9Ji35s6skSvu9wszp KvYXYT7rVOd0KhkQO5I3s9PdZ7lBiOs1QafTP2lx5w1Oop8hXt13J0QrFeWNmqfuDR1p+yXly13 dCM48XE22T21JYQq0gf7b0jY6PsAdKJPw+1urv7MlNGK9Vpb/TKn2vdJ1PWCE8CoWi6tD3xJWJ3 Yq9zRCuS48sCSXn6OU/LGo/alMlCLO2dyDNJkpjDD41dQrGt 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160307_058939_BFF0A75F X-CRM114-Status: GOOD ( 16.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/host/ehci-exynos.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 47c9f06c3d84..20f8c0ec6810 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -230,7 +230,7 @@ static int exynos_ehci_probe(struct platform_device *pdev) return err; } -static int exynos_ehci_remove(struct platform_device *pdev) +static void exynos_ehci_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd); @@ -244,8 +244,6 @@ static int exynos_ehci_remove(struct platform_device *pdev) clk_disable_unprepare(exynos_ehci->clk); usb_put_hcd(hcd); - - return 0; } #ifdef CONFIG_PM @@ -311,7 +309,7 @@ MODULE_DEVICE_TABLE(of, exynos_ehci_match); static struct platform_driver exynos_ehci_driver = { .probe = exynos_ehci_probe, - .remove = exynos_ehci_remove, + .remove_new = exynos_ehci_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "exynos-ehci", From patchwork Wed May 17 23:01: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: 13245955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAD81C7EE23 for ; Wed, 17 May 2023 23:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3iBOFXkOaprvFQt/g8fgvYKBtMD7poJaL2WBSwpenxU=; b=ZWWZJjCDIJo7dU PaNQD6gMEahhCDhupYNyogmip0uwG1zJt70gylhBKTSDLmWHO6uskhKRbOg7Ed39TB4Kp7s3MAPyY 2gAclLEssDvXq4SqcqKvz3kdsFpaJjBrLgjQd8AEctyzh2qMclM4XQFxTmvNKrRlyJg/CxegbyOVM ffGB8sWxSB+zo8Wf2ck5psx1QzcjKMTjMkdXgp659SKJtGRtESQixHR7Zoj4fW0n+0mr7Sue4pBy1 FgUutjb/BxQd7How+S3wX7ZPikcr/U/eO9IGlf4ng0SijX+KPrBCC5v2+n1oNY3ZB9Cz3HkzjO8Qm ly4ZWobSCH1CK2FRCrMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBl-00BIpA-1V; Wed, 17 May 2023 23:04:09 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAu-00BIEn-24 for linux-arm-kernel@bombadil.infradead.org; Wed, 17 May 2023 23:03:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=UP4EIJ5TpCJ6042Xvjp1t6UfqT0N3x1ZvPIP92ZWOK8=; b=Lae6MbEwRd+HBIWSk7yNn85uAv FIHJe4nEymF9rfwsCrzzM4O05LnqdQn+XXCfkY510Fx8yRqfSt42GHflkBJ/mAjkucYQn/bp2QAw0 GF8Um6TIn5sRLz/CDN1ZOH0L20+MnfDTlM1Q1FbdnBwrXjIkJdLpnW42vzPBye65qchV+NogDdvro TRifS8zL9zYGWDWqb9B9cgU49VrWFQS0NwZqCqwy95pFHxZP3kJgvYmaNfMGADOSo039zaR3oPiPy xaEf6jHpBroYrhGTOIXtCTybvbKhGYknOZSgp2aTUrRFJHVHe433PjfxsFwvi2tFzrB4IvVSstfzJ GCZ07gBQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAn-00DMb3-2g for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:13 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAa-0008Fv-DA; Thu, 18 May 2023 01:02:56 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAY-000wrq-Dl; Thu, 18 May 2023 01:02:54 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAW-005UYf-Nc; Thu, 18 May 2023 01:02:52 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 54/97] usb: ehci-platform: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:56 +0200 Message-Id: <20230517230239.187727-55-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2040; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=vGVcW37lCh+0YUFKFc9sSG9amXfxRU5Y5mm1ILry/ek=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUmCjXwm///x9vrvPb+d/tVy6H3Yr9SSudJ+zxsVJZc 1+DkSukk9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJBLuz/zMT7nLn2Mb+/pd/ tJnbBcf5BwTvLd3Ruji/d2vTF8saKSWWkPNtbGHnZMwOyXVkqwiJd0cF8xg3+ezpks+u7JE1bfR njPjawBEb0nYutFO/VO3ln0tvS3YrtnDcYFIwnhfUeNuRbwn/0fsPOC+c6ctcO08/sSpOcl6TkY bx2Ry2mZJ3DrJ+r3rVdixkQ1zI81c1Sx6eEXGx8WW5n5WR6vd33o2zKU1y664c+PKB5VRm7hH2s mnS2dcP7ejQ3XUk5veCJxZb2PoKvEJ99+pIlly5tf15c5VzNc+knxI/04OUtfJU5rcF9rf6amcf /fdHK/vMFimmPOs9mSoBFgU7TQ0c3s63ur10f72x+H0A 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_000311_452127_8CC60FBC X-CRM114-Status: GOOD ( 16.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Yoshihiro Shimoda --- drivers/usb/host/ehci-platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index fe497c876d76..83bf56c9424f 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -400,7 +400,7 @@ static int ehci_platform_probe(struct platform_device *dev) return err; } -static int ehci_platform_remove(struct platform_device *dev) +static void ehci_platform_remove(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev); @@ -424,8 +424,6 @@ static int ehci_platform_remove(struct platform_device *dev) if (pdata == &ehci_platform_defaults) dev->dev.platform_data = NULL; - - return 0; } static int __maybe_unused ehci_platform_suspend(struct device *dev) @@ -511,7 +509,7 @@ static SIMPLE_DEV_PM_OPS(ehci_platform_pm_ops, ehci_platform_suspend, static struct platform_driver ehci_platform_driver = { .id_table = ehci_platform_table, .probe = ehci_platform_probe, - .remove = ehci_platform_remove, + .remove_new = ehci_platform_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "ehci-platform", From patchwork Wed May 17 23:02: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: 13245941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A613C77B75 for ; Wed, 17 May 2023 23:03:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=q037efkxjGXqQr1Vz6RWc8EC5lBegYYdGGcvbFxB3yc=; b=f5bqX/djllrGkD jNpe3SwQkXAaBT6gUhxl8hgXVZTGdlRXVGO9wn/RBb44rqJmh5Btwbsm5L/rIXDEJkkk0atdg5T7D R7CUuJ+94x+tokS101UAxJMXl5ttIb3siR4cWAyQtkWG4/YS/j6csPgh615MtuUX0TIvy0sQq0B4e zAHsUkCFUEfJ3uy54EYWnNGq9dUUG/7CbEpVRaiyCIF1u6YzJksT+PQVLSbkI6XNTvDTAjeqPO8xl KqcBicNIApZS+BvmRXecAHrdM4NzfOgOoRpu+Cqa+9Vi93i0J/PMaoY1B0Jb1Bn577mZYJcBiBcBb ppLXBqG2XoqfkMYbR56g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB0-00BIHu-0G; Wed, 17 May 2023 23:03:22 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAl-00BI50-0I for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:10 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAa-0008G8-IH; Thu, 18 May 2023 01:02:56 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAY-000wrw-H4; Thu, 18 May 2023 01:02:54 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAX-005UYx-Hb; Thu, 18 May 2023 01:02:53 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Patrice Chotard , Alan Stern , Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 58/97] usb: ehci-st: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:00 +0200 Message-Id: <20230517230239.187727-59-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1915; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ElCJMQt4cGChGckTd0HzKvzz4rhWCMP37gM23+PdldI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxu+agG4dxmeWJfHC+8maBQZIxJw7alF2D+N 4qYcmFCSR2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcbgAKCRCPgPtYfRL+ Tk9UB/9KrPatQVvww+nP/hDM6lGFkt0kh6+xJ0fsATqc65Vh7S//sGx0gg8EZ7+Kok44nc4Xhcr ZgDswmkd6fI5gwhfpoRqnQYjISnDHmaj5YRurFDcPMa1gCQ1jPfYTvT6UyzlMdFwev9Oh+1T7x7 PyeGok1sUM30WEG5B/Ek10lA/DwZ+AAhF4hM/rY2ixNrM9gSMCe86qs9/j7xbrynBHRXSklxdwY /aitToSvAnAML5iDPD6vVa+aAKGkZi/Q7ixIw5dov8PpxKHLgBvfwkmKTGxdRH5qLVYRvyBkg+6 DKEJVXh3jW7oAMhXvj/m0Q92QXUvZ8EBrbRRZ5FAV526sR2y 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160307_132272_1372307A X-CRM114-Status: GOOD ( 16.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Patrice Chotard --- drivers/usb/host/ehci-st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c index f731dc98c533..ee0976b815b4 100644 --- a/drivers/usb/host/ehci-st.c +++ b/drivers/usb/host/ehci-st.c @@ -252,7 +252,7 @@ static int st_ehci_platform_probe(struct platform_device *dev) return err; } -static int st_ehci_platform_remove(struct platform_device *dev) +static void st_ehci_platform_remove(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev); @@ -271,8 +271,6 @@ static int st_ehci_platform_remove(struct platform_device *dev) if (pdata == &ehci_platform_defaults) dev->dev.platform_data = NULL; - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -328,7 +326,7 @@ MODULE_DEVICE_TABLE(of, st_ehci_ids); static struct platform_driver ehci_platform_driver = { .probe = st_ehci_platform_probe, - .remove = st_ehci_platform_remove, + .remove_new = st_ehci_platform_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "st-ehci", From patchwork Wed May 17 23:02: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: 13245956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ECDA7C7EE2D for ; Wed, 17 May 2023 23:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/T7C/Ko45UneUBL3hbMwq7iB6inOAeBGH+ykYqLQI2Q=; b=fAyRYJBHeqR5yE rEUsEXmXQKoDrKHZYCK0mXfFTQxH08r4VHK9wAeZwHR7mtQov5AgVzzeV26KaokaMGSbhfXsQ28Ti Ky5Ok/RtixNP5y1E66zRR9rUkX8ydHkV9ogdhalkjAVAu5FtXO4FN/Pu+MIQRjGE/2+8LvrUZM0rf zaAnN/Z+tMphFXoEVbmw1sepPo3wDQOWi2ap3hCdcFfr3CRAj4nUQcG/xg54B4IyVQN0YoD5bIPgt gZyMgHtFu6Ypkr8amxbdZ2V+rez8GFVnEyOf6QqxW+liUu3FuNbof/bwWm9Tr5yB8A5koEWaIP5u9 gg04Kq2AQxlnFy+jqmaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBn-00BIrF-07; Wed, 17 May 2023 23:04:11 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAw-00BIG8-0f for linux-arm-kernel@bombadil.infradead.org; Wed, 17 May 2023 23:03:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=8N3VbOUieL/zeM6XxatcfRyZ2bU2t+3n3HJA4wB6+ac=; b=VH7sUKjBPi1VxICeUaG7c4w0Rp OdqIe4Pa1rLMtl8KvLTNjmYTzNvP0VjB4j+llMrrdeBsldKNKatR8qJ+VlHdWo5NkjHxzlw4OJfgV pAZn4Cyccl40WuND8YGqbMWmRwrmuNt/LZtGK0pwlVTOQ7B9QWSGBioGeVZCgsP4jx0YVWJ4ADf1t RebruIonq7zsJ4GZd2eGEYwFwPR76Kb3bvemoU1jg2zcj9m/UF3aaYQOmCXKp9Tq8pwFAPtCnjp7i IfT7CpRTs1wCAd0xeXsZKIg0iR9e3LF8Nu97BzMnPY61DPNwjt8f1VELHlCWnSAeE+0ufU90EcAVo b/VCD7dQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAn-00DMb4-2P for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:16 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAb-0008I6-A7; Thu, 18 May 2023 01:02:57 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAZ-000wsI-Ej; Thu, 18 May 2023 01:02:55 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAX-005UZ0-Np; Thu, 18 May 2023 01:02:53 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman , Michal Simek Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 59/97] usb: ehci-xilinx-of: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:01 +0200 Message-Id: <20230517230239.187727-60-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1951; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YGQBTpPXOgfPTC/rJCvHuTP8LurfHLFjMK2/4JY54cI=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUmPxzC5kWRkoXFk9J2RAoEyZ/lL8/I8Gm1v9azuK/a iHa9k6djMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAExkWjz7/3r2i4Kp6faOLJLd 9//NKGrL7Ij4dNZ2ocHV9/94Ys+6e961EfJnijifcezJll5hD/8tR7cWvr8icMbX0SNIb1aWn6i 1a6ve//XcfdGdOzzcTXcuNXpcZe0xd0mKbfjrL3tv3zG77rTk9eovol53CveGBlqXxV1h+SAfsP hj2XzL2BCfCIvXvIdvP7+493vey73GVyN0380sTUg399Hf/Kt3W7mrbZzW4km1yYkqdY3nqkr5w 1tDV3c8/5a5aWLN1HTtTm2ZL1+jIhv9HDnYlwk/SRKqvyYsXrArnFNwbaLhlBcyZ6X+rYvaMdP0 31uPlbc8f0ffXvzPJVbab0PUn4kZ+pLvjuqvz+2e6RcAAA== 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_000311_451328_50425C42 X-CRM114-Status: GOOD ( 16.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/host/ehci-xilinx-of.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c index 3d7893747835..a2112c28f631 100644 --- a/drivers/usb/host/ehci-xilinx-of.c +++ b/drivers/usb/host/ehci-xilinx-of.c @@ -201,7 +201,7 @@ static int ehci_hcd_xilinx_of_probe(struct platform_device *op) * * Return: Always return 0 */ -static int ehci_hcd_xilinx_of_remove(struct platform_device *op) +static void ehci_hcd_xilinx_of_remove(struct platform_device *op) { struct usb_hcd *hcd = platform_get_drvdata(op); @@ -210,8 +210,6 @@ static int ehci_hcd_xilinx_of_remove(struct platform_device *op) usb_remove_hcd(hcd); usb_put_hcd(hcd); - - return 0; } static const struct of_device_id ehci_hcd_xilinx_of_match[] = { @@ -222,7 +220,7 @@ MODULE_DEVICE_TABLE(of, ehci_hcd_xilinx_of_match); static struct platform_driver ehci_hcd_xilinx_of_driver = { .probe = ehci_hcd_xilinx_of_probe, - .remove = ehci_hcd_xilinx_of_remove, + .remove_new = ehci_hcd_xilinx_of_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "xilinx-of-ehci", From patchwork Wed May 17 23:02:06 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: 13245957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D6C9C77B75 for ; Wed, 17 May 2023 23:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xXr1ffuMuWZWH/Sg/Y99oAXzr/heYc5papStpZtX+WE=; b=a8hzEsFIbdqs3J 07pdhdQ0B/mWBfU2XwL/jegkXnFdlbrbDG+YfWGdXIUS50oCuahe3/hXrlgviwbic9LcZvITJ3a4t MVkcpq4GD6+Le7jhjzBIFF6+PBjf2fYXQS8NJtbNJSEvOGG+jFCt9Cy+WXWMWQSMU18Ny0/l4Ej1b iIU/511H+adKgXJJt44oTUJq+koUask44mq4yd+tFJ+D66ms/4YAN+C15HH6wXbbPVu2qj1Sr5K6H V39x8xjzJrGu8Agwb5r32cWwZhe6stNtf7bdVdbfm5wJ5HvBGYbE227v7usi2co3JTc53cX5gIZmi 5gGsIPfjhv8LHS2vye5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBo-00BIrv-0l; Wed, 17 May 2023 23:04:12 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAw-00BIGH-24 for linux-arm-kernel@bombadil.infradead.org; Wed, 17 May 2023 23:03:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=GQiDlMHYJ+VZYVrmejJe6tcgRfD2sNgZVS/ILwA5UmU=; b=djRLIaWbgcVNIb/F/JyxXjWweL lVXpkhNT1a/w0lTWtYzErRRN6KRYxs5RVvYtC8qFCd056b0o60F5OEL0D/3ueZs88irzvQ+J504rs 7nUJWZegAimlJppBjTqrJ61LiPnFOx3UPOBMpLp09bdGIY8owBEcgCFqLmps5Dzrv8aIKS6GXKeAe o/Q3iZsebr/iHsHqJBOUZX3ZJTCEq3joYD4yZsFIomI9G7WjU2NFn807KrDmtfosuNkvKClB3yIFX SZQmbkDW83me+VFHsz6oJQudgSqPrkOIgUzjJsG4u9IhB8IlBJkpRWoqN/ae+OiymY1h1xfvH6/j+ wEHm+c9g==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAn-00DMb8-2E for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:16 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAc-0008LH-Sf; Thu, 18 May 2023 01:02:58 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAa-000wsu-Uc; Thu, 18 May 2023 01:02:56 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAY-005UZL-OV; Thu, 18 May 2023 01:02:54 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-usb@vger.kernel.org, "moderated list:ARM/Microchip" , kernel@pengutronix.de Subject: [PATCH 64/97] usb: ohci-at91: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:06 +0200 Message-Id: <20230517230239.187727-65-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1997; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=pQgq9pUQpD7LYIQdFFv6qN96jLnJk6T/5ZPZG1XwZlw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyESJOA8OHeVR46Xd+pF/tfVoVZD+GH01re6 QegbgbxP+CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVchAAKCRCPgPtYfRL+ TnQkB/9/qROL2Kum4SAUk1GorGhA2yuCZ4D2wNA0jWQYzUNM78B0fEIWJvSicNEkkdAibHSao/o CyuFUUS2eybJnywFAG98wGlUI6EIiU5y02ZSIsEtGJK5K5Qph0njW1n8e5oGokbZuRplj/iLbN8 gI1iDUiWfCWnv9rVwciByn5GQAZHmsGv3NahTjT6MXlkt3GAXTGGzQq3xTBKdrm6HSUVJoO9fHQ sp+2FaQIXgGcICJY/dO7hNeenZ+yrbSi+RBGbUrZxT94j8h9ho0I69Q35WLPOTkJqW8i1lEya3J IV8j4mBHbWnHnEVXVsy7lUBwYIxJKOWEpX5+SFhfa3PcSmnR 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_000311_345784_FE102F5A X-CRM114-Status: GOOD ( 16.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Claudiu Beznea --- drivers/usb/host/ohci-at91.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 533537ef3c21..b9ce8d80f20b 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -599,7 +599,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev); } -static int ohci_hcd_at91_drv_remove(struct platform_device *pdev) +static void ohci_hcd_at91_drv_remove(struct platform_device *pdev) { struct at91_usbh_data *pdata = dev_get_platdata(&pdev->dev); int i; @@ -611,7 +611,6 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev) device_init_wakeup(&pdev->dev, 0); usb_hcd_at91_remove(platform_get_drvdata(pdev), pdev); - return 0; } static int __maybe_unused @@ -683,7 +682,7 @@ static SIMPLE_DEV_PM_OPS(ohci_hcd_at91_pm_ops, ohci_hcd_at91_drv_suspend, static struct platform_driver ohci_hcd_at91_driver = { .probe = ohci_hcd_at91_drv_probe, - .remove = ohci_hcd_at91_drv_remove, + .remove_new = ohci_hcd_at91_drv_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "at91_ohci", From patchwork Wed May 17 23:02:08 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: 13245954 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A0ECC7EE22 for ; Wed, 17 May 2023 23:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5hzwtZXJOeh2Mj+yVYFAWlsE/YSuwSORzdJNqGznS04=; b=mcl/RwxoARa7RC o8mTDLX4dnYO0s3z6R4CjAzJOlA417qfhcu2AOF4FSK5Un2JXzxFO6n6DjGQGM4eGBN7BvqP99o+J epglq8EOFIxKndefFb+bjK2mFk4qCvb/PAhlO9iaJ5nsRe3CchHcuzbD6kCvsP58sWd6Lsr3WF8qB 1A8to/hrByJQDPBjnsird1sI2lAQ8L/d7/EyF6C348o7xWzke+mLzm4p/5dfGR0ttrRm/bd++oKU3 vq+FhbAogZSBfXqwk4J8csCP/con81FWCunHmeyw2zeDD+3uugPbN02tVSD/Kfd0z3sssL3uKHNbo 7iVyxRarVdTusEyK0llA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBp-00BIuj-37; Wed, 17 May 2023 23:04:13 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAx-00BIGo-2B for linux-arm-kernel@bombadil.infradead.org; Wed, 17 May 2023 23:03:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=WlWem5FyxS9JQUF55nmEdzIoYd05FmkZe+pcH8JbmZY=; b=bk8JmP/jBnnQR1tpoRngyAXcp0 7apIUpPyK1P6qiOPdWPNfXhSOKahZ2BBxtr6Tnd7HTCNb8c0rZOaCYZcwxp4FhhzFvLV6FV4tIsvk +JRJkc7558l5nQ5t2qYYtfFo69w1uNAOEqNpjBIhQUCKoteErvFfnp2JMMwkKFwrICI24emqmVWIg nH35KkmtB1IseqmFCdJenxrkWnNKSU7j1Ymw52yMTO1uq1NJCZUhb1bOktDGjtFT4A/a5NbNI4dVT WbcBL2f6iiAbfrbcoXR84/ibfF+ZnqyksUhGQDfqQC4i5ucpQ+SV8zd9Ot/Lo573L64IyUMOruy0k 4fY5Fv8w==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAo-00DMb5-31 for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:18 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAc-0008Ki-Ow; Thu, 18 May 2023 01:02:58 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAa-000wsp-NZ; Thu, 18 May 2023 01:02:56 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAZ-005UZT-7V; Thu, 18 May 2023 01:02:55 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman , Krzysztof Kozlowski Cc: Alim Akhtar , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 66/97] usb: ohci-exynos: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:08 +0200 Message-Id: <20230517230239.187727-67-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1935; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tPXpr9QgihBH+YdWa24uJLMKDVOa26vZ+ybR9q2SfTo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyG3cPQmsiYzbdhA65NLk+eLFgHvSjLAOo7a i0gdAFsWDeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVchgAKCRCPgPtYfRL+ ToQzCACDDir0mX2kHzcxUS60rmh51cUz/ruyX82VXMkrqm/YaXXmAjHY2A13fHHCbxjCiZLbU04 8iety56X11z8YoLtkwlbIyzWwfNOLBX+I+QRZ3/XDAwLrvjUzBGkzqG4cNuyrfGVJUy55cPOv+d 7KySCMm9OckqCA84pPDD8HhKXMHVWC6EDHMy2wYpBIoGO3sVaJHo794FNZ5krYq6RcoA9haadKu WFf2UjhrLk00C/FrZqPEYsQaK7hG5N3j5bAgxwFyrRE1S7P0LCzrror2Ta7b3T99hb4+3YJ+C00 J5Fgs5Mt9EdhArf6Lr+Z9Xr6eytfSBOxh8CdPi8FAKva2SKn 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_000311_926970_403DA5EA X-CRM114-Status: GOOD ( 16.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/host/ohci-exynos.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 8af17c1ee5cc..ab31c459b32d 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -198,7 +198,7 @@ static int exynos_ohci_probe(struct platform_device *pdev) return err; } -static int exynos_ohci_remove(struct platform_device *pdev) +static void exynos_ohci_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); @@ -212,8 +212,6 @@ static int exynos_ohci_remove(struct platform_device *pdev) clk_disable_unprepare(exynos_ohci->clk); usb_put_hcd(hcd); - - return 0; } static void exynos_ohci_shutdown(struct platform_device *pdev) @@ -285,7 +283,7 @@ MODULE_DEVICE_TABLE(of, exynos_ohci_match); static struct platform_driver exynos_ohci_driver = { .probe = exynos_ohci_probe, - .remove = exynos_ohci_remove, + .remove_new = exynos_ohci_remove, .shutdown = exynos_ohci_shutdown, .driver = { .name = "exynos-ohci", From patchwork Wed May 17 23:02:09 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: 13245940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B02CC7EE2C for ; Wed, 17 May 2023 23:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zBPFKwMa0+xVxruCIzMnbweGDEqEfl8v0QytMp46hso=; b=qbc7J1bguaLusa YyPykHC4PZSqyMOq7EA6Ym0ACpW0GMEUdjCLU1nmCCv4/A+9JRAjl3h84YIzQSCCIDQYDFJC09uFZ htctTf1ipBV2vGfJty7xSQY6SSWfLATvjN5msbVszwxahGDPGHZSy63j/hnqt1yCHnOL2NAUZyYuZ ZFj6eiDPuWclm9qtiF04A1TRTBAfYu3MzfXJgeEB3m77ITyUv45GKTfwglZ2zXcSSw5lcesEpRazS EosvjFf/jAbJhfrz7RLnUmd+yZwfHf//riKbwvy2bPYtG/TY/uDUUX+WRQM+pHXWM/kluXUPoiRFW DelgYId/DSUxBIG2/eZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB0-00BIIb-2O; Wed, 17 May 2023 23:03:22 +0000 Received: from metis.ext.pengutronix.de ([85.220.165.71]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAl-00BI5o-1l for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:10 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAe-0008Oh-2p; Thu, 18 May 2023 01:03:00 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAc-000wtZ-Gw; Thu, 18 May 2023 01:02:58 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAZ-005UZW-DM; Thu, 18 May 2023 01:02:55 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vladimir Zapolskiy , Alan Stern , Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 67/97] usb: ohci-nxp: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:09 +0200 Message-Id: <20230517230239.187727-68-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1846; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=h7oAuprEWjC3/8xhmUO7guBCsplrTBMLffMOTy85L0o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyH1yQbkFw5cNu+1Avg8LKv5VTIPmdOiijid mcfD2kbYzOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVchwAKCRCPgPtYfRL+ TqwVB/wPGUOLU2nvajEW+60e+ycBAgXjJg/xaLMHQG3man0d2rF+t3F04+c2aKiQ6IDh8Lm7lJR zJjV0n8hUnwYKRv6FezYjtudEVlhE8xKde3Hp4pI9U+mMOIrNDE8JWD8ocvOghZMChoJ01dxXHP ELn5AMTru7KD1RwqtjlyAvXZsjb13AVHvjDLipEdYploadG/VOT+h0GTf/tQIimcb4qsCc/rwwe 69GmPMAFJE1srTkdYsGTwefnXzlgM67aGNzRlU3pMQa+bncwaxUDHyZK5Z/qujg7hIqBiYG6XnA bdmf7BQih3MMZNLJ1XYIx7Yo1WuvdfWt7lBv+asAyBdwOAFY 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160307_583936_0B85A10D X-CRM114-Status: GOOD ( 16.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/host/ohci-nxp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index 5b32e683e367..c04b2af5c766 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c @@ -237,7 +237,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev) return ret; } -static int ohci_hcd_nxp_remove(struct platform_device *pdev) +static void ohci_hcd_nxp_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); @@ -246,8 +246,6 @@ static int ohci_hcd_nxp_remove(struct platform_device *pdev) usb_put_hcd(hcd); clk_disable_unprepare(usb_host_clk); isp1301_i2c_client = NULL; - - return 0; } /* work with hotplug and coldplug */ @@ -267,7 +265,7 @@ static struct platform_driver ohci_hcd_nxp_driver = { .of_match_table = of_match_ptr(ohci_hcd_nxp_match), }, .probe = ohci_hcd_nxp_probe, - .remove = ohci_hcd_nxp_remove, + .remove_new = ohci_hcd_nxp_remove, }; static int __init ohci_nxp_init(void) From patchwork Wed May 17 23:02:14 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: 13245958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18F46C7EE22 for ; Wed, 17 May 2023 23:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YSS43fJvh6pBwbnUDXNJ9W1dZocfd1Zo3shBURZBwRc=; b=FkIHLR5gxMt+5K xMSUOJWKFknCHVvvkWZF3IfRijrjIp9IwmlwCsJqDF1K28fTOPRjYJNTponFa3kNJ5JV+s5mnFIoL ubGYLlpeunu6dxJmF7iVdFPxtV3N+zohAWSc3vnJid0O7P4WE43+C6A5+0xK7aLnouHZJWS2x4s+0 pmnw6NGwPpBHgiz3+lro0W4FIZcvyZFBuBPxO26R02rryMpekEscdEXzFNBdRyoQmitwgqzyYiH3P 8vkgaX+gLpXcI/PJkph1iJNXzt/et0MFfVfTH6MFDVLQGjUmr4RBdsubqxiXD1qAkxBMg/X8IHq+X cBtx1SZiwhsCSrfms3yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBp-00BItl-0v; Wed, 17 May 2023 23:04:13 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAw-00BIGI-2A for linux-arm-kernel@bombadil.infradead.org; Wed, 17 May 2023 23:03:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=NQACd+r5PPTtkeUexMR8hhLWVAXFGx8Tj1TbsKWSVzo=; b=CRQLi9TWRcY5hvf2CRAAGfBZOY wzAcalJDXVzesqDBbyMgTZ9SQhAr96ah42o1OZSjgpW7RrjKaxoj91eyox9HALAHl/EsTQrAxwY9c 0UDuLdi8aQX3gwJvjEn1cy1WMS9wOSqa/Aom0a9ws9SMWATEPE0fys39jup8BhtZCwqW+198PAgj/ l/rvO1Pm88CGiwuzzss3+fVIMECPHB/0ch8DiOnLmWM6lGX5/VANTIVYLRDBeeyjQ1Hr3A9mFwNWI ujUsJF0aLUWpG33X5swr5G/4buSbQv8fGXppkY2CXHb7yuTxjuFL7DcJXgsNG2F6YYcQiXo5cxpnb ovE8fr1g==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAo-00DMb6-0A for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:17 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAe-0008OC-2l; Thu, 18 May 2023 01:03:00 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAc-000wtP-70; Thu, 18 May 2023 01:02:58 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAa-005UZp-CP; Thu, 18 May 2023 01:02:56 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Krzysztof Kozlowski , Greg Kroah-Hartman Cc: Alim Akhtar , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 72/97] usb: ohci-s3c2410: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:14 +0200 Message-Id: <20230517230239.187727-73-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1921; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=M6mXoig1dWl/Ywk+GLiUxx2mru6fVHVmDiXl+L/3aFE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVycpkB4UYuUIQZso7pGfRKcNOnixVHRS5flO PZaUAr9m/CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcnAAKCRCPgPtYfRL+ TuYhB/0cC+JHseq+/EuztzA9TtWlzAvz2HwPEjvZIB8W8TU1dCQyMeOc/pkZ3Bm+4QobgF+CEMp YueaGkJNbKo/sJHDL/JmaWnNo0JmAwTQ7y54jV7fOMtlb6+927wuksUuqjSTOt6pw/++iq2oeYV Xa7GawlEHAcrB3ChiJEmejgCzQ4/l8sp4qN/Vk67cxW4q0mMYzFkw2Te8iUlHEkZqpXdIA1sQKS AoRn5IFLGqMv0bEQ2Rh3Tzkdt6B3kxdBG2cuKlf+IiSLNfOhF/+vJUm8rfwTEaKmMCDWrz7fSd0 6BHxhZ+w0vsgrYrwBRLT0Rv4l1yqRzAiXfmKHqVwG+vXmB75 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_000311_921029_A96A4340 X-CRM114-Status: GOOD ( 16.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/host/ohci-s3c2410.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 85a0a9ae0095..c5c9b4cbcb9a 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -329,7 +329,7 @@ static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc) * the HCD's stop() method. It is always called from a thread * context, normally "rmmod", "apmd", or something similar. */ -static int +static void ohci_hcd_s3c2410_remove(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); @@ -337,7 +337,6 @@ ohci_hcd_s3c2410_remove(struct platform_device *dev) usb_remove_hcd(hcd); s3c2410_stop_hc(dev); usb_put_hcd(hcd); - return 0; } /* @@ -458,7 +457,7 @@ MODULE_DEVICE_TABLE(of, ohci_hcd_s3c2410_dt_ids); static struct platform_driver ohci_hcd_s3c2410_driver = { .probe = ohci_hcd_s3c2410_probe, - .remove = ohci_hcd_s3c2410_remove, + .remove_new = ohci_hcd_s3c2410_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "s3c2410-ohci", From patchwork Wed May 17 23:02:17 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: 13245952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7B0FC7EE23 for ; Wed, 17 May 2023 23:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G8M0j3ucFjFtYODxutAxJSPglFd8Gnu3Zc3rBM3qyWU=; b=kgSql5TIh1WzbI im7shWujQH+V4cBZkeoITy3KlT/CgJ/yidgSR1+nWYVFu0HEXJUX/CdifutAtmArzgbjvBDsZKwZK A6jbZvtRbproZvTkLGlEDE1q/Ire0EFolHnoasnw5dJI7CL81wQth7+7TTFjsovvc194Orzm+e0WT Gvis7zmAFudp3oqoC8D4WPaDFAfnQr/ESA2nIQpa7PildQhG9v7DW55xpx36Eb57jJc+TkHjjDt8S DoYamKva3xekW0FFx0xDC1SESa/MuDPNYFHPbIhKMvYYir8bIVdgrSMZHa4IHNwchhDmYkn2hxSvW mVtQG9Vr7SWTg4+n0mZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBi-00BImP-30; Wed, 17 May 2023 23:04:06 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAm-00BI5R-20 for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:13 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAd-0008NX-RD; Thu, 18 May 2023 01:02:59 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAb-000wtI-Vo; Thu, 18 May 2023 01:02:57 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAa-005Ua2-WF; Thu, 18 May 2023 01:02:57 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Patrice Chotard , Alan Stern , Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 75/97] usb: ohci-st: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:17 +0200 Message-Id: <20230517230239.187727-76-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1924; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BBmPhAsUmHV/p4Ucq96W++LqeZYwSSfDcA27R0onG2Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVypZS5/JNvsIj6AJSdRuSGqgeercO9FPRVbT s9WCTwLXtSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcqQAKCRCPgPtYfRL+ TocDCACq1EWCGKrAHmEDDQVHXuif5+O+TDAhgKcJ0d3/663Z6JcojPNvYjrj/GzMEfcLkr+xnPr D8HCfkD2ogua5gEmG3KoddBRdS7Dua0YQbTagH1ZsFFc6A24YSa1XUB4Iv81wRiJ+b5Bw+RdVJg hZ5bljAMb/A5URZwKBQ6NAQ95Ncsyn/3/nsGAvLQk7p8EcxtkPT5QOsKPazhOQbq8mmCGpYBnlL EzfjmbxBzZjmG/m1HUMgYVgpa0FFYbMosml70TuMXCz27e03I0qpa2an1kHe34b4+16aHHVqaig 0DwGHGEvPDDzNiqBihvrNlftYcqYprZXHMbIGBIUxC1PW7Rt 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160308_761791_CACAC0F0 X-CRM114-Status: GOOD ( 17.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Patrice Chotard --- drivers/usb/host/ohci-st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-st.c b/drivers/usb/host/ohci-st.c index 82eef3c62e11..884e447a8098 100644 --- a/drivers/usb/host/ohci-st.c +++ b/drivers/usb/host/ohci-st.c @@ -233,7 +233,7 @@ static int st_ohci_platform_probe(struct platform_device *dev) return err; } -static int st_ohci_platform_remove(struct platform_device *dev) +static void st_ohci_platform_remove(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev); @@ -253,8 +253,6 @@ static int st_ohci_platform_remove(struct platform_device *dev) if (pdata == &ohci_platform_defaults) dev->dev.platform_data = NULL; - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -306,7 +304,7 @@ MODULE_DEVICE_TABLE(of, st_ohci_platform_ids); static struct platform_driver ohci_platform_driver = { .probe = st_ohci_platform_probe, - .remove = st_ohci_platform_remove, + .remove_new = st_ohci_platform_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "st-ohci", From patchwork Wed May 17 23:02:22 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: 13245953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFC48C7EE2A for ; Wed, 17 May 2023 23:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EFZwreHFPR5WBf9T54nLpMdso8P1l5uQs4wIB+MZmdE=; b=t51ntNryF/Ys6r o/4fINO1FIaL/ev9TkK8W5yof0v6VxhaW7fo6ktApose9UrisCScNptmabSIulzL/NRHZnxS5fNyl lGMTEJmqvGY+pvvlBNDvg+CE3OtWNQxVGQdZ3zWpH4/s2keicW2LXKrZx/TrqCAjxy2+12KIv7vsN G+hQZD6GkID7mS//865uhUarJcYmWqI23Qv9xxZ4grbWnF7DXbCxpg15QiXwZ2pwQkSbQjmxlmc7H vNCQTAYjYzT5adjM+uNL0M1+2Ro33TFBzRLmMyHK4esUBxKUTKhsACTtfu3DlCRE5yrN4MQ1QOC6F 5JUC0oPse/vkQ0yynM2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQBm-00BIpx-0V; Wed, 17 May 2023 23:04:10 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAv-00BIFc-1B for linux-arm-kernel@bombadil.infradead.org; Wed, 17 May 2023 23:03:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=jncjnoHBvah0A3Q6496m0f+paqPYAEesfstycI9uWBQ=; b=eBl2ArwsedrJ/TSqOMTs6yEu76 EhgIL4ECDVV2e6sTsZ5gFr5kg3penbtKA6XOxWabMDKQUC1CrMPkVsbQrNF2NAzLtkley4N9O3nnH UeJlJYW4wibEPdubyTHQbkpjIIZFWMCfKz8i53JVO1GjR7YJ50tCMmKhLoLWtEb4f91IQ0EoBVqrW Hfe89OKgDGRIBLuaerh0pBc7S0n3pNPFXWAaKpkzQlKOYRxEH3cNTaIWucUxiQVIrG/GWvDjsc+II XzyhTcqB64zt5A9qEWz1YWj29QVgmESJ4HM1M9xBFeITRMIotd6T1LRieuSKgFPkkdAwKjsm4sCEB QulV36Nw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAo-00DMb7-1L for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:15 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAe-0008QG-Cf; Thu, 18 May 2023 01:03:00 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAd-000wtu-4t; Thu, 18 May 2023 01:02:59 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAc-005UaN-7R; Thu, 18 May 2023 01:02:58 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 80/97] usb: uhci-platform: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:22 +0200 Message-Id: <20230517230239.187727-81-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2000; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nq5llLRtqxTeiCKz9CiVLPyrxx2u5Rt3ymD7c+iJv54=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzH302yAan/O1jyQoTcbj/aa5B1roPiaHX3+ IB0GO7woo2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcxwAKCRCPgPtYfRL+ Tq8BB/41xDNLk+plWzrriMOagRBjZhMeUi9C1CKrQ6/ohvJjferkSwQ2fThmFJ87iYTTo/FrT5F 2+mM7xTWcwL4/FmXpBzfIsV/LXqpqgJqIO+SOnxCxfwAIPaGebrfvMiO36+MzzDZoAoi2fgyIb4 LfO7ZpEIhcsusLrKqCb457APiqtou7TgcCH9HWOdYS2Jv+gKY/56AJgVqo2XnHIdNdgPSWebv3i kPtKIK8cBjcJRcQGGKK3nERCGVgKrPQZ6dMPbK3VLuvKqfqwTfECnf5zSX3vd5DzjEDdcGUf+rP W2Sn3JgrtJtucucbf0jvMHe5jhI28PXkmDEilAXlDWhLB5bj 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_000311_670883_F89913DC X-CRM114-Status: GOOD ( 17.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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/usb/host/uhci-platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c index b2049b47a08d..71ca532fc086 100644 --- a/drivers/usb/host/uhci-platform.c +++ b/drivers/usb/host/uhci-platform.c @@ -152,7 +152,7 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev) return ret; } -static int uhci_hcd_platform_remove(struct platform_device *pdev) +static void uhci_hcd_platform_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct uhci_hcd *uhci = hcd_to_uhci(hcd); @@ -160,8 +160,6 @@ static int uhci_hcd_platform_remove(struct platform_device *pdev) clk_disable_unprepare(uhci->clk); usb_remove_hcd(hcd); usb_put_hcd(hcd); - - return 0; } /* Make sure the controller is quiescent and that we're not using it @@ -187,7 +185,7 @@ MODULE_DEVICE_TABLE(of, platform_uhci_ids); static struct platform_driver uhci_platform_driver = { .probe = uhci_hcd_platform_probe, - .remove = uhci_hcd_platform_remove, + .remove_new = uhci_hcd_platform_remove, .shutdown = uhci_hcd_platform_shutdown, .driver = { .name = "platform-uhci", From patchwork Wed May 17 23:02:24 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: 13245939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AC51C7EE2F for ; Wed, 17 May 2023 23:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/bawkej6rHLFievy5F75j9HCN/8EwkpIlOaVR8zzmns=; b=RndxP2LUo6ZL3U DOcJWpcc29PJ5lYUGI67wf9mL8e5GrJlEMKpUebAY2pXlJ2jhRY9CSXU3TYPGK3mx3YAHVI+4wZEr i5d18txPKRozEJj8dLJGoFqTgl6RhYDXbkgaJal/Wkn+u5QzPSEgIQRhRWeeCH1BOoQZrTBfZ7OT0 dcj9GvgTfC+e2kKZFDidbdCWhKi8OSNfsUHrkBZxqK5yHQuD5GX19zryrDK+OoNW4Hcejb/8pueDY FzPun+ig1XNrrQ6/1L+KRBXc2oohr5WltjW4B1eo5vrUeznq4IOiJJxJdeBxePCHqaCu+Cgi8Oofq g+95IRbFl5xEEmRYAj+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAo-00BIBT-1v; Wed, 17 May 2023 23:03:10 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAl-00BI6a-04 for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:08 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAe-0008TN-QY; Thu, 18 May 2023 01:03:00 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAd-000wu6-Kp; Thu, 18 May 2023 01:02:59 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAc-005UaW-Jk; Thu, 18 May 2023 01:02:58 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Chunfeng Yun , Mathias Nyman , Greg Kroah-Hartman , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 82/97] usb: xhci-mtk: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:24 +0200 Message-Id: <20230517230239.187727-83-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1879; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IWOiTw+ADVbwJ5rlc3EcBNPlmG8kb/fjXta3x5EI4Rw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzXNaMSHdEtEKzzkk7w5YQwFiIbWHuqlshQu nviguL8UOyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc1wAKCRCPgPtYfRL+ TnUqB/9BjFkMWnUO3mbVr1gawKFsFbBa5GW+4ZsmVAoidMHlv3ANo36hWRe07WCL+I9GnPCV3ps saEbyk+f28aVcnSXBOS6yCIMwcZJjGHJRvKKDebT402O+9ypyOfQdf2XbmmunPKXPgJ7Q/8IHFy uJUZmQbbJNMRqOvjdjtlvRuU3qKU+phMWrWdt3AawKBhhmQqmzeky7ekTODZ49sc1nAUkW+cGyv T4uqWotn9Yl1Qhy0seO1FT8pRKAdrozLK64FnCEJwONY4s3N/e2vlNi2L0wCeHC/IeDrjbYsoMa wGzu00nORwTWjj/GQCAFD7HulTf92L9YyxtRscoqCcLL9ExD 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_160307_061479_C9137D96 X-CRM114-Status: GOOD ( 16.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: AngeloGioacchino Del Regno --- drivers/usb/host/xhci-mtk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 90cf40d6d0c3..8d9a55b0281b 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -673,7 +673,7 @@ static int xhci_mtk_probe(struct platform_device *pdev) return ret; } -static int xhci_mtk_remove(struct platform_device *pdev) +static void xhci_mtk_remove(struct platform_device *pdev) { struct xhci_hcd_mtk *mtk = platform_get_drvdata(pdev); struct usb_hcd *hcd = mtk->hcd; @@ -703,8 +703,6 @@ static int xhci_mtk_remove(struct platform_device *pdev) pm_runtime_disable(dev); pm_runtime_put_noidle(dev); pm_runtime_set_suspended(dev); - - return 0; } static int __maybe_unused xhci_mtk_suspend(struct device *dev) @@ -824,7 +822,7 @@ MODULE_DEVICE_TABLE(of, mtk_xhci_of_match); static struct platform_driver mtk_xhci_driver = { .probe = xhci_mtk_probe, - .remove = xhci_mtk_remove, + .remove_new = xhci_mtk_remove, .driver = { .name = "xhci-mtk", .pm = DEV_PM_OPS, From patchwork Wed May 17 23:02:35 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: 13245960 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81074C77B75 for ; Wed, 17 May 2023 23:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SyUBZ26UlCU3xgNuigTBmGRqZIms3OngAvurcgAx4v0=; b=izoyyaK7sEzX3G OEw71AL0m7RuW67wC0brrmJmDWrTtmhGk2+bkbf3O3TT7pUIyYdhthV+I1maTcZzU3/Wiqyc42ouf T07hiVV7S1LOqLuBLaihS8eSzw9y3DLdLIkOZietfkDAuM351B51ND5MFWabPMZ2YjVU1Yy84dNPp 8q8Iuafip3Qc0EsKzrOZmRUuEl+clwuacp3162rBwGv5yfyOFnavHM1oQuNcGrOwN69MKJnpyiQwF 1NhUvMkXKRStP5yz56nCJlAUyUatALX12oG14mWxruAuSNEe3dHEtlOseWLqvlpBwRF7PvsOOTn53 i4fOpV/DVgUOSOzWEydQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQC3-00BJ9t-1D; Wed, 17 May 2023 23:04:27 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB1-00BIIM-0P for linux-arm-kernel@bombadil.infradead.org; Wed, 17 May 2023 23:03:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=rZhHs5IBSnF7twGtCiE4/1bbJLTiTIs9dYau51NH/W8=; b=RhcyI85UxDYJ+DYC6yhNTnWZ/X SlhUmZMxWTrcJd0VKLWvHQvGGTD2ZfYxfw3lqwBl/9kRSPH8tyWzFaKLEo9LlWT0qUT3tTd+YoFKG QypHWgJGohkZGMPi8bMsAafSuR1EIC2qNskGsYgAV/ilJlcVSZD5yKL32ZKqwK+ywObc4i2+ATkfZ ptMz9WjPSHxWS7xXJWP7C2nYptF7ZNuFYORJq+QVNTii2Ex4fC206UQSgjhDGslXJq43fGN4Odqxk e+k66IXkEwocprZSg1qLhWgV6S7iPd823uLOWdYbgTwv3dzQZ+K5kZuf+WBpRKu+3i5A0A9+0mf2a XuEvwCWA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAx-00DMdB-1V for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:21 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAj-0000K3-P3; Thu, 18 May 2023 01:03:05 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAi-000wvB-PP; Thu, 18 May 2023 01:03:04 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAh-005UbK-Lz; Thu, 18 May 2023 01:03:03 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-usb@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 93/97] usb: typec: tcpci_mt6360: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:35 +0200 Message-Id: <20230517230239.187727-94-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1805; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bEdst6MD6puVUki4whk5sb3nOk+/3DbRlQ9P2NLa0vI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVz4VYtPTKBqZJpxoZlbuUh64Qn01uJ/nTzuO vqgpIvQ7v6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc+AAKCRCPgPtYfRL+ TpHLB/48dbh7ghFa8RD1QJmXpnHzZgodSzLEhfR1gkVzCpzopPARENWaxJMDXY1ifb5ovC7G/8r ycWPAnynUGtCxBy2K5g339EMm9un3b9xIgEfgUla4DJ+UJNiKm7uE6I5xkDhkQiP5cUtAfwMart WVjV6680jdQYF4MhMOApZsDeT3FlIiy2sAX79G4E4/IXfXm17J6xUdiCxfmpQ/JRgI21+zLoFTV Y0hTt5HxormOp5Erhpwl1sRg06pvJejI4KS6hxL4h63c9SWBEwyTWwisUiLgxymIZqZVyVWUYko 6+isnRPorzPN5LHRLQhruTYlUFLBqKiCSeyGtrNgsn/VrY/I 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_000320_032133_9095CBE0 X-CRM114-Status: GOOD ( 16.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Guenter Roeck Acked-by: Heikki Krogerus --- drivers/usb/typec/tcpm/tcpci_mt6360.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpci_mt6360.c b/drivers/usb/typec/tcpm/tcpci_mt6360.c index 6fa8fd5c8041..02b7fd302265 100644 --- a/drivers/usb/typec/tcpm/tcpci_mt6360.c +++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c @@ -178,13 +178,12 @@ static int mt6360_tcpc_probe(struct platform_device *pdev) return 0; } -static int mt6360_tcpc_remove(struct platform_device *pdev) +static void mt6360_tcpc_remove(struct platform_device *pdev) { struct mt6360_tcpc_info *mti = platform_get_drvdata(pdev); disable_irq(mti->irq); tcpci_unregister_port(mti->tcpci); - return 0; } static int __maybe_unused mt6360_tcpc_suspend(struct device *dev) @@ -222,7 +221,7 @@ static struct platform_driver mt6360_tcpc_driver = { .of_match_table = mt6360_tcpc_of_id, }, .probe = mt6360_tcpc_probe, - .remove = mt6360_tcpc_remove, + .remove_new = mt6360_tcpc_remove, }; module_platform_driver(mt6360_tcpc_driver); From patchwork Wed May 17 23:02:36 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: 13245959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8FB2C7EE22 for ; Wed, 17 May 2023 23:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ivLJLgCgm24oGpbyf0dljm9NSGqkzGEX5zkKI9IRoZU=; b=ad/8WRYSphnWT6 0xDwHTqURunqyr5fPQAzWeHr+6vZXgkS5GfeoPT2/jYhSFr4zz8oSjCXqpOtY0g0UCpq3i5IXtcac YUJiItHoEUmDER5pxbTX8kiXAolJD8cI6R7LYnborKJ2isWYZdhkTzr/+0KiFD2e0Y2wm7lP8jnfQ 8F+Dv06wAahCtAN3AvRgjpjcHsOFR2wme6HtcaFZZxC5TvguMTyK0pUirNTmiSdp65tvsc6in1drY 2l28wSOZxQkpR0UU7ZM86t2PjxWcAlWmVg7TawmdyXTvi+mcIX3p0FwAigGPsph8ZwfbMRyxUJDZG YMAEQDB7MHbZs2a3D9uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzQC4-00BJAx-0f; Wed, 17 May 2023 23:04:28 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQB1-00BIIc-1T for linux-arm-kernel@bombadil.infradead.org; Wed, 17 May 2023 23:03:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=C9xgshEJtW6bjuO9yE8z4GpA4Hfw411DYsKAZSnJX9Q=; b=iFsa3DhdjB0WU2DlR7zJW1a6Nk 06gxRy4NhXv8fe58mxcxm+E+AL2Nx2MCr5Azg8RGeGt2SSeS8NAIwaZfnlPlGZii26UwTUPtqMH6W qScfgDw4GEra3D+kRRtJkIDL7FUusl1RjrZ82Y/zW1z11O6BgNEmFui7w2TiX/K5GSmXp5GlUvmaA kS4D5JkWGraCq3SLlzJWk6o7uZmrbgjs2cdGbmGAk9WRgLodLDPDGQ/HVsCJ3bO7wlMsAP8TGZcsI yGUXQx6GW3ZmQvATUcvM2Ix0BZ+zW5UjWo7Zw/qTwM27oUemSD1hpKTdVS59UeCb47IqGkYT70lNh rSvLCIcA==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzQAx-00DMdC-3D for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 23:03:22 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzQAj-0000Ji-P5; Thu, 18 May 2023 01:03:05 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pzQAi-000wv7-Jy; Thu, 18 May 2023 01:03:04 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAh-005UbN-Ti; Thu, 18 May 2023 01:03:03 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-usb@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 94/97] usb: typec: tcpci_mt6360: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:36 +0200 Message-Id: <20230517230239.187727-95-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> References: <20230517230239.187727-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1763; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ySuLhF08/2hdk62A9ACfiAgi7gCczjq8XSfTGIJpywg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVz+8PYwX2lrDs+Qf8KByZmrjGyD10wS7UFA1 Oh8O9pZRfqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc/gAKCRCPgPtYfRL+ TlJ8CAC2GJLqxGYleQ1mGLAx+k6RSWPZXL4n2QpFoJZITUa1mqFClasT5/I22TKMcbAQ7Q83gH3 HPfCNNri+Jnu/mBrTLOaJFO3EY1bewAauiyKsLIgUoIjNlT/dg18VISgnTTFEy8NLHhYzjIL6xI jFcws8gdn/kwxMrqb+CSC/u3k1QNAdgYMdlSX9SLIyAmBuwPjBT+BL78VLNNEOAwRJTHT+tLT7G ME9+jO4hkRFx5L65OkRD0f4av0MXwtf+qFHcLreFu9TAPtiwpR8PALIe4tcsYVR5vRKesUyvVCy q3mThNI9igqVmFFgkT5EZL8uZGgesbhsYI3qqYpGc8zDQtgs 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230518_000320_372460_20D7E1E6 X-CRM114-Status: GOOD ( 16.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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() 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: Guenter Roeck Acked-by: Heikki Krogerus --- drivers/usb/typec/tcpm/tcpci_mt6370.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpci_mt6370.c b/drivers/usb/typec/tcpm/tcpci_mt6370.c index c5bb201a5163..2a079464b398 100644 --- a/drivers/usb/typec/tcpm/tcpci_mt6370.c +++ b/drivers/usb/typec/tcpm/tcpci_mt6370.c @@ -178,12 +178,10 @@ static int mt6370_tcpc_probe(struct platform_device *pdev) return 0; } -static int mt6370_tcpc_remove(struct platform_device *pdev) +static void mt6370_tcpc_remove(struct platform_device *pdev) { dev_pm_clear_wake_irq(&pdev->dev); device_init_wakeup(&pdev->dev, false); - - return 0; } static const struct of_device_id mt6370_tcpc_devid_table[] = { @@ -198,7 +196,7 @@ static struct platform_driver mt6370_tcpc_driver = { .of_match_table = mt6370_tcpc_devid_table, }, .probe = mt6370_tcpc_probe, - .remove = mt6370_tcpc_remove, + .remove_new = mt6370_tcpc_remove, }; module_platform_driver(mt6370_tcpc_driver);