From patchwork Wed May 17 23:01:03 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: 13245841 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08105C7EE22 for ; Wed, 17 May 2023 23:02:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbjEQXCr (ORCPT ); Wed, 17 May 2023 19:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229678AbjEQXCq (ORCPT ); Wed, 17 May 2023 19:02:46 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79C8F44A8 for ; Wed, 17 May 2023 16:02:45 -0700 (PDT) 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 1pzQAN-0007jA-QI; Thu, 18 May 2023 01:02:43 +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-000wna-1L; 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-005UVJ-9T; Thu, 18 May 2023 01:02:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 01/97] usb: c67x00-drv: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:03 +0200 Message-Id: <20230517230239.187727-2-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=1739; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hPZfHp02+Vw04AFiKV3JOnpPcnGBs9VthvWfAFQ8oxI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVvrY0leO0Fw+vm+tEqXqqU/v8R+H4VcsNaID lFYOzo+PaCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb6wAKCRCPgPtYfRL+ TrrLCACjffi1vVdN+eYClFjsaiJzarpQH72TbWk8zAHxgOIQk+IvHScD7UnFrxqkJ+iOsMq0NpP q8tGt5GKjp/KrAsTmObMd065U40K/f3MIsKDoqeTWre3ccjMLseZLaqIdceNwX6qC0iMd5mCFIr n4gjQFUOdeZcPgdy1Tm5IFjEL/iLVnwAUHq4Mf0v0fVdlzP7gJT1OjjvDh09Sy6WIzJebbRDRPA 9mp6HzIkguMhQU2VtpIfwfG+E315lDUzbBjAcHLj9HdfXLmGSQH48mXyNS+bWFvC2tB+EGefKjs K1Q4jJEKa2W4FpAeu1qr25lOsrR/hkTUZIrKI0y1vGQyi+Ux 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/c67x00/c67x00-drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/c67x00/c67x00-drv.c b/drivers/usb/c67x00/c67x00-drv.c index 6db5cb1b2dbb..bb9d5d7ffefc 100644 --- a/drivers/usb/c67x00/c67x00-drv.c +++ b/drivers/usb/c67x00/c67x00-drv.c @@ -177,7 +177,7 @@ static int c67x00_drv_probe(struct platform_device *pdev) return ret; } -static int c67x00_drv_remove(struct platform_device *pdev) +static void c67x00_drv_remove(struct platform_device *pdev) { struct c67x00_device *c67x00 = platform_get_drvdata(pdev); struct resource *res; @@ -197,13 +197,11 @@ static int c67x00_drv_remove(struct platform_device *pdev) release_mem_region(res->start, resource_size(res)); kfree(c67x00); - - return 0; } static struct platform_driver c67x00_driver = { .probe = c67x00_drv_probe, - .remove = c67x00_drv_remove, + .remove_new = c67x00_drv_remove, .driver = { .name = "c67x00", }, 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: 13245873 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02C12C7EE22 for ; Wed, 17 May 2023 23:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229769AbjEQXDQ (ORCPT ); Wed, 17 May 2023 19:03:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbjEQXDA (ORCPT ); Wed, 17 May 2023 19:03:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 348483AB3 for ; Wed, 17 May 2023 16:02:58 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:05 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: 13245865 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 991DAC7EE2A for ; Wed, 17 May 2023 23:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbjEQXDI (ORCPT ); Wed, 17 May 2023 19:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjEQXC4 (ORCPT ); Wed, 17 May 2023 19:02:56 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 396DA49C1 for ; Wed, 17 May 2023 16:02:55 -0700 (PDT) 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-0007jC-VS; 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-000wnl-GJ; 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-005UVP-Lf; 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 Cc: Roger Quadros , Aswath Govindraju , linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 03/97] usb: cdns3-plat: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:05 +0200 Message-Id: <20230517230239.187727-4-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=vdKSgUZZ4+0Kc2s0BPzhsIKgtcMeZ+DFMYp64Me5948=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVvtrf8iU45REOXG34wNsRZ37Vv0jkCk0R2dO GdJr+kLV9yJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb7QAKCRCPgPtYfRL+ TllbCACUew+1Z5EhahdGSPphfH+9RKOjuDAFvt8fKh5MRafld2wIZ6IA8ujeAvTWCOuE/xgeI4r p89bbBgYc+dM3yBYn0plDtlT8CKQtVFIMSVDjcXXatBbmSwIzDDI7BJYYzbduRxnqt2/MxsSNC/ oW6VEuV0vaanj2tsu8nn+KzRgWPrQnVoqn3TTJA9fJFYPzqfU9ROAHKtJTNSaybEYG0B3+9RUDt 4gUD1/DdO7yvWbloSvCO6agR/S3HVTlaOAegzaKvmTorQMX5vfxslNquOHUuw9dA0f2Nl9VsFmh /ywiksj6AN1qxa+2xauTb3zRoN6Jb9fdnHWCMDtgBSfhMAMX 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-plat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/cdns3/cdns3-plat.c b/drivers/usb/cdns3/cdns3-plat.c index 2bc5d094548b..884e2301237f 100644 --- a/drivers/usb/cdns3/cdns3-plat.c +++ b/drivers/usb/cdns3/cdns3-plat.c @@ -175,7 +175,7 @@ static int cdns3_plat_probe(struct platform_device *pdev) * * Returns 0 on success otherwise negative errno */ -static int cdns3_plat_remove(struct platform_device *pdev) +static void cdns3_plat_remove(struct platform_device *pdev) { struct cdns *cdns = platform_get_drvdata(pdev); struct device *dev = cdns->dev; @@ -187,7 +187,6 @@ static int cdns3_plat_remove(struct platform_device *pdev) set_phy_power_off(cdns); phy_exit(cdns->usb2_phy); phy_exit(cdns->usb3_phy); - return 0; } #ifdef CONFIG_PM @@ -320,7 +319,7 @@ MODULE_DEVICE_TABLE(of, of_cdns3_match); static struct platform_driver cdns3_driver = { .probe = cdns3_plat_probe, - .remove = cdns3_plat_remove, + .remove_new = cdns3_plat_remove, .driver = { .name = "cdns-usb3", .of_match_table = of_match_ptr(of_cdns3_match), From patchwork Wed May 17 23:01: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: 13245861 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D827BC7EE2A for ; Wed, 17 May 2023 23:03:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbjEQXDG (ORCPT ); Wed, 17 May 2023 19:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjEQXCz (ORCPT ); Wed, 17 May 2023 19:02:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4201E5276 for ; Wed, 17 May 2023 16:02:54 -0700 (PDT) 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-0007jM-VU; 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-000wnq-Nc; 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-005UVS-RB; 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 Cc: Roger Quadros , Aswath Govindraju , linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/97] usb: cdns3-ti: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:06 +0200 Message-Id: <20230517230239.187727-5-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=6cHGFuDRubMo/u0j3jZfx8+HrU/cy2x3P5NC9anFvQ4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVvu+f00qSOpUuD3O7MJA56NyCrcwdHoSU6/x eYfla52PXmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb7gAKCRCPgPtYfRL+ TgghCACH/QHPokUz83rM2cp9biyR31BM9NVl5LNivkeYmIQl406VzyHdFnscBtkP/OSv/YjStIu rvmp0yrSbzDZjsHJbuc3FgeCGVdM6IWmgcGNk2wf5i2HKCzYiTBP+iUCFeooJ1BscbE35KiGU1r 8CwMJyOG7KonKvavj24zFYbuUb+mgcE1Q93ywFKSlEZIDwu/xulQkxWcgEXF3ju/bfNJpezJ0OH JcEacKdOq2VbFRQ0XFl2ryFGCKZBKo9EQ+nJpzOVxU7zkWa94uarJzOuzG/R8bP7tRgqRh7sU9R akwgnNm/+uVJAXYYAg8pR6VvL3wlOCvLOFXP82DeMVLSnBHX 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-ti.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c index 07c318770362..81b9132e3aaa 100644 --- a/drivers/usb/cdns3/cdns3-ti.c +++ b/drivers/usb/cdns3/cdns3-ti.c @@ -199,7 +199,7 @@ static int cdns_ti_remove_core(struct device *dev, void *c) return 0; } -static int cdns_ti_remove(struct platform_device *pdev) +static void cdns_ti_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -208,8 +208,6 @@ static int cdns_ti_remove(struct platform_device *pdev) pm_runtime_disable(dev); platform_set_drvdata(pdev, NULL); - - return 0; } static const struct of_device_id cdns_ti_of_match[] = { @@ -221,7 +219,7 @@ MODULE_DEVICE_TABLE(of, cdns_ti_of_match); static struct platform_driver cdns_ti_driver = { .probe = cdns_ti_probe, - .remove = cdns_ti_remove, + .remove_new = cdns_ti_remove, .driver = { .name = "cdns3-ti", .of_match_table = cdns_ti_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: 13245858 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4059C7EE23 for ; Wed, 17 May 2023 23:03:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbjEQXDD (ORCPT ); Wed, 17 May 2023 19:03:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbjEQXCz (ORCPT ); Wed, 17 May 2023 19:02:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE2615270 for ; Wed, 17 May 2023 16:02:53 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: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: 13245843 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45DDBC7EE22 for ; Wed, 17 May 2023 23:02:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229707AbjEQXCu (ORCPT ); Wed, 17 May 2023 19:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjEQXCt (ORCPT ); Wed, 17 May 2023 19:02:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F0E84C02 for ; Wed, 17 May 2023 16:02:47 -0700 (PDT) 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-0007jO-NA; 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 1pzQAO-000wny-1P; Thu, 18 May 2023 01:02:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAN-005UVa-96; Thu, 18 May 2023 01:02:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Peter Chen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/97] usb: chipidea/ci_hdrc_msm: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:08 +0200 Message-Id: <20230517230239.187727-7-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=1934; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=RORguVK6mnzE5lSxME4akuhf14yhjd2E0pj7rGc3qoc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVvxTm4DpzI6LCt/oGN1BqrW1r8W2NdgPSGcF WXHkRiH2Y+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb8QAKCRCPgPtYfRL+ TjthB/9BmQUqZ4aygaUbjlnsnWZ0iGUiU81V8bhweerxtmlR14UlKXoCWOFgYStNvQpVXIa++k9 wG8k4qS/fD4HjF0IEmAf6Fju65Tn9lGNw9k9kzYGPBiYEEW0I0WuwdYyGkEagWG2aw8hldcO1o1 dElcxuq9CD+rP61veYxIkYa+zQCLV/rUItoZEKmfRKCuNUZAuJQr5i3WOhSudtwp1dAMKn5WiRD bq/D/QJAoULTJMEfEvVOb3fFYGHZwrDRqXN3yzcj2XEA1HFN9RVOP+hoacZUffXqmjykRLKfY3l IGcfYjp2O1VZhV2Ii95WE61CWdGCth/dG89v76brkwxM7JtW 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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_msm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c index 46105457e1ca..7b5b47ce8a02 100644 --- a/drivers/usb/chipidea/ci_hdrc_msm.c +++ b/drivers/usb/chipidea/ci_hdrc_msm.c @@ -274,7 +274,7 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev) return ret; } -static int ci_hdrc_msm_remove(struct platform_device *pdev) +static void ci_hdrc_msm_remove(struct platform_device *pdev) { struct ci_hdrc_msm *ci = platform_get_drvdata(pdev); @@ -282,8 +282,6 @@ static int ci_hdrc_msm_remove(struct platform_device *pdev) ci_hdrc_remove_device(ci->ci); clk_disable_unprepare(ci->iface_clk); clk_disable_unprepare(ci->core_clk); - - return 0; } static const struct of_device_id msm_ci_dt_match[] = { @@ -294,7 +292,7 @@ MODULE_DEVICE_TABLE(of, msm_ci_dt_match); static struct platform_driver ci_hdrc_msm_driver = { .probe = ci_hdrc_msm_probe, - .remove = ci_hdrc_msm_remove, + .remove_new = ci_hdrc_msm_remove, .driver = { .name = "msm_hsusb", .of_match_table = msm_ci_dt_match, From patchwork Wed May 17 23:01: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: 13245851 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 577DCC7EE2A for ; Wed, 17 May 2023 23:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbjEQXC6 (ORCPT ); Wed, 17 May 2023 19:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbjEQXCu (ORCPT ); Wed, 17 May 2023 19:02:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9807644A8 for ; Wed, 17 May 2023 16:02:49 -0700 (PDT) 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-0007jP-Uf; 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 1pzQAO-000wo2-6w; Thu, 18 May 2023 01:02:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAN-005UVe-FE; Thu, 18 May 2023 01:02:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Peter Chen , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter Cc: linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/97] usb: chipidea/ci_hdrc_tegra: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:09 +0200 Message-Id: <20230517230239.187727-8-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=1873; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=63EJH4zRsCAjlTv4RDoaAYXCVSSuGmy2m/pYbXft39w=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVvyd0xAS4oiawnNnBIBolnhuu6gA/budC0kj mFUzAqAS+eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb8gAKCRCPgPtYfRL+ Tm2mB/9b+GjpuX9eU1nNGpdCu2vaONp+Sn2UlIT9vacUTcES09oPmfhxhYg2JhCK5BdLpKsGY4W UUo5Oo1eQkwRoSl1aYc5+uJi34x6f8R/OsTX9XoCJe6LDHZIZFwKPxWDgkMgAtWSOTG2f0CoWBJ AteK7LtmdqOEIGlSQVcf0utsI44ja4bPbvq3GwtBlIrpBNgjVHWLH5Z80lQQRo9cK6rvA4wbRJO 6AM/S/t9n+EbqLQy2NBwuF+vwbAbR1h2HjmeBMYMu+DwBlB2QVRKp9H7zv9uSuCsFFNtS9XImY5 2F+JElzNLaGCp6+PV3S4cb+BcWHG+7/0b7e/eHFmmHvy9Xlr 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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_tegra.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_tegra.c b/drivers/usb/chipidea/ci_hdrc_tegra.c index a72a9474afea..ca36d11a69ea 100644 --- a/drivers/usb/chipidea/ci_hdrc_tegra.c +++ b/drivers/usb/chipidea/ci_hdrc_tegra.c @@ -362,7 +362,7 @@ static int tegra_usb_probe(struct platform_device *pdev) return err; } -static int tegra_usb_remove(struct platform_device *pdev) +static void tegra_usb_remove(struct platform_device *pdev) { struct tegra_usb *usb = platform_get_drvdata(pdev); @@ -371,8 +371,6 @@ static int tegra_usb_remove(struct platform_device *pdev) pm_runtime_put_sync_suspend(&pdev->dev); pm_runtime_force_suspend(&pdev->dev); - - return 0; } static int __maybe_unused tegra_usb_runtime_resume(struct device *dev) @@ -410,7 +408,7 @@ static struct platform_driver tegra_usb_driver = { .pm = &tegra_usb_pm, }, .probe = tegra_usb_probe, - .remove = tegra_usb_remove, + .remove_new = tegra_usb_remove, }; module_platform_driver(tegra_usb_driver); From patchwork Wed May 17 23:01:10 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: 13245844 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACAEBC7EE2A for ; Wed, 17 May 2023 23:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbjEQXCw (ORCPT ); Wed, 17 May 2023 19:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjEQXCu (ORCPT ); Wed, 17 May 2023 19:02:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BF6D526E for ; Wed, 17 May 2023 16:02:47 -0700 (PDT) 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-0007jQ-Vt; 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 1pzQAO-000wo5-AQ; Thu, 18 May 2023 01:02:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAN-005UVi-Kh; Thu, 18 May 2023 01:02:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Peter Chen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/97] usb: chipidea/ci_hdrc_usb2: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:10 +0200 Message-Id: <20230517230239.187727-9-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=1775; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=k4wCm4sRFVYDrahS0FrHNdkZzi83AlS+G9lZu6ldpao=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVvzUuTghSn4mgJlr3ZeTMEqyqcvVvJ9wH52E YU+fiEFMWyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb8wAKCRCPgPtYfRL+ TndCB/wLroe6N4UW2kIjO3j8XHwBPm70x4DA+KmOxmzpmVQfdlLZcs22ZM8S5qqftIL0F3XzjCY 8XjXiV+u3BI9MpHv2FW7IPLTgHw0kNMd776JXjG5mmS6wB0t/GVOCElUwfGW+OSgrJduYCyOW3U 1pHzipGI6IZdHw8RNKCtiFEczuGZEpaqS87qg0bCQm4AUWfKk09nQwGgIrxSYtuez5iXxttPT8t AvoH7hyDxDa8LdxsqIHUarTjPWqMhq1jiwvKVjvtuHRkBh3E9+9SmmBi6xnttvKjhzD8R97V6za Zv/cZEnwVTlBOUEimn7/4splqUCIXvTQLdReas1PliW0+Mg5 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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_usb2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_usb2.c b/drivers/usb/chipidea/ci_hdrc_usb2.c index dc86b12060b5..1321ee67f3b8 100644 --- a/drivers/usb/chipidea/ci_hdrc_usb2.c +++ b/drivers/usb/chipidea/ci_hdrc_usb2.c @@ -106,20 +106,18 @@ static int ci_hdrc_usb2_probe(struct platform_device *pdev) return ret; } -static int ci_hdrc_usb2_remove(struct platform_device *pdev) +static void ci_hdrc_usb2_remove(struct platform_device *pdev) { struct ci_hdrc_usb2_priv *priv = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); ci_hdrc_remove_device(priv->ci_pdev); clk_disable_unprepare(priv->clk); - - return 0; } static struct platform_driver ci_hdrc_usb2_driver = { .probe = ci_hdrc_usb2_probe, - .remove = ci_hdrc_usb2_remove, + .remove_new = ci_hdrc_usb2_remove, .driver = { .name = "chipidea-usb2", .of_match_table = of_match_ptr(ci_hdrc_usb2_of_match), From patchwork Wed May 17 23:01:11 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: 13245842 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F94AC7EE2C for ; Wed, 17 May 2023 23:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229709AbjEQXCv (ORCPT ); Wed, 17 May 2023 19:02:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjEQXCt (ORCPT ); Wed, 17 May 2023 19:02:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93B205270 for ; Wed, 17 May 2023 16:02:47 -0700 (PDT) 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 1pzQAP-0007jc-9d; 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 1pzQAO-000wo9-I5; Thu, 18 May 2023 01:02:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAN-005UVm-SO; Thu, 18 May 2023 01:02:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Peter Chen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/97] usb: chipidea/core: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:11 +0200 Message-Id: <20230517230239.187727-10-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=1777; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1/yllDkjCwUIbCR9lpoGxvNeDyvYPOuETKlwOlDlVX4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVv0xjqo1yr6eEzwAzMf8jUEYvDui0dZJWD8m XR0dfAsqwyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb9AAKCRCPgPtYfRL+ TntRCACa4+qmvUCjTvU8H3JaDN14to/EWRY/GmPmHssP+dEP/yEc09+3F5E/pgrK3jV20sozZuq tWUDQY0rW/Al0dMsWZMJyIbCMPM2c2QhuLnKsTsQtFaENDqJIM14QGhBq/3zOMYqdDCt9vvqID7 077iDjTd8fk1emOoKPW9XMFq7Jmtaj6EE8PMzghJxgtrE07B47hYlUutyn21bjvdbRkSgV058uv 0TjgdxnATRetlzP4rmTzHFGAxCautpZa4+etANNGSuAk8HltW5TUX23PoytzygCkkXony1PZGKX xxXmmWtUQE+GNQOFbXR7pEeA0IRtIKjaOErkr+sQGF/sLjcg 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 798cb077867a..51994d655b82 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -1227,7 +1227,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) return ret; } -static int ci_hdrc_remove(struct platform_device *pdev) +static void ci_hdrc_remove(struct platform_device *pdev) { struct ci_hdrc *ci = platform_get_drvdata(pdev); @@ -1245,8 +1245,6 @@ static int ci_hdrc_remove(struct platform_device *pdev) ci_hdrc_enter_lpm(ci, true); ci_usb_phy_exit(ci); ci_ulpi_exit(ci); - - return 0; } #ifdef CONFIG_PM @@ -1485,7 +1483,7 @@ static const struct dev_pm_ops ci_pm_ops = { static struct platform_driver ci_hdrc_driver = { .probe = ci_hdrc_probe, - .remove = ci_hdrc_remove, + .remove_new = ci_hdrc_remove, .driver = { .name = "ci_hdrc", .pm = &ci_pm_ops, From patchwork Wed May 17 23:01:12 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: 13245859 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8A87C7EE22 for ; Wed, 17 May 2023 23:03:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229727AbjEQXDE (ORCPT ); Wed, 17 May 2023 19:03:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229678AbjEQXCy (ORCPT ); Wed, 17 May 2023 19:02:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C76583AB3 for ; Wed, 17 May 2023 16:02:53 -0700 (PDT) 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-0007kc-ES; 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 1pzQAO-000woG-Sr; Thu, 18 May 2023 01:02:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAO-005UVq-3o; Thu, 18 May 2023 01:02:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Chunfeng Yun , Christophe JAILLET , Prashanth K Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 10/97] usb: common: usb-conn-gpio: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:12 +0200 Message-Id: <20230517230239.187727-11-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=1882; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iAI9OTHwn+ri33OrQsc8ms0447IPbtHUXp9nab+ukH4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVv1wddOJ/yxMnKKFUe50iNomSKAeBulUbiJE 5eHi1dS6iaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb9QAKCRCPgPtYfRL+ Tp2LB/9qTMI65H21sXLpSWxpJlDULGvenv94tJp8SxhqP9Xcf2UviKBh3iVnmF130qCt+RJoFDg 6TRYV3AHcwC1rrdaUHVZ5HppQfqHcuc4xmh8H2FTAZ9lq3LdM9Vi6D4r0e+DdU4v3IgB5ABm9// dJLF/3Cmm0I0dMWe5yfsaT587cp0kw8pggih83u/KLixZyC8lfH/4Xq7vkQudEgQTZ23XVTIUo1 qg9PY8HqIVjHEYjjsmD4s+3VslRoy0zcsQap5Wsr0Je/vzfUgjRH1QD1LYAmqyWHpU5CATBVvYo d+Y9o1LeAcPCvT24xVVN3Ru/QdBbEDfjcK0fiNA2nEz/4YOM 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/common/usb-conn-gpio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c index e20874caba36..766005d20bae 100644 --- a/drivers/usb/common/usb-conn-gpio.c +++ b/drivers/usb/common/usb-conn-gpio.c @@ -267,7 +267,7 @@ static int usb_conn_probe(struct platform_device *pdev) return ret; } -static int usb_conn_remove(struct platform_device *pdev) +static void usb_conn_remove(struct platform_device *pdev) { struct usb_conn_info *info = platform_get_drvdata(pdev); @@ -277,8 +277,6 @@ static int usb_conn_remove(struct platform_device *pdev) regulator_disable(info->vbus); usb_role_switch_put(info->role_sw); - - return 0; } static int __maybe_unused usb_conn_suspend(struct device *dev) @@ -338,7 +336,7 @@ MODULE_DEVICE_TABLE(of, usb_conn_dt_match); static struct platform_driver usb_conn_driver = { .probe = usb_conn_probe, - .remove = usb_conn_remove, + .remove_new = usb_conn_remove, .driver = { .name = "usb-conn-gpio", .pm = &usb_conn_pm_ops, From patchwork Wed May 17 23:01:13 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: 13245847 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BD05C77B75 for ; Wed, 17 May 2023 23:02:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbjEQXCy (ORCPT ); Wed, 17 May 2023 19:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229678AbjEQXCu (ORCPT ); Wed, 17 May 2023 19:02:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB6745276 for ; Wed, 17 May 2023 16:02:48 -0700 (PDT) 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-0007m5-7E; 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-000woZ-Fq; 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-005UVu-At; Thu, 18 May 2023 01:02:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Minas Harutyunyan , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/97] usb: dwc2/platform: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:13 +0200 Message-Id: <20230517230239.187727-12-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=1875; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OGgS/GQVc+n0DjeVx3kCPbw/xZNkDel9cy+Cog9KMuI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVv3ph7GbV3zffwh3MvjJIWxoBT2SclZfkpfV WpqX1XUjOOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb9wAKCRCPgPtYfRL+ TsMpB/0fajK6xhDXQbSfqWl9vja+JuK6r6Lp9jtCttI5I/IVgDAXKcuCnhv0P0BqF5irsMGw1u4 rAa53fEvg0YSdJmBglx7wyigRdCn2d0d21izgsfY5S69ezA/bZOLSRGugV4qI1dB4bo04jm2w1C IIs0YhDyuiyZlH53sFUlLaVbC3sfmeabfi5fs3fbfZ+ockuNfX8GFqyfec+cr8/F4actyeHdRby NrSWILHxQb/Ty6D9y9k4kgD8E10d5WCU3C5LmU72Gr4LcaXGLrgz/2KYsZ60BFrwbskwFuYnICu 14p0hImaUpUZGuE0w3agA0MhsaFUWirHWqsJPoRfUooxesW7 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Minas Harutyunyan --- drivers/usb/dwc2/platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 5aee284018c0..3157db9f21bd 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -288,7 +288,7 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg) * stops device processing. Any resources used on behalf of this device are * freed. */ -static int dwc2_driver_remove(struct platform_device *dev) +static void dwc2_driver_remove(struct platform_device *dev) { struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); struct dwc2_gregs_backup *gr; @@ -341,8 +341,6 @@ static int dwc2_driver_remove(struct platform_device *dev) reset_control_assert(hsotg->reset); reset_control_assert(hsotg->reset_ecc); - - return 0; } /** @@ -746,7 +744,7 @@ static struct platform_driver dwc2_platform_driver = { .pm = &dwc2_dev_pm_ops, }, .probe = dwc2_driver_probe, - .remove = dwc2_driver_remove, + .remove_new = dwc2_driver_remove, .shutdown = dwc2_driver_shutdown, }; From patchwork Wed May 17 23:01: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: 13245845 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAD4FC7EE2D for ; Wed, 17 May 2023 23:02:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229719AbjEQXCx (ORCPT ); Wed, 17 May 2023 19:02:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbjEQXCu (ORCPT ); Wed, 17 May 2023 19:02:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 855CD4C2C for ; Wed, 17 May 2023 16:02:48 -0700 (PDT) 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-0007lW-6R; 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-000woL-2g; 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-005UVz-GS; Thu, 18 May 2023 01:02:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thinh Nguyen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/97] usb: core: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:14 +0200 Message-Id: <20230517230239.187727-13-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=1742; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=UQPIKGxF0Is6mnxd/N50Cs85fyXZgDWimnfytjHHXOs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVv41mQmc5dqZ9NKumQZxTGAw7IupPSEA97Av YoAmUVqk3uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb+AAKCRCPgPtYfRL+ ToIHB/9vlnbbIyD3EiGqMD8PZV4Extr8fGUzEm6poS20lqnkgXmh1+dTqFMebWOTqy2V45Oy18j UGEWuWG4S7kE+gwF1uXeGEwE2FtmSvoPR6+sxyrSOZ/q2qtyxYcejrB7pXuGBLfm9Ek2q+CsmEW eQyewtRTgMJi10NsEIwQhRqCiuQ3ndVVIcMcLmbOVHC0syQeu6MeGGCcdN5x1t0UFMoN4ydB5Pi 59I2QvCqMcEjF1tLKvEVcK+tCP/i7JI5npwtTXJ5vcrnGr1c8gmxFAB8BTgdnuyLc7Jisw7oc/B 0mjU1qIxgzihKsMKlws91USysLm+bqrRBHgEmVtP6gBEat8i 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 0beaab932e7d..cd3126672306 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1913,7 +1913,7 @@ static int dwc3_probe(struct platform_device *pdev) return ret; } -static int dwc3_remove(struct platform_device *pdev) +static void dwc3_remove(struct platform_device *pdev) { struct dwc3 *dwc = platform_get_drvdata(pdev); @@ -1935,8 +1935,6 @@ static int dwc3_remove(struct platform_device *pdev) if (dwc->usb_psy) power_supply_put(dwc->usb_psy); - - return 0; } #ifdef CONFIG_PM @@ -2247,7 +2245,7 @@ MODULE_DEVICE_TABLE(acpi, dwc3_acpi_match); static struct platform_driver dwc3_driver = { .probe = dwc3_probe, - .remove = dwc3_remove, + .remove_new = dwc3_remove, .driver = { .name = "dwc3", .of_match_table = of_match_ptr(of_dwc3_match), From patchwork Wed May 17 23:01:15 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: 13245846 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34FF0C7EE2E for ; Wed, 17 May 2023 23:02:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbjEQXCw (ORCPT ); Wed, 17 May 2023 19:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbjEQXCu (ORCPT ); Wed, 17 May 2023 19:02:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71EF649C1 for ; Wed, 17 May 2023 16:02:48 -0700 (PDT) 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-0007lu-6q; 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-000woT-8T; 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-005UW3-Lv; Thu, 18 May 2023 01:02:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thinh Nguyen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 13/97] usb: dwc3-am62: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:15 +0200 Message-Id: <20230517230239.187727-14-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=1812; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=9V9gRu8K0laR4ZMkL+6LJuFgAUBxGO0zZORttVpkS6g=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVv5yapp4u3/UeQZ49Ab5EWNlkQbTcJConG7M 71eO6b1u0KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb+QAKCRCPgPtYfRL+ Tub/B/sH3Gc9bRQQJSzS5kPSSK+jcdUb9oHCC8kbcWSp9L1EDoFKCTHapoCIUxG0mo/Arectpe4 bNqNdNYgFW4JxRZl0WUUouurfGhldMzBH80uytR3QqcEqZ2BUrtXK2om56hy0Q94TzsWOpZcvGI yzQY7j+IWfJyM/PWINPyB1um1l0J0Foh+tu+G7aJELwE/gYIPHWAYGHS/Tqx3/FY72rPrL+8Yrk H2+Y7oI0firf5a4Iper9obZmqydJuyWZqcZcQzGz2JF3zi1xSW1wDOJvfXNM0HIFfpIyVgYNhHV o4DYSEMvrXXByqVATNaoX+pyneTyZWFIq3Fsv/dvhP2ZpQbQ 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-am62.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c index cda9458c809b..1755f2f848c5 100644 --- a/drivers/usb/dwc3/dwc3-am62.c +++ b/drivers/usb/dwc3/dwc3-am62.c @@ -275,7 +275,7 @@ static int dwc3_ti_remove_core(struct device *dev, void *c) return 0; } -static int dwc3_ti_remove(struct platform_device *pdev) +static void dwc3_ti_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct dwc3_data *data = platform_get_drvdata(pdev); @@ -294,7 +294,6 @@ static int dwc3_ti_remove(struct platform_device *pdev) pm_runtime_set_suspended(dev); platform_set_drvdata(pdev, NULL); - return 0; } #ifdef CONFIG_PM @@ -362,7 +361,7 @@ MODULE_DEVICE_TABLE(of, dwc3_ti_of_match); static struct platform_driver dwc3_ti_driver = { .probe = dwc3_ti_probe, - .remove = dwc3_ti_remove, + .remove_new = dwc3_ti_remove, .driver = { .name = "dwc3-am62", .pm = DEV_PM_OPS, 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: 13245860 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BAB2C77B75 for ; Wed, 17 May 2023 23:03:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229538AbjEQXDF (ORCPT ); Wed, 17 May 2023 19:03:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbjEQXCz (ORCPT ); Wed, 17 May 2023 19:02:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33E5D4C2C for ; Wed, 17 May 2023 16:02:54 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: 13245855 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33783C77B75 for ; Wed, 17 May 2023 23:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbjEQXDB (ORCPT ); Wed, 17 May 2023 19:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbjEQXCx (ORCPT ); Wed, 17 May 2023 19:02:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E9164EF3 for ; Wed, 17 May 2023 16:02:52 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:18 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: 13245848 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B579C7EE31 for ; Wed, 17 May 2023 23:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229733AbjEQXCz (ORCPT ); Wed, 17 May 2023 19:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbjEQXCu (ORCPT ); Wed, 17 May 2023 19:02:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF41F5588 for ; Wed, 17 May 2023 16:02:48 -0700 (PDT) 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-0007mk-KZ; 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-000wol-WD; 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-005UWE-8i; Thu, 18 May 2023 01:02:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thinh Nguyen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 16/97] usb: dwc3-keystone: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:18 +0200 Message-Id: <20230517230239.187727-17-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=1902; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=9oQ5FZlheGoiZxTsB/AhzlUE7gUOhffJXUeCwa855MY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVv8Ipp+w3ZEAX96/FLT3q4m7ca89yfmcwfWu kUdy3uFo6OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb/AAKCRCPgPtYfRL+ TtZKCACK+hI9pjTHUQ21DN5s9lGFeYhF7JSRoMBsWHAKHj5YQJsEkyfff8tMu5mDc+XvUDYfnoU 4Gzi7IIB4bXWoUGCN//NAD6+bPr+pxoJXm1I7ofVEVgHKhssEAhHx/dG9aZDjGBqUJeLLTDZCap I1ySbbvaLWY1OZphoUS1+qiYX8xT6Oh09moO1vDfDTqPJWwmUBF4qsZ9XDotq6dra2Gn4W6LyaQ b00NVgdAEw/bnspyvJH0AvRsKzAN8BYVVgahnIBO5fvlyCZpNzmvbX75pXidV2D7n1dDfSs/34k MW3jwYrDGJeqTlD4t4bZ4zaNGuKsEBGP06TZYXKWcXWwkNX7 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-keystone.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c index 1317959294e6..0a09aedc2573 100644 --- a/drivers/usb/dwc3/dwc3-keystone.c +++ b/drivers/usb/dwc3/dwc3-keystone.c @@ -181,7 +181,7 @@ static int kdwc3_remove_core(struct device *dev, void *c) return 0; } -static int kdwc3_remove(struct platform_device *pdev) +static void kdwc3_remove(struct platform_device *pdev) { struct dwc3_keystone *kdwc = platform_get_drvdata(pdev); struct device_node *node = pdev->dev.of_node; @@ -198,8 +198,6 @@ static int kdwc3_remove(struct platform_device *pdev) phy_pm_runtime_put_sync(kdwc->usb3_phy); platform_set_drvdata(pdev, NULL); - - return 0; } static const struct of_device_id kdwc3_of_match[] = { @@ -211,7 +209,7 @@ MODULE_DEVICE_TABLE(of, kdwc3_of_match); static struct platform_driver kdwc3_driver = { .probe = kdwc3_probe, - .remove = kdwc3_remove, + .remove_new = kdwc3_remove, .driver = { .name = "keystone-dwc3", .of_match_table = kdwc3_of_match, 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: 13245853 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6E04C7EE2D for ; Wed, 17 May 2023 23:03:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbjEQXC7 (ORCPT ); Wed, 17 May 2023 19:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbjEQXCx (ORCPT ); Wed, 17 May 2023 19:02:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34F8D4C02 for ; Wed, 17 May 2023 16:02:51 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:20 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: 13245849 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 912BDC7EE22 for ; Wed, 17 May 2023 23:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229743AbjEQXC4 (ORCPT ); Wed, 17 May 2023 19:02:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjEQXCu (ORCPT ); Wed, 17 May 2023 19:02:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D79F5B99 for ; Wed, 17 May 2023 16:02:49 -0700 (PDT) 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-0007nt-WE; 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 1pzQAQ-000wow-C5; 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-005UWN-Kq; Thu, 18 May 2023 01:02:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thinh Nguyen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 18/97] usb: dwc3-of-simple: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:20 +0200 Message-Id: <20230517230239.187727-19-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=1860; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dWcN5cIWOM4UBejp6HhCqo0zpup7VCGR/ViAFNVJDOQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVv/6JagR22opDJGF+lKBSsDjifpaAAAXEg9x EU+bcbGf3CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVb/wAKCRCPgPtYfRL+ TlRuB/4g2Tav1z/dZJJK7v0mi1xtabxpDuGWvHYqhWW33LhO02cLT1vW5grYAZg0pw47lmeBn5i IE4qb3vQh+EKC/c5royvJSzsS8+T1gh3quSrJDvVsvlx8Ns53pln77yDSg8TcN3hRxKFN0CiHUp a4f1EpLJLeAxY4WY+C771keTHn3EfvJxUVoDzvpwxoohauhfd61jl0CES4TKa+DNIKy5EOIpl4J 5PCSJE41WHP71HehUfF5VTpS3zdWwfQstoeDhK2m1aytVeiLug+D/1JgqwXmVgMXKDoKY0RH+W7 ytjC9TIpORefN3l7J7mNKvQ25tJsNp3z528KcGOLZMqBWbKR 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-of-simple.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index 71fd620c5161..7e6ad8fe61a5 100644 --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -112,13 +112,11 @@ static void __dwc3_of_simple_teardown(struct dwc3_of_simple *simple) pm_runtime_set_suspended(simple->dev); } -static int dwc3_of_simple_remove(struct platform_device *pdev) +static void dwc3_of_simple_remove(struct platform_device *pdev) { struct dwc3_of_simple *simple = platform_get_drvdata(pdev); __dwc3_of_simple_teardown(simple); - - return 0; } static void dwc3_of_simple_shutdown(struct platform_device *pdev) @@ -183,7 +181,7 @@ MODULE_DEVICE_TABLE(of, of_dwc3_simple_match); static struct platform_driver dwc3_of_simple_driver = { .probe = dwc3_of_simple_probe, - .remove = dwc3_of_simple_remove, + .remove_new = dwc3_of_simple_remove, .shutdown = dwc3_of_simple_shutdown, .driver = { .name = "dwc3-of-simple", From patchwork Wed May 17 23:01:21 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: 13245850 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3098AC7EE23 for ; Wed, 17 May 2023 23:02:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbjEQXC5 (ORCPT ); Wed, 17 May 2023 19:02:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjEQXCu (ORCPT ); Wed, 17 May 2023 19:02:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A4CE94 for ; Wed, 17 May 2023 16:02:49 -0700 (PDT) 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-0007om-Cy; 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 1pzQAQ-000wp3-OU; 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-005UWR-RO; Thu, 18 May 2023 01:02:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thinh Nguyen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 19/97] usb: dwc3-omap: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:21 +0200 Message-Id: <20230517230239.187727-20-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=1895; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fmMxcnjRsinJE0rmud5eDuAbZDJzX3+CKTJcdrx5prw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwA2sBXMNriRXtSnkZ5Qez5T6ghDPqRH33S9 RDVWKfHOsGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcAAAKCRCPgPtYfRL+ TmDJCACZiHOcMyxrG/s8MeSOBfl9nAtIPXmmL7ZtFXnqtdpI3TLY7ZTmcubMBngFQkhNK/q//pW jD3H4oKWgaBs57JamMI6eQ8HFVH/P9Xds9sSKBleWZf3eedf7CmyF5JKMCR7bcaBk4kAGjIkP3x UNVsn38dlolwq6E907KFr654FwOkdgSor/uVBGxuuui1d69dS8jB63LtXhHrNfyQ8ICdx1HPylj lQUJhGPt1lqtZNAgsMeH4hW/518cCbezNfKaF+GRUVRycWI1Q6HxrxmZNEHehrn7xQC4thPUKx/ AAqqcXWQZt86x6aK61Nm5AhjYhzzEgUzUt1hStt6xkKWd7Ik 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-omap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index efaf0db595f4..d5c77db4daa9 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -534,7 +534,7 @@ static int dwc3_omap_probe(struct platform_device *pdev) return ret; } -static int dwc3_omap_remove(struct platform_device *pdev) +static void dwc3_omap_remove(struct platform_device *pdev) { struct dwc3_omap *omap = platform_get_drvdata(pdev); @@ -543,8 +543,6 @@ static int dwc3_omap_remove(struct platform_device *pdev) of_platform_depopulate(omap->dev); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id of_dwc3_match[] = { @@ -611,7 +609,7 @@ static const struct dev_pm_ops dwc3_omap_dev_pm_ops = { static struct platform_driver dwc3_omap_driver = { .probe = dwc3_omap_probe, - .remove = dwc3_omap_remove, + .remove_new = dwc3_omap_remove, .driver = { .name = "omap-dwc3", .of_match_table = of_dwc3_match, From patchwork Wed May 17 23:01: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: 13245875 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C9CBC7EE23 for ; Wed, 17 May 2023 23:03:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbjEQXDR (ORCPT ); Wed, 17 May 2023 19:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbjEQXDE (ORCPT ); Wed, 17 May 2023 19:03:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 860165FD1 for ; Wed, 17 May 2023 16:02:59 -0700 (PDT) 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-0007ov-5X; 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 1pzQAQ-000wp6-QM; 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 1pzQAQ-005UWV-3N; Thu, 18 May 2023 01:02:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Thinh Nguyen , Greg Kroah-Hartman Cc: Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/97] usb: dwc3-qcom: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:22 +0200 Message-Id: <20230517230239.187727-21-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=1881; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zshZZOKhKaOmXjjFZX/6UJ2ZzFeLN5Dfj+shPazq61Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwBD/efn5OCC88J/zQyrTwnXKuKpi6YIJ6a7 bnyjZ0bxM6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcAQAKCRCPgPtYfRL+ Tn3kCACcNTvD1PlNtNphLALqpQ9cn85j8jNjoOgOfCKP4TvGbBpx+75R00rwmCxVxfKmKyw5QrJ vhItHXrWFUzm/Y1TkK+Qjxu1ELgVhsNmb2dh5SgMOphNhGk4jVldhUAi1YR0NmaPYw04fT0EQe3 A5F0vmIpGqXD+xe8AmgygDHyu2R5Dk3rH8y2xCfee9MbZWi8/lggYDHRX1Cyfl44kvKLkoMrUI7 uYbUxfaIMZG9F6nTEFKvLLZk64aO6mmZIxaGe0MSx5E2CRgDLSUAYxYlll5aMD1VAiauteV5jsw g7c8yHQ/XrnVklovjrHzyXl0wkN5ipX1fzz33EZZOmsA/g0V 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Konrad Dybcio Acked-by: Thinh Nguyen --- drivers/usb/dwc3/dwc3-qcom.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 959fc925ca7c..167f851c8e59 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -938,7 +938,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) return ret; } -static int dwc3_qcom_remove(struct platform_device *pdev) +static void dwc3_qcom_remove(struct platform_device *pdev) { struct dwc3_qcom *qcom = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -958,8 +958,6 @@ static int dwc3_qcom_remove(struct platform_device *pdev) pm_runtime_allow(dev); pm_runtime_disable(dev); - - return 0; } static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev) @@ -1052,7 +1050,7 @@ MODULE_DEVICE_TABLE(acpi, dwc3_qcom_acpi_match); static struct platform_driver dwc3_qcom_driver = { .probe = dwc3_qcom_probe, - .remove = dwc3_qcom_remove, + .remove_new = dwc3_qcom_remove, .driver = { .name = "dwc3-qcom", .pm = &dwc3_qcom_dev_pm_ops, 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: 13245857 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86F79C7EE2C for ; Wed, 17 May 2023 23:03:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbjEQXDC (ORCPT ); Wed, 17 May 2023 19:03:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbjEQXCy (ORCPT ); Wed, 17 May 2023 19:02:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4291F49C1 for ; Wed, 17 May 2023 16:02:53 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: 13245854 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79819C7EE23 for ; Wed, 17 May 2023 23:03:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229768AbjEQXDA (ORCPT ); Wed, 17 May 2023 19:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbjEQXCx (ORCPT ); Wed, 17 May 2023 19:02:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FF8F4C2C for ; Wed, 17 May 2023 16:02:52 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:25 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: 13245852 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECA98C7EE22 for ; Wed, 17 May 2023 23:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229756AbjEQXC7 (ORCPT ); Wed, 17 May 2023 19:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjEQXCw (ORCPT ); Wed, 17 May 2023 19:02:52 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DCC649C1 for ; Wed, 17 May 2023 16:02:51 -0700 (PDT) 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-0007pj-81; 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-000wpO-IW; 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-005UWg-Lw; Thu, 18 May 2023 01:02:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/97] usb: fotg210: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:25 +0200 Message-Id: <20230517230239.187727-24-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=1802; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0EVPeeXYnFzs0REvfAsMPZGA7dNmwc9neKov2L8WQgI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwFvnGZXBo4p3f3EQVZdLtjjRzrSyhTAZDYI Ze+8JfUGSiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcBQAKCRCPgPtYfRL+ Tnw/CACZz9d/liDEloXB7xtHkr3RVszLunK7unuQ9BHU4D9SAoI02dR7pJ4+9sc8kG2usARE8ec BfcUEcfmgoQszSxqdX93ptqYx52vFB+uhhQoeuMqTlyfxeW8Y8tYbbyBU1862kdEv1uc7m2HY8i c/MLDo+qUVjt6CMEhKzDeOS3wfeog6w7z7+tLDbq4gtzzhBoG7YL8FS9cjgTwcbwR9pc2eCOuqP HsrOEuaR+BqtnL0qIw0T2N+XqgSuFp2BBMHtQf2iv6L/K3ZsV35wU7HaDxqXuMSVrxyGT32SHeF lUv0y48vE62TTuetRr05R/OhUggBblG8owhnfrUqpnJnbqQN 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Linus Walleij --- drivers/usb/fotg210/fotg210-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/fotg210/fotg210-core.c b/drivers/usb/fotg210/fotg210-core.c index cb75464ab290..958fc40eae86 100644 --- a/drivers/usb/fotg210/fotg210-core.c +++ b/drivers/usb/fotg210/fotg210-core.c @@ -165,7 +165,7 @@ static int fotg210_probe(struct platform_device *pdev) return ret; } -static int fotg210_remove(struct platform_device *pdev) +static void fotg210_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; enum usb_dr_mode mode; @@ -176,8 +176,6 @@ static int fotg210_remove(struct platform_device *pdev) fotg210_udc_remove(pdev); else fotg210_hcd_remove(pdev); - - return 0; } #ifdef CONFIG_OF @@ -196,7 +194,7 @@ static struct platform_driver fotg210_driver = { .of_match_table = of_match_ptr(fotg210_of_match), }, .probe = fotg210_probe, - .remove = fotg210_remove, + .remove_new = fotg210_remove, }; static int __init fotg210_init(void) From patchwork Wed May 17 23:01:26 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: 13245864 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04F0DC77B75 for ; Wed, 17 May 2023 23:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbjEQXDI (ORCPT ); Wed, 17 May 2023 19:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjEQXCz (ORCPT ); Wed, 17 May 2023 19:02:55 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 340E54EF3 for ; Wed, 17 May 2023 16:02:54 -0700 (PDT) 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 1pzQAT-0007sd-VR; Thu, 18 May 2023 01:02:50 +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 1pzQAS-000wpZ-60; Thu, 18 May 2023 01:02:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAQ-005UWk-Rl; Thu, 18 May 2023 01:02:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Andy Shevchenko Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 24/97] usb: gadget: hid: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:26 +0200 Message-Id: <20230517230239.187727-25-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=1743; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1PRI/mCipOGi8CtQHbGDFoQEMoyvZqKEjaTqhrDxJCw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwGAvSnSf1C4Wd8ldbDfLVnitx+uG7OsjTbL pFbhqEGN8uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcBgAKCRCPgPtYfRL+ To0YB/4in6/Ww5/y4b6GVokCZu+TmHG8JCk2OCZS/DVe/y6fV/j/13iad0S/ZAJBgQF3Hqgy20g LsvyPRcardAG2jGlzyowhKojNi6cD3iMujC50/n2KS+It0zuPC9wrVJ/jdDtQIATp/MP28nf9TE 3E3ll/57nyeYDvjHlQnBokmoldK5kPBqWzTjZfveawjFeTLir3lNwxHhJv4v+sKRTeLAmsNZNK1 NkUZAmAAMqikshqmoO182ZriecMAFf+TODjPKA5dHlN3JVdPaFbzRSRkcgMsF9GAKgcZEIz0prs wmjVyZMOY+/K9KIhe/NyGmHK3+vaDfuDuCVAaQxl6DglBDbU 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/legacy/hid.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/legacy/hid.c b/drivers/usb/gadget/legacy/hid.c index 133daf88162e..4ca67b2f8f24 100644 --- a/drivers/usb/gadget/legacy/hid.c +++ b/drivers/usb/gadget/legacy/hid.c @@ -237,7 +237,7 @@ static int hidg_plat_driver_probe(struct platform_device *pdev) return 0; } -static int hidg_plat_driver_remove(struct platform_device *pdev) +static void hidg_plat_driver_remove(struct platform_device *pdev) { struct hidg_func_node *e, *n; @@ -245,8 +245,6 @@ static int hidg_plat_driver_remove(struct platform_device *pdev) list_del(&e->node); kfree(e); } - - return 0; } @@ -263,7 +261,7 @@ static struct usb_composite_driver hidg_driver = { }; static struct platform_driver hidg_plat_driver = { - .remove = hidg_plat_driver_remove, + .remove_new = hidg_plat_driver_remove, .driver = { .name = "hidg", }, 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: 13245937 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 489B9C7EE22 for ; Wed, 17 May 2023 23:04:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbjEQXES (ORCPT ); Wed, 17 May 2023 19:04:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbjEQXEI (ORCPT ); Wed, 17 May 2023 19:04:08 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8DDD49C1 for ; Wed, 17 May 2023 16:03:40 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: 13245888 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 825ABC7EE23 for ; Wed, 17 May 2023 23:03:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbjEQXD3 (ORCPT ); Wed, 17 May 2023 19:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjEQXDK (ORCPT ); Wed, 17 May 2023 19:03:10 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A59995B99 for ; Wed, 17 May 2023 16:03:01 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:29 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: 13245862 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 865ADC7EE23 for ; Wed, 17 May 2023 23:03:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbjEQXDG (ORCPT ); Wed, 17 May 2023 19:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbjEQXC4 (ORCPT ); Wed, 17 May 2023 19:02:56 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E40385B9A for ; Wed, 17 May 2023 16:02:54 -0700 (PDT) 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-0007xl-2R; 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-000wpq-0J; 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-005UWw-FY; Thu, 18 May 2023 01:02:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kevin Cernekee , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 27/97] usb: gadget/bcm63xx_udc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:29 +0200 Message-Id: <20230517230239.187727-28-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=1852; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uZg+P/vsXzdQ4medcFXFVqpVQQI7tAU47FzEhKMmNYA=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUGL6eSyw1+l82pjUvuGBcXpbibGKRyc/ht+Sr3F7+X 4eL36l1MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCRG9/Y/9lo/JUKcGJZ+Sja vN1/67xHnkaq0WvtX3D9KvNyE637Oy3bWmRnWM+DS6HdFUt4HaxyN/mmrepoj75VfvyZ7xJ9xQN FQbufMohu/9T9yOLljANzrCZXOCzPjv0uGznZwFQ2RvNd9WauyitqV9JOh0zwKN19IHvitgutEz ck9/gZp4aKbTvv8+PDMmG9mA8Mj9q2VP3hWTO388nNDFPzJNWD16YsXZv51j1+7vvK6/lX7Ms9J /fO3PHCQL++ydZhg8Y3Vz/9c+2zarSV4o0CPN+GLQh3Vi26IWV05lD08WILc/fq39W/OSK7Or7/ sPf2uHnpydmTRcaRZ2cIePgx6E18YdRk/MjX63F0+e6pAA== 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/bcm63xx_udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index a3055dd4acfb..da7011d906e0 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -2354,7 +2354,7 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) * bcm63xx_udc_remove - Remove the device from the system. * @pdev: Platform device struct from the bcm63xx BSP code. */ -static int bcm63xx_udc_remove(struct platform_device *pdev) +static void bcm63xx_udc_remove(struct platform_device *pdev) { struct bcm63xx_udc *udc = platform_get_drvdata(pdev); @@ -2363,13 +2363,11 @@ static int bcm63xx_udc_remove(struct platform_device *pdev) BUG_ON(udc->driver); bcm63xx_uninit_udc_hw(udc); - - return 0; } static struct platform_driver bcm63xx_udc_driver = { .probe = bcm63xx_udc_probe, - .remove = bcm63xx_udc_remove, + .remove_new = bcm63xx_udc_remove, .driver = { .name = DRV_MODULE_NAME, }, From patchwork Wed May 17 23:01:30 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: 13245867 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 641BEC7EE23 for ; Wed, 17 May 2023 23:03:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229814AbjEQXDK (ORCPT ); Wed, 17 May 2023 19:03:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjEQXC5 (ORCPT ); Wed, 17 May 2023 19:02:57 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BA794C02 for ; Wed, 17 May 2023 16:02:55 -0700 (PDT) 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 1pzQAU-0007v9-Mc; Thu, 18 May 2023 01:02:50 +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 1pzQAS-000wpj-He; Thu, 18 May 2023 01:02:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAR-005UWz-LJ; Thu, 18 May 2023 01:02:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Justin Chen , Al Cooper , Greg Kroah-Hartman Cc: Broadcom internal kernel review list , linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/97] usb: bdc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:30 +0200 Message-Id: <20230517230239.187727-29-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=1741; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0FIrUSiLr4DyZlqq1RN8uqMZ94s344KUpdUhZFNgjfI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwPpWgw9hCcgeOmTwlTnYainHsDUJt7SzuBr Du/xyX/e7KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcDwAKCRCPgPtYfRL+ Th1sB/9/UXbmvmC1P6B5iIjUCeKQft+qjJ0B4lX8MeJFs4DBmFxPmMBZAqthv6guCeNFVx+ZP5s ty7MWypwWkdFSVrIdwjtUifl9ccFDQKTgGADI2wcjywyspGkGDdnnwQEJxcEyaHw5xDPBUP1Va1 6//c0V39KEKV3xhBlMch08cVC4IF/BtlbNwW+oJfNOH0mE5QnP4o3F+0bydoEYkzw5AHJFqbk1P qlZkMQv48B7paD3+8STzoRis36y3Yx/bFWqK4BycED/egP52UjyiohU5+LZ/lSG2dYWFOn9eugB r+ZaZxSXvA4WlVOBPOCPutjRBtQtM5u1qR0wp+3xctxM2+TD 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli --- drivers/usb/gadget/udc/bdc/bdc_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index 9849e0c86e23..35a652807fca 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -583,7 +583,7 @@ static int bdc_probe(struct platform_device *pdev) return ret; } -static int bdc_remove(struct platform_device *pdev) +static void bdc_remove(struct platform_device *pdev) { struct bdc *bdc; @@ -593,7 +593,6 @@ static int bdc_remove(struct platform_device *pdev) bdc_hw_exit(bdc); bdc_phy_exit(bdc); clk_disable_unprepare(bdc->clk); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -648,7 +647,7 @@ static struct platform_driver bdc_driver = { .of_match_table = bdc_of_match, }, .probe = bdc_probe, - .remove = bdc_remove, + .remove_new = bdc_remove, }; module_platform_driver(bdc_driver); From patchwork Wed May 17 23:01:31 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: 13245856 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C475EC7EE22 for ; Wed, 17 May 2023 23:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbjEQXDC (ORCPT ); Wed, 17 May 2023 19:03:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbjEQXCy (ORCPT ); Wed, 17 May 2023 19:02:54 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47BE34C02 for ; Wed, 17 May 2023 16:02:53 -0700 (PDT) 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 1pzQAT-0007uN-To; Thu, 18 May 2023 01:02:49 +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 1pzQAS-000wpf-DF; Thu, 18 May 2023 01:02:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAR-005UX3-Qm; Thu, 18 May 2023 01:02:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 29/97] usb: gadget/dummy_hcd: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:31 +0200 Message-Id: <20230517230239.187727-30-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=2666; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hI7FrwGABRccHSnkKR2OzfLIJAe4ovOlx+PI+4evkaQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwQ/SwapgRznoBm08VHB4FYFwLbZTVtnSyAc lwj7gabTQyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcEAAKCRCPgPtYfRL+ Tq9DB/9kT9fssYA+b3JvY8BoBNOGVIdQtsuqUSOevc5WzgEWjaMUP/s43k8CDRs1zpwc62wC4vy FbEg7uheEFnoNdGMX55HBaegqGaMDv+8JLnDyB/Hd3pvSIquhRqIOZBkTllkjcrbYMYdBVpDpaJ z2V5gGkQSqsPceVxIpdO00tLs1L3Wxg/flB908ZAC8fzhEINletLySmlvWVPrl0Wq6R/WbSNCBf rNgHpDZUroJJrq2mE8E/zbIqVTS8VR83QvQAj0yQWRkoLAzar4R6ctL5m++NPUA6o9p3B83tUP6 bXQtZKXkTzj3XxXr16mINDwx6GnaBh2/K1KVTXTIwiFU3M5a 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/dummy_hcd.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index 899ac9f9c279..0953e1b5c030 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -1108,13 +1108,12 @@ static int dummy_udc_probe(struct platform_device *pdev) return rc; } -static int dummy_udc_remove(struct platform_device *pdev) +static void dummy_udc_remove(struct platform_device *pdev) { struct dummy *dum = platform_get_drvdata(pdev); device_remove_file(&dum->gadget.dev, &dev_attr_function); usb_del_gadget_udc(&dum->gadget); - return 0; } static void dummy_udc_pm(struct dummy *dum, struct dummy_hcd *dum_hcd, @@ -1150,7 +1149,7 @@ static int dummy_udc_resume(struct platform_device *pdev) static struct platform_driver dummy_udc_driver = { .probe = dummy_udc_probe, - .remove = dummy_udc_remove, + .remove_new = dummy_udc_remove, .suspend = dummy_udc_suspend, .resume = dummy_udc_resume, .driver = { @@ -2701,7 +2700,7 @@ static int dummy_hcd_probe(struct platform_device *pdev) return retval; } -static int dummy_hcd_remove(struct platform_device *pdev) +static void dummy_hcd_remove(struct platform_device *pdev) { struct dummy *dum; @@ -2717,8 +2716,6 @@ static int dummy_hcd_remove(struct platform_device *pdev) dum->hs_hcd = NULL; dum->ss_hcd = NULL; - - return 0; } static int dummy_hcd_suspend(struct platform_device *pdev, pm_message_t state) @@ -2753,7 +2750,7 @@ static int dummy_hcd_resume(struct platform_device *pdev) static struct platform_driver dummy_hcd_driver = { .probe = dummy_hcd_probe, - .remove = dummy_hcd_remove, + .remove_new = dummy_hcd_remove, .suspend = dummy_hcd_suspend, .resume = dummy_hcd_resume, .driver = { From patchwork Wed May 17 23:01:32 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: 13245863 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23EE6C7EE22 for ; Wed, 17 May 2023 23:03:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbjEQXDH (ORCPT ); Wed, 17 May 2023 19:03:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbjEQXC4 (ORCPT ); Wed, 17 May 2023 19:02:56 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0F105B99 for ; Wed, 17 May 2023 16:02:54 -0700 (PDT) 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 1pzQAU-0007xI-Tf; Thu, 18 May 2023 01:02:50 +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 1pzQAS-000wpo-Uc; Thu, 18 May 2023 01:02:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAS-005UX6-08; Thu, 18 May 2023 01:02:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Li Yang , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kernel@pengutronix.de Subject: [PATCH 30/97] usb: gadget/fsl_qe_udc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:32 +0200 Message-Id: <20230517230239.187727-31-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=1939; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=En3KNUJ/RA3U3pMVZQZ/9cfHAOUWZwuPGVw0CK6AIno=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwXunVuPOl3Y4CmP3Wu1ME3ZEWWeCmAkWTKp NG1QVf+ysuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcFwAKCRCPgPtYfRL+ TlXAB/4rVpLK0r2J4aiduOJ8JWUMGjwhO3kHxXTLF1NNQ8wBBg9YHetvuVr9rtxWS1BwJjHX8hK ARATuw55h2gO/poc7k5+KNAiEePT9PUrVcaR5t0Yf+XSi0vXANy+i/klgwghWVy15yMPfgQLFXW CHD8930JrfbuoR4zgvLIKYynchHmDxPqxQfIXMRiPe+1Zrjxk0gmrMdP6CmTTUDxW3H58U4lbd3 itYG8Ab7oIzB6oQvwPP+9i0ftJclDuhSLEUDzweiD4sEht8uLyYIV11FVU8bqgjE5s0wXgfFmd8 wT7XpKwWoDIjhblwq++dJhDv/UHcJmRGIGXJTvLYvbp9v8SJ 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/fsl_qe_udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c index 3b1cc8fa30c8..9c5dc1c1a68e 100644 --- a/drivers/usb/gadget/udc/fsl_qe_udc.c +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c @@ -2628,7 +2628,7 @@ static int qe_udc_resume(struct platform_device *dev) } #endif -static int qe_udc_remove(struct platform_device *ofdev) +static void qe_udc_remove(struct platform_device *ofdev) { struct qe_udc *udc = platform_get_drvdata(ofdev); struct qe_ep *ep; @@ -2679,8 +2679,6 @@ static int qe_udc_remove(struct platform_device *ofdev) /* wait for release() of gadget.dev to free udc */ wait_for_completion(&done); - - return 0; } /*-------------------------------------------------------------------------*/ @@ -2708,7 +2706,7 @@ static struct platform_driver udc_driver = { .of_match_table = qe_udc_match, }, .probe = qe_udc_probe, - .remove = qe_udc_remove, + .remove_new = qe_udc_remove, #ifdef CONFIG_PM .suspend = qe_udc_suspend, .resume = qe_udc_resume, From patchwork Wed May 17 23:01:33 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: 13245917 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B6EC7EE22 for ; Wed, 17 May 2023 23:03:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229934AbjEQXDy (ORCPT ); Wed, 17 May 2023 19:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229937AbjEQXDw (ORCPT ); Wed, 17 May 2023 19:03:52 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFC286EA0 for ; Wed, 17 May 2023 16:03:24 -0700 (PDT) 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-0007zc-Iu; 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 1pzQAT-000wq0-Ex; 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 1pzQAS-005UXA-5e; Thu, 18 May 2023 01:02:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Gaosheng Cui , Alan Stern , Aaro Koskinen Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 31/97] usb: gadget/fusb300_udc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:33 +0200 Message-Id: <20230517230239.187727-32-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=1878; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=R4tDeXyFW9SyhShxJC0E+iv5Shp+tVOz0vyHN3o0/XE=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUGFl+wWDhs3uOixpWcDm8z0s6tO3InGy3R9bHVScs6 Z27UU6yk9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJXOniYNgQnZNz7YvGDT3l qM4elbV7TFO4Iox8bignyEQ/s/xR5HS/+KzFhTNrRfYfUjLdcMIhnvPDnpX6io88ytUu9YvFsof sPfo9drvXTfPdZl9/XlgjVZnTcMWGN09SyY5VhC/qRUqIybmGVdIPrL08v3NKT2IVmnXhfUcX/5 pDUxzXussGm4Sxyly2K346uYufbX+di9mdvdcfyl+wSdBV/G7ik1pyu/RE9eonc/cs3Wh/3aMkU 0xFUWv9Ki2jGVcWNsjmRGbPXX/k6fI1R269ihEPYGWWnaH1q+fo4kbO9gzeklCFcnOBLWwvlM/O v+zu9FBnY0a37uLXB698/qoi7tYr9H6iWbZQABPPCwlfAA== 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/fusb300_udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/fusb300_udc.c b/drivers/usb/gadget/udc/fusb300_udc.c index 08ba9c8c1e67..bd03d475f927 100644 --- a/drivers/usb/gadget/udc/fusb300_udc.c +++ b/drivers/usb/gadget/udc/fusb300_udc.c @@ -1338,7 +1338,7 @@ static const struct usb_gadget_ops fusb300_gadget_ops = { .udc_stop = fusb300_udc_stop, }; -static int fusb300_remove(struct platform_device *pdev) +static void fusb300_remove(struct platform_device *pdev) { struct fusb300 *fusb300 = platform_get_drvdata(pdev); int i; @@ -1352,8 +1352,6 @@ static int fusb300_remove(struct platform_device *pdev) for (i = 0; i < FUSB300_MAX_NUM_EP; i++) kfree(fusb300->ep[i]); kfree(fusb300); - - return 0; } static int fusb300_probe(struct platform_device *pdev) @@ -1508,7 +1506,7 @@ static int fusb300_probe(struct platform_device *pdev) } static struct platform_driver fusb300_driver = { - .remove = fusb300_remove, + .remove_new = fusb300_remove, .driver = { .name = udc_name, }, From patchwork Wed May 17 23:01:34 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: 13245881 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4781C7EE2A for ; Wed, 17 May 2023 23:03:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbjEQXDW (ORCPT ); Wed, 17 May 2023 19:03:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbjEQXDF (ORCPT ); Wed, 17 May 2023 19:03:05 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35F5A44A8 for ; Wed, 17 May 2023 16:02:59 -0700 (PDT) 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-0007ze-Bj; 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 1pzQAT-000wq1-FB; 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 1pzQAS-005UXE-Bn; Thu, 18 May 2023 01:02:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Paolo Abeni , "Steven Rostedt (Google)" , Aaro Koskinen , Kalle Valo Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 32/97] usb: gadget/m66592-udc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:34 +0200 Message-Id: <20230517230239.187727-33-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=1899; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0QqZY4n87DFusmRIBvszoMx55BZMxGrjEDjyWCIkUh8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwesj4SwMT4e9VlfrV2aG5yCKfXVcouX0gDn M5Lf3kD8f6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcHgAKCRCPgPtYfRL+ Tre6B/4qe1Vpx6WFzazCAJtIG6zAHC5pTtyg3JQsFKLk4JNRK1yxAtD245c/m0mDCW9EVPAU8Qn EilJiMBsyQEMgsrzU5qtrFo71aI2AeeaTGrLTQgpMAUjGvZhxzB3IXCY5GP0uNHEi1Bw+pRzwf+ QCH/Wi4FiTGMi3jFkE4tgBfM5nrqUhmSdYgFyKkMypVfFYRhFhAzQ3CD/tQLchJ7OyaR6o7L49f PnhscGlu7GXPDCIrx6gx37sS6uJZNAF+438BwxK90w/t/mKAQvSfDVtBU33Toen/G2fXiZ3jy3m kopMPB2sUOU/R0oKWGI9WvScuUUe0KMhNpuMdj2AsqWi4sQN 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/gadget/udc/m66592-udc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c index 06e21cee431b..e05f45a4b56b 100644 --- a/drivers/usb/gadget/udc/m66592-udc.c +++ b/drivers/usb/gadget/udc/m66592-udc.c @@ -1512,7 +1512,7 @@ static const struct usb_gadget_ops m66592_gadget_ops = { .pullup = m66592_pullup, }; -static int m66592_remove(struct platform_device *pdev) +static void m66592_remove(struct platform_device *pdev) { struct m66592 *m66592 = platform_get_drvdata(pdev); @@ -1527,7 +1527,6 @@ static int m66592_remove(struct platform_device *pdev) clk_put(m66592->clk); } kfree(m66592); - return 0; } static void nop_completion(struct usb_ep *ep, struct usb_request *r) @@ -1688,7 +1687,7 @@ static int m66592_probe(struct platform_device *pdev) /*-------------------------------------------------------------------------*/ static struct platform_driver m66592_driver = { - .remove = m66592_remove, + .remove_new = m66592_remove, .driver = { .name = udc_name, }, From patchwork Wed May 17 23:01: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: 13245876 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94031C7EE22 for ; Wed, 17 May 2023 23:03:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229846AbjEQXDS (ORCPT ); Wed, 17 May 2023 19:03:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbjEQXDE (ORCPT ); Wed, 17 May 2023 19:03:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 714715BBF for ; Wed, 17 May 2023 16:02:59 -0700 (PDT) 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-0007zq-VP; 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 1pzQAT-000wq6-HV; 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 1pzQAS-005UXI-Iq; Thu, 18 May 2023 01:02:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Alan Stern , Aaro Koskinen Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 33/97] usb: gadget/mv_u3d_core: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:35 +0200 Message-Id: <20230517230239.187727-34-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=1837; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zcSlVV1EYwjP63cekwZqA0HLfm1F0YfqEVQo5Z/Wm4Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwfneonpmvi8GteqsD4IbJXE3I5GcUDIOy5f NmV2tRPotGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcHwAKCRCPgPtYfRL+ TgKbB/9+UdYlZA+GE/GOIFiyhM8etuZqb5IN+9sTFxW3lBwC91vvQiyxPhuu/IstOGgF71yVqDP C6MYYU8L2ZrKYHbT1wKHeO295h5ZZvMNwIXW+CmiEa7NH62B7Hv+6ADNes2HXXTtQH+ojFyUr5O Ob8c4RZokPBFH17Et1aZryUyRurGctny/mx24Hjz4ztylgAEqrZQbNSWG8ZaBArgJOopLqc9Ty+ uz/pg0rQR4nahP8tFCN9tEEzsBZrnV4og7jG0GIZTCNEeqoV5PgGPkD5qj4eWGqwNNvsN0n6U7R 41tXQLXRqRCmNk9IkYG3ra9ws+8gy+QI/bcKz2j5BSBgz1JH 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/mv_u3d_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c index 411b6179782c..3473048a85f5 100644 --- a/drivers/usb/gadget/udc/mv_u3d_core.c +++ b/drivers/usb/gadget/udc/mv_u3d_core.c @@ -1746,7 +1746,7 @@ static irqreturn_t mv_u3d_irq(int irq, void *dev) return IRQ_HANDLED; } -static int mv_u3d_remove(struct platform_device *dev) +static void mv_u3d_remove(struct platform_device *dev) { struct mv_u3d *u3d = platform_get_drvdata(dev); @@ -1775,8 +1775,6 @@ static int mv_u3d_remove(struct platform_device *dev) clk_put(u3d->clk); kfree(u3d); - - return 0; } static int mv_u3d_probe(struct platform_device *dev) @@ -2049,7 +2047,7 @@ static void mv_u3d_shutdown(struct platform_device *dev) static struct platform_driver mv_u3d_driver = { .probe = mv_u3d_probe, - .remove = mv_u3d_remove, + .remove_new = mv_u3d_remove, .shutdown = mv_u3d_shutdown, .driver = { .name = "mv-u3d", From patchwork Wed May 17 23:01: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: 13245870 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84791C77B75 for ; Wed, 17 May 2023 23:03:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbjEQXDN (ORCPT ); Wed, 17 May 2023 19:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbjEQXC7 (ORCPT ); Wed, 17 May 2023 19:02:59 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F86494 for ; Wed, 17 May 2023 16:02:58 -0700 (PDT) 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-0007zf-VG; 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 1pzQAT-000wpz-Ek; 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 1pzQAS-005UXM-OR; Thu, 18 May 2023 01:02:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Kang Chen , Aaro Koskinen , Alan Stern Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 34/97] usb: gadget/mv_udc_core: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:36 +0200 Message-Id: <20230517230239.187727-35-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=1859; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=o0uiXMjSJnWZuUHZfsBVs8jXc44tMvrraJjmVmeS9Rc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwl/XDrjd4uouPOEmoKaGVTBxBlCTWJMUHsq byR5E541NiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcJQAKCRCPgPtYfRL+ TmykB/wNh5vxh5u9kbT3ztvbRD3X6v0Yet7qtAtPb+ju8kL/UWQwjrxaHwWaVBDrXzdUFal2URI //Pckb64lRJ5WOZ/fdzpg3y28gr/IicYY5d70BNJHgnlNtl9YAcLRdgpN8EBcLdpOzf+9Jjbbj2 xc9JAxwK4YkevYvmfOBWbaR7U0anV4w2w7LcX+oOIdmUEPdzZ0Bbx64VrA3ZebbHlcUaKp19w3n o/0oRkZ1xj3qhjery/jMRDcqRyDpebE9vgd6gmhu8gEoURNqVIlxtFeb7sCpjNyqn39kaOMBJBo RkmerY2xf9mjk+57GSvWLNpAW4tF9FvoY7wozWtToa0EyM2j 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/mv_udc_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c index 08474c08d874..79db74e2040b 100644 --- a/drivers/usb/gadget/udc/mv_udc_core.c +++ b/drivers/usb/gadget/udc/mv_udc_core.c @@ -2077,7 +2077,7 @@ static void gadget_release(struct device *_dev) complete(udc->done); } -static int mv_udc_remove(struct platform_device *pdev) +static void mv_udc_remove(struct platform_device *pdev) { struct mv_udc *udc; @@ -2099,8 +2099,6 @@ static int mv_udc_remove(struct platform_device *pdev) /* free dev, wait for the release() finished */ wait_for_completion(udc->done); - - return 0; } static int mv_udc_probe(struct platform_device *pdev) @@ -2411,7 +2409,7 @@ static void mv_udc_shutdown(struct platform_device *pdev) static struct platform_driver udc_driver = { .probe = mv_udc_probe, - .remove = mv_udc_remove, + .remove_new = mv_udc_remove, .shutdown = mv_udc_shutdown, .driver = { .name = "mv-udc", From patchwork Wed May 17 23:01:37 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: 13245890 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DE35C7EE22 for ; Wed, 17 May 2023 23:03:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbjEQXDb (ORCPT ); Wed, 17 May 2023 19:03:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229810AbjEQXDK (ORCPT ); Wed, 17 May 2023 19:03:10 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEC165270 for ; Wed, 17 May 2023 16:03:01 -0700 (PDT) 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-000815-VG; 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 1pzQAT-000wqD-QG; 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 1pzQAT-005UXP-0J; Thu, 18 May 2023 01:02:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Shaomin Deng , Aaro Koskinen , Alan Stern Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 35/97] usb: gadget/net2272: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:37 +0200 Message-Id: <20230517230239.187727-36-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=1672; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=aXHekxaoErRnaG+fXwazrKam9LtPHQRggt9kK1RP/XU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVwrtoQFMyiI8LJ1OuceNtBGeHGansq6aM5vL Nup/whTY9qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcKwAKCRCPgPtYfRL+ Tt6AB/sFEjTfkEgDrDjeLN+f86/7Kvzp+od0jnlCasf7dQu/8L9h3d5lCun0G0hwjSETMXf+u/q 64RVceAswJFmaEh/twqYQUUONUYGhkrP5KOGAzYm8hu5JWWmhH4iWkzW8FEEPyM1O1nu3B36vq6 Y0G1P3wNP0JdRYJNyt/i3+zr1Gkrhf0eB6WzcVa5WDmbsqRZd7999JtAJelzCKoZbq2RmjId5+U r/Uedni6h4PHXoonSOYk39Z+E+rUCXe8rKFT7T/og/WEyCl9nv0t/Eh80ctXtmedwJ5yhG2wQ4z Up78QUnTsMqEg7BUARtTUxC8JqdCbLjZ1M5J5/s4F0UsNAWI 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/net2272.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c index 538c1b9a2883..12e76bb62c20 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c @@ -2670,7 +2670,7 @@ net2272_plat_probe(struct platform_device *pdev) return ret; } -static int +static void net2272_plat_remove(struct platform_device *pdev) { struct net2272 *dev = platform_get_drvdata(pdev); @@ -2681,13 +2681,11 @@ net2272_plat_remove(struct platform_device *pdev) resource_size(&pdev->resource[0])); usb_put_gadget(&dev->gadget); - - return 0; } static struct platform_driver net2272_plat_driver = { .probe = net2272_plat_probe, - .remove = net2272_plat_remove, + .remove_new = net2272_plat_remove, .driver = { .name = driver_name, }, From patchwork Wed May 17 23:01:38 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: 13245902 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D89DDC7EE23 for ; Wed, 17 May 2023 23:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbjEQXDk (ORCPT ); Wed, 17 May 2023 19:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbjEQXDT (ORCPT ); Wed, 17 May 2023 19:03:19 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 263DD5BBD for ; Wed, 17 May 2023 16:03:03 -0700 (PDT) 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-00082Z-Q5; 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 1pzQAU-000wqK-4D; 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-005UXU-7C; Thu, 18 May 2023 01:02:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Arnd Bergmann , Laurent Pinchart , Richard Leitner , Colin Ian King , Wolfram Sang , Aaro Koskinen Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 36/97] usb: gadget/omap_udc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:38 +0200 Message-Id: <20230517230239.187727-37-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=1899; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BEpoIGFwDuicKHv28sqGt3VfmN27wr8s2JJtjkEWcmo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVws+jbX089C16AYYv0oZGqLTLl+4RxbLfZi/ fgSwLA5jOqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcLAAKCRCPgPtYfRL+ ThmMB/9VwaKQ5fkbdJGcFK3AqhgHv3DqGO429yUz1dORlZC8y65k0VKcZ2cR0LKngh0HMAHEsw0 JiUSKP6H2EQRxsUhbRVymnmDEZwJKFvSDEtnWfbUP6xZqfx603IQQ2DD3qu5TyoCLP6MPlSeS60 KnDLZTyAYeYVJ4hJgnDruOsGl5y1NVwlln4z2kCD9nLfzsZa1IS8PLLeqyBucasXMYzFh5V8om3 eZK4KMlwlFt/IfbzNC4yJ9TDy+U8z3RNPyEvSRskSCtSsCZyr6m9ygQO8uofdMw5VF4B082y5no apGKi6+uJsmDENpiabpk+Lm3jnNiaO499FiWaUng8TRsZm9C 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/omap_udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/omap_udc.c b/drivers/usb/gadget/udc/omap_udc.c index 2d87c7cd5f7e..10c5d7f726a1 100644 --- a/drivers/usb/gadget/udc/omap_udc.c +++ b/drivers/usb/gadget/udc/omap_udc.c @@ -2927,7 +2927,7 @@ static int omap_udc_probe(struct platform_device *pdev) return status; } -static int omap_udc_remove(struct platform_device *pdev) +static void omap_udc_remove(struct platform_device *pdev) { DECLARE_COMPLETION_ONSTACK(done); @@ -2939,8 +2939,6 @@ static int omap_udc_remove(struct platform_device *pdev) release_mem_region(pdev->resource[0].start, resource_size(&pdev->resource[0])); - - return 0; } /* suspend/resume/wakeup from sysfs (echo > power/state) or when the @@ -2985,7 +2983,7 @@ static int omap_udc_resume(struct platform_device *dev) static struct platform_driver udc_driver = { .probe = omap_udc_probe, - .remove = omap_udc_remove, + .remove_new = omap_udc_remove, .suspend = omap_udc_suspend, .resume = omap_udc_resume, .driver = { 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: 13245908 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 849B7C7EE2A for ; Wed, 17 May 2023 23:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbjEQXDo (ORCPT ); Wed, 17 May 2023 19:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbjEQXDW (ORCPT ); Wed, 17 May 2023 19:03:22 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9F1C5B9C for ; Wed, 17 May 2023 16:03:04 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:40 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: 13245866 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65A81C7EE22 for ; Wed, 17 May 2023 23:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbjEQXDJ (ORCPT ); Wed, 17 May 2023 19:03:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjEQXC5 (ORCPT ); Wed, 17 May 2023 19:02:57 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74D835B9C for ; Wed, 17 May 2023 16:02:55 -0700 (PDT) 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-00083O-CE; 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-000wqO-9V; 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-005UXe-K2; Thu, 18 May 2023 01:02:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 38/97] usb: gadget/r8a66597-udc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:40 +0200 Message-Id: <20230517230239.187727-39-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=1984; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=NDY1z3UVJjfsaLxnsnm+4fEeVi8s19FlTEjtWSTeQ7k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVw0I+F8ByazoxLSC9g0HQrr8uNUAgZnhICwP UxKXtu60yyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcNAAKCRCPgPtYfRL+ TqBjCACKN1ypIP6SHzHgNtFeviP4t+GsU6SPJPCGxTJ0yNrwh10fyzqXmObmeUSQu4JhCOC8foo u4ho6aHlBt9pHmJk3TeAXsXyHBmTjj7wm8TBG6JRPCV51XBiDx4JIqwInUqWog4qEu/9gUHrPui 2xqiCCPlgNAMHSiadhY2JO4qYPH+bYyexUVn5wtJqWjWpRJrfx7vctRdDXQoLYFW2MY+2dfHzwl LzwcD+/Ck+QazQu4Nzk5Fn+C36Ki2y6FtBuW9O9Xzh84OoaPP7wjDQ7dD2/iL+k9bhQVkLAUcrI FORzQovAophFkJq0QU14OF53AAgC79fpyLAUpf/5SBe/uXZa 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/gadget/udc/r8a66597-udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c b/drivers/usb/gadget/udc/r8a66597-udc.c index 38e4d6b505a0..51b665f15c8e 100644 --- a/drivers/usb/gadget/udc/r8a66597-udc.c +++ b/drivers/usb/gadget/udc/r8a66597-udc.c @@ -1805,7 +1805,7 @@ static const struct usb_gadget_ops r8a66597_gadget_ops = { .set_selfpowered = r8a66597_set_selfpowered, }; -static int r8a66597_remove(struct platform_device *pdev) +static void r8a66597_remove(struct platform_device *pdev) { struct r8a66597 *r8a66597 = platform_get_drvdata(pdev); @@ -1816,8 +1816,6 @@ static int r8a66597_remove(struct platform_device *pdev) if (r8a66597->pdata->on_chip) { clk_disable_unprepare(r8a66597->clk); } - - return 0; } static void nop_completion(struct usb_ep *ep, struct usb_request *r) @@ -1966,7 +1964,7 @@ static int r8a66597_probe(struct platform_device *pdev) /*-------------------------------------------------------------------------*/ static struct platform_driver r8a66597_driver = { - .remove = r8a66597_remove, + .remove_new = r8a66597_remove, .driver = { .name = udc_name, }, From patchwork Wed May 17 23:01:41 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: 13245918 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A02FAC77B75 for ; Wed, 17 May 2023 23:03:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbjEQXDz (ORCPT ); Wed, 17 May 2023 19:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbjEQXDx (ORCPT ); Wed, 17 May 2023 19:03:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 150F16EA2 for ; Wed, 17 May 2023 16:03:25 -0700 (PDT) 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 1pzQAZ-00084n-B6; Thu, 18 May 2023 01:02:55 +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-000wqV-K8; 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-005UXi-Px; Thu, 18 May 2023 01:02:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Biju Das , Krzysztof Kozlowski , Geert Uytterhoeven , Laurent Pinchart , Zheng Wang , Phil Edworthy , Wolfram Sang Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 39/97] usb: gadget/renesas_usb3: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:41 +0200 Message-Id: <20230517230239.187727-40-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=2052; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jQiPorhy6sNtZg2n3wvkp/teyD+YbG0swuuTx0hPAG0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVw1+egEb8vx2pZgEJczEhbNjlP2vUbJAdzF+ iqIDRRGs7KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcNQAKCRCPgPtYfRL+ TrefB/94n9QainGS7gVjWaf91wMRQfDpGRsWKld5YL1KQb6d/Oi4m6ihR5WdgER8ivIuNIYtse6 2GTK0fvjTyeV9KshlwwS9to0rflDYs1z5zsPphKEhFH30pALYtiND8JaPzQpXukyxYtPKy8vMJd P+9EULRlIZJRnNPq6pjAzFIUHLQ+CTGAhoR673pnhghLO2xDVjSqkP2QgtVtS6RE+xstuIixOy4 Y5ageGyWIDzsXqquX7G7sQE1LaV7Sa2v7r6FchTGylZOgtjFSUwFkSvazQPYUVld0hwFC4jpk2O k7+SrwC02eAoPhMlXaQSEKA+FhJqlKy+HZHJaa9kdn920SOr 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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 Reviewed-by: Geert Uytterhoeven --- drivers/usb/gadget/udc/renesas_usb3.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index aac8bc185afa..7443b60da5d2 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -2653,7 +2653,7 @@ static void renesas_usb3_debugfs_init(struct renesas_usb3 *usb3, } /*------- platform_driver ------------------------------------------------*/ -static int renesas_usb3_remove(struct platform_device *pdev) +static void renesas_usb3_remove(struct platform_device *pdev) { struct renesas_usb3 *usb3 = platform_get_drvdata(pdev); @@ -2669,8 +2669,6 @@ static int renesas_usb3_remove(struct platform_device *pdev) __renesas_usb3_ep_free_request(usb3->ep0_req); pm_runtime_disable(&pdev->dev); - - return 0; } static int renesas_usb3_init_ep(struct renesas_usb3 *usb3, struct device *dev, @@ -3015,7 +3013,7 @@ static SIMPLE_DEV_PM_OPS(renesas_usb3_pm_ops, renesas_usb3_suspend, static struct platform_driver renesas_usb3_driver = { .probe = renesas_usb3_probe, - .remove = renesas_usb3_remove, + .remove_new = renesas_usb3_remove, .driver = { .name = udc_name, .pm = &renesas_usb3_pm_ops, From patchwork Wed May 17 23:01:42 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: 13245868 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EA8EC7EE2A for ; Wed, 17 May 2023 23:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbjEQXDL (ORCPT ); Wed, 17 May 2023 19:03:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjEQXC5 (ORCPT ); Wed, 17 May 2023 19:02:57 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A28F4C2C for ; Wed, 17 May 2023 16:02:56 -0700 (PDT) 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-00085d-N8; 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-000wqa-Qt; 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-005UXm-WA; Thu, 18 May 2023 01:02:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herve Codina , Greg Kroah-Hartman Cc: linux-renesas-soc@vger.kernel.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 40/97] usb: gadget/renesas_usbf: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:42 +0200 Message-Id: <20230517230239.187727-41-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=1752; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cJqX22+C542QnbrYKQvU9OlVT/9BrTtjw4Gf97OHUis=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUGDORlOb1veydDLGBntdqbTdmnV3TzVs7R9A1U0Z+2 8rYk9WdjMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAEzE35b9n11hRsUub9NinycL NXY7VAia6e13fNud7Lb4zWJ3rZp/5Wf2CHEHecnVNK+zSshhUC/MUl65U0WUvSE4eVugtE+cmvT biMe9xW2eC74/uNkQ7hTfctSmZ0XVv3mtPvNz1/DyHDVp5FmW0OC7Y7mq5B1V587MWv45HXum7T +2/avpw6BvE7OmOBYtunjo0OsTDZ0dL3T2ssx70MXCMvHkk+7PPqsZNDwO1mXP8niY5lh/4dq5B UusK8SmFbx2Lda7VSqgu2J9eMf1uZMvFZVFqThfOSqV96/YP7vDsir72tUdDm+9jukJftqluOzE tE62q1b+98wFd6m+luMO/JVQI2uqnS4v+iP/w28T/+sA 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Geert Uytterhoeven Acked-by: Herve Codina --- drivers/usb/gadget/udc/renesas_usbf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/renesas_usbf.c b/drivers/usb/gadget/udc/renesas_usbf.c index 84ac9fe4ce7f..6cd0af83e91e 100644 --- a/drivers/usb/gadget/udc/renesas_usbf.c +++ b/drivers/usb/gadget/udc/renesas_usbf.c @@ -3361,15 +3361,13 @@ static int usbf_probe(struct platform_device *pdev) return 0; } -static int usbf_remove(struct platform_device *pdev) +static void usbf_remove(struct platform_device *pdev) { struct usbf_udc *udc = platform_get_drvdata(pdev); usb_del_gadget_udc(&udc->gadget); pm_runtime_put(&pdev->dev); - - return 0; } static const struct of_device_id usbf_match[] = { @@ -3385,7 +3383,7 @@ static struct platform_driver udc_driver = { .of_match_table = usbf_match, }, .probe = usbf_probe, - .remove = usbf_remove, + .remove_new = usbf_remove, }; module_platform_driver(udc_driver); From patchwork Wed May 17 23:01:43 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: 13245926 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C153C7EE2E for ; Wed, 17 May 2023 23:04:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbjEQXEJ (ORCPT ); Wed, 17 May 2023 19:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbjEQXEE (ORCPT ); Wed, 17 May 2023 19:04:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61CBA7289 for ; Wed, 17 May 2023 16:03:33 -0700 (PDT) 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-00088U-RT; 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-000wqt-Lw; 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-005UXp-5m; Thu, 18 May 2023 01:02:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Thinh Nguyen , Chunfeng Yun , Biju Das , Krzysztof Kozlowski , Rob Herring Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 41/97] usb: gadget/rzv2m_usb3drd: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:43 +0200 Message-Id: <20230517230239.187727-42-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=1971; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=w54+42McoK76jI0g6Y71OmcuxsZ4Tbj0xof+53QQfpM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVw34DEN5EDPwgdOmTaXvKczCEAj4mNVi97qA QHrRt2CACKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcNwAKCRCPgPtYfRL+ Th6gCACpVBY3g/EHSwqBLLOskJMgo1sFcBibMVYh7c1HAzXCzG0veism3uT8m+kJqt719j+QJqc OVxhZTxfRA8tMuM0EbJaGqPhCSCcjHVgARZNHAyTiF7mHvR3hLvdwDk/4Ak4+/6KxZkAmjlNPCj /diJs5RKoEhWXdXLyZ6R6vISkRHEXEKsKKwqQXqDS2C6kwSWaDQNijVIG3eG4HHQSg6b3CuwxQt 0LnsQK95KdijXTq1Lp3w2pJ2Nz3QNVLHYGkfaU8QZNE3WYPn1Fe7I7NoxfZPAvbcB16omkT4vPa D7kvEf/6JeDOs57/VkGtdQGepyRLg2a9jyrP3bTxKrOWfACE 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Biju Das --- drivers/usb/gadget/udc/rzv2m_usb3drd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/rzv2m_usb3drd.c b/drivers/usb/gadget/udc/rzv2m_usb3drd.c index 589c7252e014..36f4ff00d22f 100644 --- a/drivers/usb/gadget/udc/rzv2m_usb3drd.c +++ b/drivers/usb/gadget/udc/rzv2m_usb3drd.c @@ -58,7 +58,7 @@ void rzv2m_usb3drd_reset(struct device *dev, bool host) } EXPORT_SYMBOL_GPL(rzv2m_usb3drd_reset); -static int rzv2m_usb3drd_remove(struct platform_device *pdev) +static void rzv2m_usb3drd_remove(struct platform_device *pdev) { struct rzv2m_usb3drd *usb3 = platform_get_drvdata(pdev); @@ -66,8 +66,6 @@ static int rzv2m_usb3drd_remove(struct platform_device *pdev) pm_runtime_put(usb3->dev); pm_runtime_disable(&pdev->dev); reset_control_assert(usb3->drd_rstc); - - return 0; } static int rzv2m_usb3drd_probe(struct platform_device *pdev) @@ -129,7 +127,7 @@ static struct platform_driver rzv2m_usb3drd_driver = { .of_match_table = rzv2m_usb3drd_of_match, }, .probe = rzv2m_usb3drd_probe, - .remove = rzv2m_usb3drd_remove, + .remove_new = rzv2m_usb3drd_remove, }; module_platform_driver(rzv2m_usb3drd_driver); From patchwork Wed May 17 23:01:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245869 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 978B3C7EE22 for ; Wed, 17 May 2023 23:03:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229824AbjEQXDM (ORCPT ); Wed, 17 May 2023 19:03:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbjEQXC6 (ORCPT ); Wed, 17 May 2023 19:02:58 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 666934C02 for ; Wed, 17 May 2023 16:02:57 -0700 (PDT) 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-00087k-HR; 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-000wqm-Fy; 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-005UXt-BN; Thu, 18 May 2023 01:02:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Rob Herring Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 42/97] usb: gadget/snps_udc_plat: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:44 +0200 Message-Id: <20230517230239.187727-43-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=2167; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=GZKZtr6FvVppdTP0wluupIzhs1D1LebeK0y89z4ljPM=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUGAu27GrnyP+Rc0PPiHrzXy81f/O9L/H4LY3cKVNnr Tit+7C1k9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJZKzkYJgXuoXxbcWdC7kB IUW5a/iW86nWNVk0tdypWv6kRNQ9PMhF+3bz4azTW15c5Fdk25eQOqOdmzP5yK8rSQE7f6u9KXs 1Q0bed+MVs4obYYz3bRXZlocnbFZq3xf5iEPgqsCppmlHg6z3MTy59tF/8k+uX9vd6nNvKwg79p SuMbhZxpMtkHgh6v/51QsKi47UTP2TmafjJuuwcuGxrJJTttclOiobOXb953sR9e5Bwc2VdxLtS zxuCbr2GJf7Rosb5r/ulj5caT/hfsXnRy41GVNuNggvVPu6liflkeGeTYt9jx9WOxYf9+yoxS+b 77v/bZZW5K7skqrVd1bTcm+vKctiznB4e1htq/rfju3vAQ== 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/snps_udc_plat.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/snps_udc_plat.c b/drivers/usb/gadget/udc/snps_udc_plat.c index 0d3e705655b9..0ed685db149d 100644 --- a/drivers/usb/gadget/udc/snps_udc_plat.c +++ b/drivers/usb/gadget/udc/snps_udc_plat.c @@ -225,7 +225,7 @@ static int udc_plat_probe(struct platform_device *pdev) return ret; } -static int udc_plat_remove(struct platform_device *pdev) +static void udc_plat_remove(struct platform_device *pdev) { struct udc *dev; @@ -234,7 +234,7 @@ static int udc_plat_remove(struct platform_device *pdev) usb_del_gadget_udc(&dev->gadget); /* gadget driver must not be registered */ if (WARN_ON(dev->driver)) - return 0; + return; /* dma pool cleanup */ free_dma_pools(dev); @@ -248,8 +248,6 @@ static int udc_plat_remove(struct platform_device *pdev) extcon_unregister_notifier(dev->edev, EXTCON_USB, &dev->nb); dev_info(&pdev->dev, "Synopsys UDC platform driver removed\n"); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -315,7 +313,7 @@ MODULE_DEVICE_TABLE(of, of_udc_match); static struct platform_driver udc_plat_driver = { .probe = udc_plat_probe, - .remove = udc_plat_remove, + .remove_new = udc_plat_remove, .driver = { .name = "snps-udc-plat", .of_match_table = of_match_ptr(of_udc_match), From patchwork Wed May 17 23:01:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245912 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D16DAC7EE2A for ; Wed, 17 May 2023 23:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229929AbjEQXDr (ORCPT ); Wed, 17 May 2023 19:03:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbjEQXDW (ORCPT ); Wed, 17 May 2023 19:03:22 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 402607298 for ; Wed, 17 May 2023 16:03:05 -0700 (PDT) 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-00087R-5I; 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 1pzQAV-000wqi-D5; 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-005UXy-H4; Thu, 18 May 2023 01:02:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter , Wayne Chang , Haotien Hsu , Jim Lin , Tang Bin , Sing-Han Chen Cc: linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 43/97] usb: gadget/tegra-xudc: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:45 +0200 Message-Id: <20230517230239.187727-44-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=1932; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=V8wJ4hIc/RpANBgbyAoFGSUry1QiFqxLkT0nd/ayWvU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVw5N8mol602Bpt30MSTjGwYDtMkB59zk6r4+ k9D7olaw5qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcOQAKCRCPgPtYfRL+ TtZyB/9MGE27mEHWJTu5ks9TZR7zldbAhH3dBv3g0e6K9Pjpbtmfx1eAv26TSfrVsqEEgPlI1UY szf+/CNd0rtgc0tk4+wDftTpB6VGFCJ1gda7fBez+KNUVK1nw+XAnqCZqOCMQBjdzZPLh5DXwtT BGUsJN6twWYEWSH+fwJwu48bIqDKOclND5aGhILQxBIG78Xt8q7Ki7fOkLjDG7dSPCVpSLBTh58 gQnCu5hQY62oyRk+BQwi0dOmUGsW1/RGotbPunSApyQ8sGmqHreXtr1KQfjnyMaegKJ3FAXBB+S ECS3MTPT+ztBLSkO70FYGFZH6h+/gPEglsVhD36zXGg/QDb8 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/tegra-xudc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c index 34e9c1df54c7..83eaa65ddde3 100644 --- a/drivers/usb/gadget/udc/tegra-xudc.c +++ b/drivers/usb/gadget/udc/tegra-xudc.c @@ -3906,7 +3906,7 @@ static int tegra_xudc_probe(struct platform_device *pdev) return err; } -static int tegra_xudc_remove(struct platform_device *pdev) +static void tegra_xudc_remove(struct platform_device *pdev) { struct tegra_xudc *xudc = platform_get_drvdata(pdev); unsigned int i; @@ -3936,8 +3936,6 @@ static int tegra_xudc_remove(struct platform_device *pdev) pm_runtime_put(xudc->dev); tegra_xusb_padctl_put(xudc->padctl); - - return 0; } static int __maybe_unused tegra_xudc_powergate(struct tegra_xudc *xudc) @@ -4063,7 +4061,7 @@ static const struct dev_pm_ops tegra_xudc_pm_ops = { static struct platform_driver tegra_xudc_driver = { .probe = tegra_xudc_probe, - .remove = tegra_xudc_remove, + .remove_new = tegra_xudc_remove, .driver = { .name = "tegra-xudc", .pm = &tegra_xudc_pm_ops, 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: 13245880 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA634C77B75 for ; Wed, 17 May 2023 23:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229875AbjEQXDW (ORCPT ); Wed, 17 May 2023 19:03:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbjEQXDF (ORCPT ); Wed, 17 May 2023 19:03:05 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 127456189 for ; Wed, 17 May 2023 16:02:59 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: 13245928 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50BC2C77B75 for ; Wed, 17 May 2023 23:04:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbjEQXEL (ORCPT ); Wed, 17 May 2023 19:04:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229951AbjEQXEF (ORCPT ); Wed, 17 May 2023 19:04:05 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C335661A4 for ; Wed, 17 May 2023 16:03:35 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245879 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BDC2C7EE22 for ; Wed, 17 May 2023 23:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229867AbjEQXDV (ORCPT ); Wed, 17 May 2023 19:03:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbjEQXDE (ORCPT ); Wed, 17 May 2023 19:03:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99DE35FFA for ; Wed, 17 May 2023 16:02:59 -0700 (PDT) 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-000894-TP; 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-000wqy-Uw; 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 1pzQAV-005UY9-75; Thu, 18 May 2023 01:02:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Justin Chen , Al Cooper , Greg Kroah-Hartman Cc: Broadcom internal kernel review list , linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 46/97] usb: ehci-brcm: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:48 +0200 Message-Id: <20230517230239.187727-47-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=1923; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MI4AZeLzTmm6YhxSCcSKJx6V52fmTUxX3Blw+rwDlE8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxCOi03LGbbkWujkUqyXxJmQRCjIkSeYjr97 kuRk9u7Si+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcQgAKCRCPgPtYfRL+ Ttj9CACKuLD7yH0z3SRKoaPFI/abpMb2AriPjw0Ur6JnNsIsOnUpfnqZd8epUu8AjGcj+dtgsPG V3DSBo9B+IxmN3fUhOjbT6bn/pJdIOfeCaGkYAycy3g7jBkHdgjHdOsqNZsreNiJXs2/m9LCYlM LSs5AcVQV1M3kCav2SAdMlbMZpr3P0JtKGpCJ7dFVM8WT34CW1rmOGSKA0PNgyuHml2D69CbTEk K3S8Ra5TkUpYvoWq6GFxJFg+vtl+C2b5mPaGgDeARpkaFPyEeJ2cYWw4BrD+ELjrAk6oRgvOTY4 uPIRC6wsMlxlExMj+MIKVxqtIlgaeTwCYNOJ0GrDbDh1EmNo 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli --- drivers/usb/host/ehci-brcm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-brcm.c b/drivers/usb/host/ehci-brcm.c index 6a0f64c9e5e8..0362a082abb4 100644 --- a/drivers/usb/host/ehci-brcm.c +++ b/drivers/usb/host/ehci-brcm.c @@ -188,7 +188,7 @@ static int ehci_brcm_probe(struct platform_device *pdev) return err; } -static int ehci_brcm_remove(struct platform_device *dev) +static void ehci_brcm_remove(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); struct brcm_priv *priv = hcd_to_ehci_priv(hcd); @@ -196,7 +196,6 @@ static int ehci_brcm_remove(struct platform_device *dev) usb_remove_hcd(hcd); clk_disable_unprepare(priv->clk); usb_put_hcd(hcd); - return 0; } static int __maybe_unused ehci_brcm_suspend(struct device *dev) @@ -250,7 +249,7 @@ static const struct of_device_id brcm_ehci_of_match[] = { static struct platform_driver ehci_brcm_driver = { .probe = ehci_brcm_probe, - .remove = ehci_brcm_remove, + .remove_new = ehci_brcm_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "ehci-brcm", 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: 13245915 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A244C7EE22 for ; Wed, 17 May 2023 23:03:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbjEQXDu (ORCPT ); Wed, 17 May 2023 19:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbjEQXDZ (ORCPT ); Wed, 17 May 2023 19:03:25 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C067B6195 for ; Wed, 17 May 2023 16:03:06 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245871 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C27D2C7EE23 for ; Wed, 17 May 2023 23:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229829AbjEQXDO (ORCPT ); Wed, 17 May 2023 19:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbjEQXDA (ORCPT ); Wed, 17 May 2023 19:03:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4393D5588 for ; Wed, 17 May 2023 16:02:58 -0700 (PDT) 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-0008AL-E6; 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-000wr9-An; 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-005UYG-Im; Thu, 18 May 2023 01:02:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 48/97] usb: ehci-fsl: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:50 +0200 Message-Id: <20230517230239.187727-49-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=1852; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=aRch/8zx14C7od5k0ECgKh6hDD+WUEGbNMiS1Q6GGdM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxJ8U76kvaSc+jzHomtp/8XSt5FPsZWhG2Tj iKN6SfPrvWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcSQAKCRCPgPtYfRL+ TsRCB/9UnHKFgTcul+32abWMzEZ/Eibz+cscIQ8xqIeUZ4p4zLWbwZXtO2nziMS74XWvets3yPg /6n+7Wy5E6UiN69/iv5M/IL486Oe6cc8uplI7MbT4bbc2tE5FT20ZF8eljzgaiibsHZiuQJp7MB pqUoy0JQR4sh8X2feCHEhSxII/Z1EpH1gjx4/MgnnZL42oaqLtXOdrBwjz2y0YkQz+wcU2UaJZr g3NuTGSdEkVS+1N5ci/oN939/2kdHU0N0AiYe+GT6ZCfHpgIs/oz5qnhzZuAj9HPw5DhkR6+6kK kyZ5NRF0tMbEcytJRQmvUOoIrNNp4GuxVojJCHlqTl20KZFh 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-fsl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index d74fa5ba845b..81d60a695510 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -684,7 +684,7 @@ static const struct ehci_driver_overrides ehci_fsl_overrides __initconst = { * * Reverses the effect of usb_hcd_fsl_probe(). */ -static int fsl_ehci_drv_remove(struct platform_device *pdev) +static void fsl_ehci_drv_remove(struct platform_device *pdev) { struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); struct usb_hcd *hcd = platform_get_drvdata(pdev); @@ -703,13 +703,11 @@ static int fsl_ehci_drv_remove(struct platform_device *pdev) if (pdata->exit) pdata->exit(pdev); usb_put_hcd(hcd); - - return 0; } static struct platform_driver ehci_fsl_driver = { .probe = fsl_ehci_drv_probe, - .remove = fsl_ehci_drv_remove, + .remove_new = fsl_ehci_drv_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = DRV_NAME, From patchwork Wed May 17 23:01:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245872 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 571B0C7EE2A for ; Wed, 17 May 2023 23:03:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229833AbjEQXDP (ORCPT ); Wed, 17 May 2023 19:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbjEQXDA (ORCPT ); Wed, 17 May 2023 19:03:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB6815BA5 for ; Wed, 17 May 2023 16:02:58 -0700 (PDT) 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 1pzQAZ-0008CN-23; Thu, 18 May 2023 01:02:55 +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 1pzQAX-000wrO-1K; Thu, 18 May 2023 01:02:53 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAV-005UYL-Of; Thu, 18 May 2023 01:02:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 49/97] usb: ehci-grlib: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:51 +0200 Message-Id: <20230517230239.187727-50-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=1807; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=a2alzHjRApaqWVslTMSS2APYTN14voyOgRjWLr+uf7s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxKeuTvQtGz0NowOvjSxwB9Hb8fQnF5a7efW kjrDTmASyOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcSgAKCRCPgPtYfRL+ TtoOB/93ODl32efd/uXF1iw4aEOxs9DKtfXmLPoT7LtPM0vM72vK4L0JFxMfJcAKkmU2aBlVz6y oyWkv3Gj1G/eWR72TmlJHJyhK0i5VQMhP5yDTtwmmiG2UdeySXTYyFhIsi/TgTbj0aoHDF+1oCs PfvW4YLB/b/puxBzIjRb862ggjoAiz/o9x3hStmpxFYAZoAi5oglHfSAqmMEbh/UVKQczB1OTuF vkrcqRVIvEe6WK0KdYJbGPUPlSkNOUJPBKa95A+Be6xg+xWYLhRlu4kw1SwZXdOPZB+k+YD3rpS mfmNVCsjXaKO96mhKnPPOqqcswF1oFlrKc4g0nJTsKWHNf9p 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-grlib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c index 0717f2ccf49d..14150e4d3382 100644 --- a/drivers/usb/host/ehci-grlib.c +++ b/drivers/usb/host/ehci-grlib.c @@ -140,7 +140,7 @@ static int ehci_hcd_grlib_probe(struct platform_device *op) } -static int ehci_hcd_grlib_remove(struct platform_device *op) +static void ehci_hcd_grlib_remove(struct platform_device *op) { struct usb_hcd *hcd = platform_get_drvdata(op); @@ -151,8 +151,6 @@ static int ehci_hcd_grlib_remove(struct platform_device *op) irq_dispose_mapping(hcd->irq); usb_put_hcd(hcd); - - return 0; } @@ -170,7 +168,7 @@ MODULE_DEVICE_TABLE(of, ehci_hcd_grlib_of_match); static struct platform_driver ehci_grlib_driver = { .probe = ehci_hcd_grlib_probe, - .remove = ehci_hcd_grlib_remove, + .remove_new = ehci_hcd_grlib_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "grlib-ehci", From patchwork Wed May 17 23:01:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245877 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 462DEC77B75 for ; Wed, 17 May 2023 23:03:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbjEQXDT (ORCPT ); Wed, 17 May 2023 19:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbjEQXDE (ORCPT ); Wed, 17 May 2023 19:03:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70DB15BBC for ; Wed, 17 May 2023 16:02:59 -0700 (PDT) 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 1pzQAZ-0008ET-Qn; Thu, 18 May 2023 01:02:55 +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 1pzQAX-000wrd-SU; Thu, 18 May 2023 01:02:53 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAW-005UYP-0D; 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, kernel@pengutronix.de Subject: [PATCH 50/97] usb: ehci-mv: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:52 +0200 Message-Id: <20230517230239.187727-51-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=1839; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=LYEd4SFZy87NrlWAmr5fGjNMexu49y0uY2smzjzz/RU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxLURztoRgDCavr73+QEosxjmr7qV7Nb33Pg JOapTe+ywWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcSwAKCRCPgPtYfRL+ TqEoB/49mvcjlS4mQk9YQEG+p1G3ZbLfRMhNhh37wYc6aHB1LDrJKtJKrsiCL2gPN3+Bzzr5xMR UHOHNW3oVQ6ZKV3MHUSxmxAhFw3y8Ify3UqKRk+9Y3oHDT1by3Vb4+RthjbOfwmqvMIc8jAepDs 8HESd7EbL5b5Qe07JXN7lOCxcgAW6R+6j1nBCu8hL/AmL1H136MpEiNSVd9ReIerUH3/IHfh9+H vopkL2bEXN2eIayqcU6Ez19uZMPHg0bKw/Rzo9kz2g8Wt/Y8M7Zo0w5MNVfrilY6X81f5zAzdeR NAyqAqnD1CMOBL03uBM6lAH77pnyqJHb65EsSDd1ENd/+PJs 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-mv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index fa46d217dd10..9320cf0e5bc7 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -235,7 +235,7 @@ static int mv_ehci_probe(struct platform_device *pdev) return retval; } -static int mv_ehci_remove(struct platform_device *pdev) +static void mv_ehci_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ehci_hcd_mv *ehci_mv = hcd_to_ehci_hcd_mv(hcd); @@ -254,8 +254,6 @@ static int mv_ehci_remove(struct platform_device *pdev) } usb_put_hcd(hcd); - - return 0; } static const struct platform_device_id ehci_id_table[] = { @@ -282,7 +280,7 @@ static const struct of_device_id ehci_mv_dt_ids[] = { static struct platform_driver ehci_mv_driver = { .probe = mv_ehci_probe, - .remove = mv_ehci_remove, + .remove_new = mv_ehci_remove, .shutdown = mv_ehci_shutdown, .driver = { .name = "mv-ehci", From patchwork Wed May 17 23:01:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245903 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B7ACC7EE2A for ; Wed, 17 May 2023 23:03:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229903AbjEQXDk (ORCPT ); Wed, 17 May 2023 19:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbjEQXDU (ORCPT ); Wed, 17 May 2023 19:03:20 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F33B16E8C for ; Wed, 17 May 2023 16:03:03 -0700 (PDT) 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-0008C6-VM; Thu, 18 May 2023 01:02:55 +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-000wrJ-TB; 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 1pzQAW-005UYU-5u; Thu, 18 May 2023 01:02:52 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Avi Fishman , Tomer Maimon , Tali Perry , Greg Kroah-Hartman Cc: Patrick Venture , Nancy Yuen , Benjamin Fair , linux-usb@vger.kernel.org, openbmc@lists.ozlabs.org, kernel@pengutronix.de Subject: [PATCH 51/97] usb: ehci-npcm7xx: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:53 +0200 Message-Id: <20230517230239.187727-52-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=1853; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IRWEUFMehPOrEoxzzFclPKCD9mj9SY5PpVKOk0B4CZA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxRgucUFRjS2RpKiqEjtIfGj4ugvO727yoho bkPUFUM6W+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcUQAKCRCPgPtYfRL+ Tsy7B/wN36tuMK6nrqt6n8p5P8bn9x78qW7mzBsIsTUJUQ2C0cdwIOAiHYux4CQr/V8TiOwv2gi HQxyQlQXdp95Ga+36L7/NRbEXFTg8whe/LI3EoTMiBvFazW+qJE8i6cPYD1o+HqI5HNhCsrYVy7 Bpy/9N2ibXaQfXt6r9J1Kt/SswwrCA8aqPtzouwd/U7Mhmsqonp5/9CAZ3hi52xx/pehV8TkQRs 4vP/Mxfoy/bv/Sr1Cj+jJZrOVw9f8GB2CkAuOwX1h2qpPxjnVZQ+pS6/a0WffDSDp5bLyW/2m02 BH2OU5DBUuPYl9WpzZ5qT5OY7KwiOnM0jE9qIDOXJY+Xwz+S 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-npcm7xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-npcm7xx.c b/drivers/usb/host/ehci-npcm7xx.c index 63af1a827fcb..ad79ce63afcf 100644 --- a/drivers/usb/host/ehci-npcm7xx.c +++ b/drivers/usb/host/ehci-npcm7xx.c @@ -106,15 +106,13 @@ static int npcm7xx_ehci_hcd_drv_probe(struct platform_device *pdev) return retval; } -static int npcm7xx_ehci_hcd_drv_remove(struct platform_device *pdev) +static void npcm7xx_ehci_hcd_drv_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); usb_remove_hcd(hcd); usb_put_hcd(hcd); - - return 0; } static const struct of_device_id npcm7xx_ehci_id_table[] = { @@ -125,7 +123,7 @@ MODULE_DEVICE_TABLE(of, npcm7xx_ehci_id_table); static struct platform_driver npcm7xx_ehci_hcd_driver = { .probe = npcm7xx_ehci_hcd_drv_probe, - .remove = npcm7xx_ehci_hcd_drv_remove, + .remove_new = npcm7xx_ehci_hcd_drv_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "npcm7xx-ehci", From patchwork Wed May 17 23:01:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245884 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB267C7EE22 for ; Wed, 17 May 2023 23:03:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229892AbjEQXDZ (ORCPT ); Wed, 17 May 2023 19:03:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbjEQXDH (ORCPT ); Wed, 17 May 2023 19:03:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16BB35BA5 for ; Wed, 17 May 2023 16:03:00 -0700 (PDT) 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-0008Gd-Or; 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-000ws5-QB; 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-005UYY-CY; 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-omap@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 52/97] usb: ehci-omap: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:54 +0200 Message-Id: <20230517230239.187727-53-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=2073; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=W/gd4eUOq8iDwcgRz4qMMy9zNeWFTEMhcBTNS6QXU7s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxTX9Ui4qRzisla9oZvKd0cyZNPzJL6XSRZN RIpIKXEzpmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcUwAKCRCPgPtYfRL+ TtvRB/9KkeTK54/RCvPgLSi6Y8E7R7Y85JFQJxhAVrtQdYEfB9NGzXMuWslCIZqs7AH1TgjU8zv /1znq8ykatoOF1ujzTods8Y7Qx5nNhObDwRGvnX0g2NapKWFL/J4vD20LNDh6X3Gu6pBt80c+Xr pwsS83NT1RoEgOt8OtFKXMXaIpt0BeRyXXyrU8sMH3369d/J7mwHS+sjw/u45h7wZbDhUNSoyyM WCh+u6qhUj6BfmHDWc4M2cL7xN3mjZhOZ9G8V8HPm2/C7NjgujCjTIYtXRkPH769Hlhn8v4FGGa 3oeYjkneSsy6Nluvs3dIUVr1VU65pPcviD3txNrz1qdgRhpk 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-omap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 7dd984722a7f..cb6509a735ac 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -237,7 +237,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) * the HCD's stop() method. It is always called from a thread * context, normally "rmmod", "apmd", or something similar. */ -static int ehci_hcd_omap_remove(struct platform_device *pdev) +static void ehci_hcd_omap_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct usb_hcd *hcd = dev_get_drvdata(dev); @@ -254,8 +254,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) usb_put_hcd(hcd); pm_runtime_put_sync(dev); pm_runtime_disable(dev); - - return 0; } static const struct of_device_id omap_ehci_dt_ids[] = { @@ -267,7 +265,7 @@ MODULE_DEVICE_TABLE(of, omap_ehci_dt_ids); static struct platform_driver ehci_hcd_omap_driver = { .probe = ehci_hcd_omap_probe, - .remove = ehci_hcd_omap_remove, + .remove_new = ehci_hcd_omap_remove, .shutdown = usb_hcd_platform_shutdown, /*.suspend = ehci_hcd_omap_suspend, */ /*.resume = ehci_hcd_omap_resume, */ From patchwork Wed May 17 23:01:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245889 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26C5DC7EE2C for ; Wed, 17 May 2023 23:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbjEQXDa (ORCPT ); Wed, 17 May 2023 19:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbjEQXDK (ORCPT ); Wed, 17 May 2023 19:03:10 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9067561B5 for ; Wed, 17 May 2023 16:03:01 -0700 (PDT) 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-0008JR-1v; 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-000wsW-59; 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 1pzQAW-005UYc-I8; 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, kernel@pengutronix.de Subject: [PATCH 53/97] usb: ehci-orion: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:55 +0200 Message-Id: <20230517230239.187727-54-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=1937; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/vlaP3u29DjeV0AOkhPpaEOyXLsMwHICdELt7b4+SyA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxZbSyw4QS7kGECINWHlk1T1q+cP2MPUQegi teoFP9Mi/2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcWQAKCRCPgPtYfRL+ TrBoB/0RuPScUC09pvrpAbyjkH+LvqHjljpubUP6GYQ4ZZwTocYyYqaWG5KJEGRbuSxboFPruLo wpY6CQfi4OW1dc+acMGMTUrayYTygYn/+nh/bf+Wf30hyBSrNn8QHdyGraFMejH8leQmu6Jzhh2 xM4eGY6vg5igXFewTxrIXqVhbQSdJl7ukNM3XUZ/cNMm9JJrVjzNR5OcZPYL4j5QTiF5MSxrG2H lHpGW1jBTRosaiHPuhXX688UQi1VwFtBK0fydEfol0r2fB0sbEzUU77SSrkKqQn1RBoXHjPATlB 6fRf5Bnmw3vJvRsEnD5Ck9rk0Xlahj/duiUsDhrk7MGLRt3x 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-orion.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index a3454a3ea4e0..2cfb27dc943a 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c @@ -321,7 +321,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) return err; } -static int ehci_orion_drv_remove(struct platform_device *pdev) +static void ehci_orion_drv_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct orion_ehci_hcd *priv = hcd_to_orion_priv(hcd); @@ -332,8 +332,6 @@ static int ehci_orion_drv_remove(struct platform_device *pdev) clk_disable_unprepare(priv->clk); usb_put_hcd(hcd); - - return 0; } static const struct of_device_id ehci_orion_dt_ids[] = { @@ -345,7 +343,7 @@ MODULE_DEVICE_TABLE(of, ehci_orion_dt_ids); static struct platform_driver ehci_orion_driver = { .probe = ehci_orion_drv_probe, - .remove = ehci_orion_drv_remove, + .remove_new = ehci_orion_drv_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "orion-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: 13245883 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8CE8C77B75 for ; Wed, 17 May 2023 23:03:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbjEQXDY (ORCPT ); Wed, 17 May 2023 19:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjEQXDG (ORCPT ); Wed, 17 May 2023 19:03:06 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B6CD5588 for ; Wed, 17 May 2023 16:03:00 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:01:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245874 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACB4CC77B75 for ; Wed, 17 May 2023 23:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229836AbjEQXDQ (ORCPT ); Wed, 17 May 2023 19:03:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbjEQXDD (ORCPT ); Wed, 17 May 2023 19:03:03 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70F7B5BBD for ; Wed, 17 May 2023 16:02:59 -0700 (PDT) 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 1pzQAZ-0008EO-QN; Thu, 18 May 2023 01:02:55 +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 1pzQAX-000wrc-RD; Thu, 18 May 2023 01:02:53 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAW-005UYi-W8; Thu, 18 May 2023 01:02:53 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 55/97] usb: ehci-ppc-of: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:57 +0200 Message-Id: <20230517230239.187727-56-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=1839; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iAYnM9HtcvhrEUQqzAdaDJmhAUJ63FvFNtL/m+7J3oA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxglbPpZuKGL625nQQNmISuVgt6G/qsLw4JJ 5PSsox0weaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcYAAKCRCPgPtYfRL+ Tl19B/4vNLCdt+ix9sIbjwJz7wao+bPknDGlkC30cI9PR9DXp45X1NlC5S/G2OkafKPR59qsWpS fStZDqRoJCURZtPEUCznnMws6CPIr7XZ/zgx28t7qqMeMp8jDPrqW5st00+TOe2H7J7vcvrc6by VuuERbCW9VKJFYPPVIxysOChh0ogvMEa8JMq5A5RtmnF68a6rKWvjGNLfSlntn11eGMmFBK3kZm sKCUjQL4eiYbZXT87L5Pq0chobzcGDc69d3bUP9WNzZF+Z8zidNUbleQTWl+KlM1QNBu46rB7D2 Lt1TL/q3m7z0Egz/eQjSTUsglzneXDGxP5JeEn1xo7AAv0FM 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-ppc-of.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c index b3aa464e9d2c..7fd83e806ae4 100644 --- a/drivers/usb/host/ehci-ppc-of.c +++ b/drivers/usb/host/ehci-ppc-of.c @@ -184,7 +184,7 @@ static int ehci_hcd_ppc_of_probe(struct platform_device *op) } -static int ehci_hcd_ppc_of_remove(struct platform_device *op) +static void ehci_hcd_ppc_of_remove(struct platform_device *op) { struct usb_hcd *hcd = platform_get_drvdata(op); struct ehci_hcd *ehci = hcd_to_ehci(hcd); @@ -216,8 +216,6 @@ static int ehci_hcd_ppc_of_remove(struct platform_device *op) } } usb_put_hcd(hcd); - - return 0; } @@ -232,7 +230,7 @@ MODULE_DEVICE_TABLE(of, ehci_hcd_ppc_of_match); static struct platform_driver ehci_hcd_ppc_of_driver = { .probe = ehci_hcd_ppc_of_probe, - .remove = ehci_hcd_ppc_of_remove, + .remove_new = ehci_hcd_ppc_of_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "ppc-of-ehci", From patchwork Wed May 17 23:01:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245882 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEF82C7EE23 for ; Wed, 17 May 2023 23:03:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbjEQXDX (ORCPT ); Wed, 17 May 2023 19:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbjEQXDG (ORCPT ); Wed, 17 May 2023 19:03:06 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CD29619A for ; Wed, 17 May 2023 16:03:00 -0700 (PDT) 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-0008GH-JM; 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-000ws1-KH; 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-005UYo-64; Thu, 18 May 2023 01:02:53 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 56/97] usb: ehci-sh: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:58 +0200 Message-Id: <20230517230239.187727-57-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=1902; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Koh3tzRVoCFXgW8AkgjOEJiFgrC5ufFfxcb1BlRfJ7M=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUmDSfH0kXTSabe7DZ/uT4z3AxR8Sq3UpSL9FW7LrGM 3Xne3adjMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAEzkxnH2/7VM3av3l8nmZqov Lc6bt9jvcXqj3v+5td8f7oh+2TDzyWaPJ6uXfny2YbnmE7PGW3qPNgqJmpz782qimZq5C+NBsV5 DDeHv9us2XDBnl5Vy76p4NDHV4zW3ali9zYz2DZpardlTzjVa6IYsD0v4tZNbKiFMlH9mURpnod yv9iM7i3nV3yR3/HBM+5t5J+rb87tFeREuWz8xFL3J+FwauHtztIjp8XJZwWVTazw3Jkrscdfc/ 7bNtHHDuW2yax6qNq9d4qrB9OyFrVLQHa/VF0ynxLHcnjh90TF145TDHmv1hBYy6VuEJ1z59Ppm XNOhP+b1lVeqslr+XrRelvVNOCA41dfWLOP0N37DrZKmAA== 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-sh.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c index c25c51d26f26..0520e762801d 100644 --- a/drivers/usb/host/ehci-sh.c +++ b/drivers/usb/host/ehci-sh.c @@ -147,7 +147,7 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev) return ret; } -static int ehci_hcd_sh_remove(struct platform_device *pdev) +static void ehci_hcd_sh_remove(struct platform_device *pdev) { struct ehci_sh_priv *priv = platform_get_drvdata(pdev); struct usb_hcd *hcd = priv->hcd; @@ -157,8 +157,6 @@ static int ehci_hcd_sh_remove(struct platform_device *pdev) clk_disable(priv->fclk); clk_disable(priv->iclk); - - return 0; } static void ehci_hcd_sh_shutdown(struct platform_device *pdev) @@ -172,7 +170,7 @@ static void ehci_hcd_sh_shutdown(struct platform_device *pdev) static struct platform_driver ehci_hcd_sh_driver = { .probe = ehci_hcd_sh_probe, - .remove = ehci_hcd_sh_remove, + .remove_new = ehci_hcd_sh_remove, .shutdown = ehci_hcd_sh_shutdown, .driver = { .name = "sh_ehci", From patchwork Wed May 17 23:01:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245878 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90504C7EE2A for ; Wed, 17 May 2023 23:03:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbjEQXDU (ORCPT ); Wed, 17 May 2023 19:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbjEQXDE (ORCPT ); Wed, 17 May 2023 19:03:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D52DD6186 for ; Wed, 17 May 2023 16:02:59 -0700 (PDT) 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-0008Fi-3M; 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-000wrp-Ak; 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-005UYr-Bp; Thu, 18 May 2023 01:02:53 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 57/97] usb: ehci-spear: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:01:59 +0200 Message-Id: <20230517230239.187727-58-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=1988; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=DvaOUY6LEbM3ckRvrBaCtnP+gXye2ARKZWgKJ9AvF0c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxtjUUmJleVSnqb5/5Z9n93S/1YdbEMot2CR tTNvWcIVRKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcbQAKCRCPgPtYfRL+ TmreB/9ieAR/eybU0jmmtvsnicVzjTnxVo7RXZ+b647pL+HWg53a3Ocvq/nGZfLn1Ip5AIItnp0 M7ZKUh/n9KtnvmaANaDKRe4OJXvl7bLILj5642VceJ+qj3ptykg7h7DtCRTYB9ombuqjBY41U1B VONESl/yoQWZtFz8y4SVlPYSmAuNY8WcRUTVBhFhCNCwXZA9m18D8x+JH+ZaQNL1FZCAQ2R3BH+ BBbq7j8Qfsi0af71ICXmoHbXL+M74L3eTZT5dBOijflgYJ4VixPoPg/BUgMDptlZTg2wAMUBzy1 /NJzrsQcs1fD2ItJAoyknnUc2mXg2fLQITUi4V9xODRGa8zx 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-spear.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index c4ddd1022f60..1407703649be 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c @@ -124,7 +124,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) return retval ; } -static int spear_ehci_hcd_drv_remove(struct platform_device *pdev) +static void spear_ehci_hcd_drv_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct spear_ehci *sehci = to_spear_ehci(hcd); @@ -134,8 +134,6 @@ static int spear_ehci_hcd_drv_remove(struct platform_device *pdev) if (sehci->clk) clk_disable_unprepare(sehci->clk); usb_put_hcd(hcd); - - return 0; } static const struct of_device_id spear_ehci_id_table[] = { @@ -146,7 +144,7 @@ MODULE_DEVICE_TABLE(of, spear_ehci_id_table); static struct platform_driver spear_ehci_hcd_driver = { .probe = spear_ehci_hcd_drv_probe, - .remove = spear_ehci_hcd_drv_remove, + .remove_new = spear_ehci_hcd_drv_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "spear-ehci", 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: 13245924 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ED2EC7EE2C for ; Wed, 17 May 2023 23:04:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229957AbjEQXEG (ORCPT ); Wed, 17 May 2023 19:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbjEQXEE (ORCPT ); Wed, 17 May 2023 19:04:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79A6761AF for ; Wed, 17 May 2023 16:03:32 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: 13245909 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F33EC7EE23 for ; Wed, 17 May 2023 23:03:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229877AbjEQXDp (ORCPT ); Wed, 17 May 2023 19:03:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbjEQXDW (ORCPT ); Wed, 17 May 2023 19:03:22 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 300106E91 for ; Wed, 17 May 2023 16:03:03 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13245913 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74AADC7EE23 for ; Wed, 17 May 2023 23:03:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229869AbjEQXDs (ORCPT ); Wed, 17 May 2023 19:03:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbjEQXDX (ORCPT ); Wed, 17 May 2023 19:03:23 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 599966E9D for ; Wed, 17 May 2023 16:03:04 -0700 (PDT) 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-0008HJ-Tu; 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 1pzQAZ-000wsA-1o; 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-005UZ3-TO; Thu, 18 May 2023 01:02:53 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Rob Herring , Darren Stevens , Alan Stern , Alexander Stein Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 60/97] usb: fsl-mph-dr-of: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:02 +0200 Message-Id: <20230517230239.187727-61-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=1729; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=01dextRJZ0CAKyffcG5PKCKiPJIVH454WWOQH4hfJE0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxwDO2v3AQuDX+mJQD5X9Rs0+aHZXZCQmvjM kIPR0EnavCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVccAAKCRCPgPtYfRL+ Tof0B/9F7KuOdDF0hnAeEd0FxcHgbY2i2RJ4uHHOduaymegMNmux+oU9kbkboXzcKy5YsP+8ovl 54ipAUUNru87EdNhocGsH7Axw9kLw7xv1jBfxSnG/xfjz6nzskdiI767XA4pPb7imyF1KYzPOPA YaANfcTq0nic6RoPFlfBS6juxNXCG0J9y6VsjqO9LJuN9IEJ0L2x5DqW5245uduoaMXNQLJpQNB uvce/2lqPC9aWiEky1Mw9fAncUmHhXRyFQXBhquVN/dINOy9vZ6h0exmO9A5N6Esd7OOVmwU3Tk mNDmxnOH39sWVZi00Fng8EEr07xg8BNcwABfG0AWf+F4ouzR 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/fsl-mph-dr-of.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 9db909d12354..a9877f2569f4 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -265,10 +265,9 @@ static int __unregister_subdev(struct device *dev, void *d) return 0; } -static int fsl_usb2_mph_dr_of_remove(struct platform_device *ofdev) +static void fsl_usb2_mph_dr_of_remove(struct platform_device *ofdev) { device_for_each_child(&ofdev->dev, NULL, __unregister_subdev); - return 0; } #ifdef CONFIG_PPC_MPC512x @@ -362,7 +361,7 @@ static struct platform_driver fsl_usb2_mph_dr_driver = { .of_match_table = fsl_usb2_mph_dr_of_match, }, .probe = fsl_usb2_mph_dr_of_probe, - .remove = fsl_usb2_mph_dr_of_remove, + .remove_new = fsl_usb2_mph_dr_of_remove, }; module_platform_driver(fsl_usb2_mph_dr_driver); From patchwork Wed May 17 23:02:03 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: 13245885 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08A45C7EE2A for ; Wed, 17 May 2023 23:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbjEQXD0 (ORCPT ); Wed, 17 May 2023 19:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbjEQXDH (ORCPT ); Wed, 17 May 2023 19:03:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C53761AF for ; Wed, 17 May 2023 16:03:01 -0700 (PDT) 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-0008I2-49; 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-000wsG-Cb; 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 1pzQAY-005UZ8-4e; Thu, 18 May 2023 01:02:54 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olav Kongas , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 61/97] usb: isp116x-hcd: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:03 +0200 Message-Id: <20230517230239.187727-62-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=2058; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OnyJtVMfx7k9+s48D/pTsYAcJRBUL0Qv2mqShtgy5Fk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVxxQw0WpMmNWPv+7z+tAcmMnP6jt1Jt/wabn uIKg1tF3DeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVccQAKCRCPgPtYfRL+ Tpz+CACgSVxRH3PozdwbI4j5l79SGMncgHXf6mo3YOD/ty3cbg2d/66lfmyCP0aqmHcoZbxhVXl oZSHaa9O40ktXava3ASHZvILRzxXN15oyq318Lr5CjbdarxzeMNWvsKUi5/eqppv72vERIH28TH tEOlpNNX4qDlyQ86K60HgJFhX0bQZFDoQ4HFttIz88tRHFX2oipkk9h7irXEOt/YL1kRpE1UAkY mZxhdpn+Wh0pJL3WNxokfX0tCbwI78OtDYQ6LHVnSulRYuuYm6X6Xdf+ff4wwBn+pkgRi7GaRYk 2jWl2MNd4zU1hWJPl6FbY0xAmvuNsMJNVCn3SeIkXVCI7W4o 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/isp116x-hcd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 49ae01487af4..a82d8926e922 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c @@ -1526,14 +1526,14 @@ static const struct hc_driver isp116x_hc_driver = { /*----------------------------------------------------------------*/ -static int isp116x_remove(struct platform_device *pdev) +static void isp116x_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct isp116x *isp116x; struct resource *res; if (!hcd) - return 0; + return; isp116x = hcd_to_isp116x(hcd); remove_debug_file(isp116x); usb_remove_hcd(hcd); @@ -1548,7 +1548,6 @@ static int isp116x_remove(struct platform_device *pdev) release_mem_region(res->start, 2); usb_put_hcd(hcd); - return 0; } static int isp116x_probe(struct platform_device *pdev) @@ -1685,7 +1684,7 @@ MODULE_ALIAS("platform:isp116x-hcd"); static struct platform_driver isp116x_driver = { .probe = isp116x_probe, - .remove = isp116x_remove, + .remove_new = isp116x_remove, .suspend = isp116x_suspend, .resume = isp116x_resume, .driver = { From patchwork Wed May 17 23:02: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: 13245887 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAEA2C7EE22 for ; Wed, 17 May 2023 23:03:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229745AbjEQXD2 (ORCPT ); Wed, 17 May 2023 19:03:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbjEQXDI (ORCPT ); Wed, 17 May 2023 19:03:08 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CB1C61B3 for ; Wed, 17 May 2023 16:03:01 -0700 (PDT) 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-0008KH-8m; 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-000wsh-Gq; 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-005UZB-Bn; Thu, 18 May 2023 01:02:54 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 62/97] usb: isp1362-hcd: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:04 +0200 Message-Id: <20230517230239.187727-63-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=1982; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=DQnzFn4rbDba6ZbBXzVbLS4VGIx4iGr7o+VlgE5yQhM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVx3v3EJ0qbvMlgxxGsf+ZdTSD3L2e6R+6Jp0 FrD1kYgZoOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcdwAKCRCPgPtYfRL+ Tt5nCACBYece6YToLt3+115xqPw301OJvtJ8lW1XCUmOOEP+2thRunhSJm2Q1Dab9RAnDI96K6a WALani42suiqdsCLQPAn3lpE1VN5ZatMMa0JiP2PCjdSPeqkHBmsGf01wW0lLq9CdtsZFh/Bc4z o6QBOWg4pLCYS8NpZm0dRemeVGX8SZXjP3xcE2641JX7l9P1JIszPbdksb0t9rbnuz9q4dlwqQC j50eey3yn9KUKmP2KOCLjAVi+v11pTIp0B7gecdM6bleSgfDeTE8QX5D9ImqnJDDj0rwAinoasZ Mp+HGX6/G5lyOiqXs5Dpdz18zL+8VSXfx7BxjiBb+CRbpDqU 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/isp1362-hcd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c index b0da143ef4be..606f0a64f3b7 100644 --- a/drivers/usb/host/isp1362-hcd.c +++ b/drivers/usb/host/isp1362-hcd.c @@ -2606,7 +2606,7 @@ static const struct hc_driver isp1362_hc_driver = { /*-------------------------------------------------------------------------*/ -static int isp1362_remove(struct platform_device *pdev) +static void isp1362_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct isp1362_hcd *isp1362_hcd = hcd_to_isp1362_hcd(hcd); @@ -2617,8 +2617,6 @@ static int isp1362_remove(struct platform_device *pdev) DBG(0, "%s: put_hcd\n", __func__); usb_put_hcd(hcd); DBG(0, "%s: Done\n", __func__); - - return 0; } static int isp1362_probe(struct platform_device *pdev) @@ -2760,7 +2758,7 @@ static int isp1362_resume(struct platform_device *pdev) static struct platform_driver isp1362_driver = { .probe = isp1362_probe, - .remove = isp1362_remove, + .remove_new = isp1362_remove, .suspend = isp1362_suspend, .resume = isp1362_resume, From patchwork Wed May 17 23:02:05 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: 13245886 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB8E9C77B75 for ; Wed, 17 May 2023 23:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbjEQXD2 (ORCPT ); Wed, 17 May 2023 19:03:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbjEQXDI (ORCPT ); Wed, 17 May 2023 19:03:08 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16FC761A9 for ; Wed, 17 May 2023 16:03:01 -0700 (PDT) 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-0008IQ-Hn; 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-000wsP-My; 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 1pzQAY-005UZG-Iq; Thu, 18 May 2023 01:02:54 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Artur Bujdoso Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 63/97] usb: octeon-hcd: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:05 +0200 Message-Id: <20230517230239.187727-64-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=1852; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=us258rPKgcRldb8M3YpSySbmJcLMbXTXMqU6SIkk4/Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVx+MB45OTD5xhRqCAnxTdAUQ7XWpssFvQh1Z sCY4krDUKWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcfgAKCRCPgPtYfRL+ TvX2B/40FKZd/Vz0FH2Lp0Bjp4XXQgwW0eOcmlB4FUnmonZEmvPwkf040m3cFG2Lwa4NpTqGBky otpovUhulUb/kSpdOSkRHwzdiTUPq1/hl7yyUjeRiBzSe/1gHiqi7UCtpfgV9pUtDx6M2m4ATMZ TQSkahNdt2sAyv/76ocqpWcZZMzMEbCA9N25HzseIa3jcN1pZa6Uj9dTvypNpGzORp+Ogdeuq0z TI7Wysgwg2heRADiiu7Ue0M7QnCq5nI84KDASCiV3ZjLCUg4OV72dY+xU8sgq94uLQ/xXslhIIM nlHTHDJXxDwB9tDj/iBvmDKEiv2Zcst+OLumZmH0p/q8b+hB 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/octeon-hcd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/octeon-hcd.c b/drivers/usb/host/octeon-hcd.c index a1cd81d4a114..19d5777f5db2 100644 --- a/drivers/usb/host/octeon-hcd.c +++ b/drivers/usb/host/octeon-hcd.c @@ -3680,7 +3680,7 @@ static int octeon_usb_probe(struct platform_device *pdev) return 0; } -static int octeon_usb_remove(struct platform_device *pdev) +static void octeon_usb_remove(struct platform_device *pdev) { int status; struct device *dev = &pdev->dev; @@ -3696,8 +3696,6 @@ static int octeon_usb_remove(struct platform_device *pdev) dev_dbg(dev, "USB shutdown failed with %d\n", status); usb_put_hcd(hcd); - - return 0; } static const struct of_device_id octeon_usb_match[] = { @@ -3714,7 +3712,7 @@ static struct platform_driver octeon_usb_driver = { .of_match_table = octeon_usb_match, }, .probe = octeon_usb_probe, - .remove = octeon_usb_remove, + .remove_new = octeon_usb_remove, }; static int __init octeon_usb_driver_init(void) 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: 13245923 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2919FC77B75 for ; Wed, 17 May 2023 23:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbjEQXEG (ORCPT ); Wed, 17 May 2023 19:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbjEQXED (ORCPT ); Wed, 17 May 2023 19:04:03 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FD3761A9 for ; Wed, 17 May 2023 16:03:32 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: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: 13245892 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C773EC77B75 for ; Wed, 17 May 2023 23:03:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbjEQXDd (ORCPT ); Wed, 17 May 2023 19:03:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbjEQXDN (ORCPT ); Wed, 17 May 2023 19:03:13 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35430659C for ; Wed, 17 May 2023 16:03:02 -0700 (PDT) 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-0008Jl-Bf; 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-000wsb-BA; 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-005UZP-19; Thu, 18 May 2023 01:02:55 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 65/97] usb: ohci-da8xx: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:07 +0200 Message-Id: <20230517230239.187727-66-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=1772; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ygPDCDguwYgHmgkX/C7YeIfj8XphlIjB72M0L/6PPH0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyFSfCeMB6W1uivxO7U+rAvl781U8C4MU5Hb wxx7VO5Q1qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVchQAKCRCPgPtYfRL+ Tok1B/0TFkEdcg4Ua3drq4Ap4YPvXLUE/I5kFQGihFq1BilVW6XeEQQ6c69RyGzKFkbK1Db+aui dW5uzDtbSbHM2HiFEavGz9r8bKCaBKr7YmGc8NIrGJOhaUfkXZE3l35IE5pNxejMFP1ryolK99o +ud121AT3srWjSd8DhyrdtRakHKbNxKKeQEPgLFzGhVDnfDg2deBlcLQHa5rXTpUskiN6yZK1K/ zsXHql+na1i6gIBvfU13HlsdcdYtN+sPMV5fzKYKoADvt9IGXkOJo+3i53Fxv/stjQNNLrkjfcZ F39pGXrhY/AeshB2Tee9xABiAs1cm9+5gsGMrCoKzGT+9UBr 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-da8xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index d4818e8d652b..e4191a868944 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -469,14 +469,12 @@ static int ohci_da8xx_probe(struct platform_device *pdev) return error; } -static int ohci_da8xx_remove(struct platform_device *pdev) +static void ohci_da8xx_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); usb_remove_hcd(hcd); usb_put_hcd(hcd); - - return 0; } #ifdef CONFIG_PM @@ -533,7 +531,7 @@ static const struct ohci_driver_overrides da8xx_overrides __initconst = { */ static struct platform_driver ohci_hcd_da8xx_driver = { .probe = ohci_da8xx_probe, - .remove = ohci_da8xx_remove, + .remove_new = ohci_da8xx_remove, .shutdown = usb_hcd_platform_shutdown, #ifdef CONFIG_PM .suspend = ohci_da8xx_suspend, 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: 13245922 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EE28C7EE22 for ; Wed, 17 May 2023 23:04:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229955AbjEQXEF (ORCPT ); Wed, 17 May 2023 19:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229951AbjEQXED (ORCPT ); Wed, 17 May 2023 19:04:03 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F15D5588 for ; Wed, 17 May 2023 16:03:31 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: 13245925 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C9B5C7EE23 for ; Wed, 17 May 2023 23:04:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbjEQXEI (ORCPT ); Wed, 17 May 2023 19:04:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbjEQXEE (ORCPT ); Wed, 17 May 2023 19:04:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A8A6526E for ; Wed, 17 May 2023 16:03:33 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:10 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: 13245891 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A600C7EE23 for ; Wed, 17 May 2023 23:03:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbjEQXDc (ORCPT ); Wed, 17 May 2023 19:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbjEQXDM (ORCPT ); Wed, 17 May 2023 19:03:12 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C3BE6596 for ; Wed, 17 May 2023 16:03:02 -0700 (PDT) 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-0008K5-Ib; 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-000wse-E6; 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-005UZb-JE; Thu, 18 May 2023 01:02:55 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 68/97] usb: ohci-omap: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:10 +0200 Message-Id: <20230517230239.187727-69-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=2114; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=036YeX6s4vOUnhzrH7knkszUUtAwrp7J4f82q0cSJ4g=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyNsh+T9FLx5rOt+RMHaVuQD6T7MhFW4ElcQ IjKYbMB11mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcjQAKCRCPgPtYfRL+ Tne4CAC2tHmWfrUSb8YoDi/pPWWNF50EyuYG2dcyg3cL/FYfCvTP93USlPL2jseIw9RLHH9wsol nZ4Z6wO3XV6nRR9MtPTuFCfw+JudtePL9SEOu+QVsfEGJ/gPmVIMplFmyYMJJTtVsPlCIDEDtHY M689U25sTuYG/Svb/0J8lpzKD7kTlybWpVse3+BmH4R7fucLO25K2W7LGEOoL0swXov5ggfZRDV ThFRDeSjD7LxBHTVajt1+Y4xBRDQXZBiL3qhfXyWqsmyCEBQBk6JqJdRzmlRHpcfxwrYQZDVw62 mz4zoeAS2wFqADy8xEQmQevTM+Pw+v9ad6hSuonMFHJPiDDO 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-omap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index c82121602511..21a6f6c55e07 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -321,7 +321,7 @@ static int ohci_hcd_omap_probe(struct platform_device *pdev) * the HCD's stop() method. It is always called from a thread * context, normally "rmmod", "apmd", or something similar. */ -static int ohci_hcd_omap_remove(struct platform_device *pdev) +static void ohci_hcd_omap_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_omap_priv *priv = hcd_to_ohci_omap_priv(hcd); @@ -340,7 +340,6 @@ static int ohci_hcd_omap_remove(struct platform_device *pdev) clk_unprepare(priv->usb_host_ck); clk_put(priv->usb_host_ck); usb_put_hcd(hcd); - return 0; } /*-------------------------------------------------------------------------*/ @@ -391,7 +390,7 @@ static int ohci_omap_resume(struct platform_device *dev) */ static struct platform_driver ohci_hcd_omap_driver = { .probe = ohci_hcd_omap_probe, - .remove = ohci_hcd_omap_remove, + .remove_new = ohci_hcd_omap_remove, .shutdown = usb_hcd_platform_shutdown, #ifdef CONFIG_PM .suspend = ohci_omap_suspend, From patchwork Wed May 17 23:02:11 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: 13245895 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93AF4C7EE2E for ; Wed, 17 May 2023 23:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229910AbjEQXDe (ORCPT ); Wed, 17 May 2023 19:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229827AbjEQXDO (ORCPT ); Wed, 17 May 2023 19:03:14 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D492E6A65 for ; Wed, 17 May 2023 16:03:02 -0700 (PDT) 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-0008M0-Sg; 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 1pzQAb-000wt4-5o; 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 1pzQAZ-005UZe-P7; Thu, 18 May 2023 01:02:55 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 69/97] usb: ohci-platform: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:11 +0200 Message-Id: <20230517230239.187727-70-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=1981; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=pX/UXaYfIQHWF3bIXvmVgpx3UgC+lxsAJKqG0P8ESj0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyTQQFmXVxyWMkTG/OqKr95/tRS+U7bnKCKw xizfppsSQ6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVckwAKCRCPgPtYfRL+ TjPFCACUT5mMl7G3z0J18yeqJFBE7fmCCHa7UZglesGz4hHVwG5N9UhBl/tdRZyJk6FCbpqI0WJ 6PqhRPQYDPYQut4k5xRiRdQBFL7bnQ4XeBMjaT/03FukM97j0vHpt1DEQpIPQb/refxIl0tWC/T gF6WiyLI1OD46hf/E22MTqa4kRfhr8JoZUa9P/zfQGZCWRJJoIfXeGYrQv19GEf41Nli3U6e9pZ NHYZDRGd41kANS5OS+v1Pv0Dr75ANvTOSK/oyY4eKJR14488Oll3QEVwVJXVzG4g5ccoRyYKlbZ HJmE8h6CMHbv0f3bZy0QwPWcES0FPaMRmBW6nBuL+08NmgjL 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/ohci-platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index a84305091c43..03232c5936e8 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -239,7 +239,7 @@ static int ohci_platform_probe(struct platform_device *dev) return err; } -static int ohci_platform_remove(struct platform_device *dev) +static void 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); @@ -264,8 +264,6 @@ static int ohci_platform_remove(struct platform_device *dev) if (pdata == &ohci_platform_defaults) dev->dev.platform_data = NULL; - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -347,7 +345,7 @@ static const struct dev_pm_ops ohci_platform_pm_ops = { static struct platform_driver ohci_platform_driver = { .id_table = ohci_platform_table, .probe = ohci_platform_probe, - .remove = ohci_platform_remove, + .remove_new = ohci_platform_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "ohci-platform", From patchwork Wed May 17 23:02:12 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: 13245894 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08D95C7EE22 for ; Wed, 17 May 2023 23:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229896AbjEQXDe (ORCPT ); Wed, 17 May 2023 19:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbjEQXDO (ORCPT ); Wed, 17 May 2023 19:03:14 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9333265B9 for ; Wed, 17 May 2023 16:03:02 -0700 (PDT) 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-0008Lo-0D; 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-000wt2-3w; 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-005UZi-1M; Thu, 18 May 2023 01:02:56 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 70/97] usb: ohci-ppc-of: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:12 +0200 Message-Id: <20230517230239.187727-71-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=TCEDVRSyKqg49+fXVj1poxXpV+cUt8CDx2s19eEXu0c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyZwZuOlWqUZSoRUYws+MhRsIQW/mTwrzkE0 bUAvzD8XhCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcmQAKCRCPgPtYfRL+ TkVUCAC1rHH9ZeaE7ryTNy7Zw0FmfFgs/T9wO8EgXA+qeaBxMig5DueFZFSIyILW/78G90GeK/H gYwBydPMsLjeA6qHyFZJaJdSFsuOgvtWuq5cAPhb8/EjZ12l272NsmoRWtjQ52VDEdXNDH//KCS 4o0r3mq2b1M174G/aTDX7iY1U4FhNAVtXx48qEdRaH9M8+QJnWk9nNy5+mtwY4mdm4nHo8CpTpR rtyQUuIg+q25S40+MbgpeN9EfBlBRHNs7qu1HdjzZPRzPHjb8Xe+t8Q+Un+i6sPcNTuz7GnsDBv u/L9XODVB0JMBAOJ23S7WbQ6eszntbMYN8FKlssXsrOE+9fJ 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-ppc-of.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c index f2f6c832ec98..35a7ad7e2569 100644 --- a/drivers/usb/host/ohci-ppc-of.c +++ b/drivers/usb/host/ohci-ppc-of.c @@ -176,7 +176,7 @@ static int ohci_hcd_ppc_of_probe(struct platform_device *op) return rv; } -static int ohci_hcd_ppc_of_remove(struct platform_device *op) +static void ohci_hcd_ppc_of_remove(struct platform_device *op) { struct usb_hcd *hcd = platform_get_drvdata(op); @@ -187,8 +187,6 @@ static int ohci_hcd_ppc_of_remove(struct platform_device *op) irq_dispose_mapping(hcd->irq); usb_put_hcd(hcd); - - return 0; } static const struct of_device_id ohci_hcd_ppc_of_match[] = { @@ -224,7 +222,7 @@ MODULE_DEVICE_TABLE(of, ohci_hcd_ppc_of_match); static struct platform_driver ohci_hcd_ppc_of_driver = { .probe = ohci_hcd_ppc_of_probe, - .remove = ohci_hcd_ppc_of_remove, + .remove_new = ohci_hcd_ppc_of_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "ppc-of-ohci", From patchwork Wed May 17 23:02:13 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: 13245893 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43891C7EE2C for ; Wed, 17 May 2023 23:03:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbjEQXDd (ORCPT ); Wed, 17 May 2023 19:03:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229825AbjEQXDN (ORCPT ); Wed, 17 May 2023 19:03:13 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D93365BB for ; Wed, 17 May 2023 16:03:02 -0700 (PDT) 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-0008LY-Oo; 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 1pzQAb-000wsz-1R; 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-005UZl-6f; Thu, 18 May 2023 01:02:56 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 71/97] usb: ohci-pxa27x: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:13 +0200 Message-Id: <20230517230239.187727-72-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=2110; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=gr7bf4lQWTT4VSRt7+gpTFYbT7HeOmglkEH/7USCz4Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVybjualn9D/znkblQVggTq0CZLUA5brAaNej mjrWVHSEe+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcmwAKCRCPgPtYfRL+ Tn+sB/4+sTR0FWLlKMUm3ziqcgFPrHPpGZ0Ukojz/MizkK3CC0T1QIAMU8zjmRlcYLs24aSeVAk vmtSLpPItkXoPerOWUSn7ILFhmw0Q7JlJ1wzaqzXaJDb75z6Pp3sQzZXp3AwnSC7REea+cDZtLz 8l75k4V9ap77YWDpezqV92p2fqlcGXnjMmnKyJU6uCDvygEb2TDmI1h/2L2XceZcUsRvU4UxI/p /xurSztJprVKo8C4Dpsd7ybQaQ5O+nM3+Jl40zZb6UEdcnmIz54BhtmgI8DQ2moMhPwr/GUAV7R eln8h21Md4YzIglFFYudYoK2q9J5srDEua8KCQjDSFE8Pbt1 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-pxa27x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 0bc7e96bcc93..6f571c776d11 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c @@ -506,7 +506,7 @@ static int ohci_hcd_pxa27x_probe(struct platform_device *pdev) * the HCD's stop() method. It is always called from a thread * context, normally "rmmod", "apmd", or something similar. */ -static int ohci_hcd_pxa27x_remove(struct platform_device *pdev) +static void ohci_hcd_pxa27x_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct pxa27x_ohci *pxa_ohci = to_pxa27x_ohci(hcd); @@ -519,7 +519,6 @@ static int ohci_hcd_pxa27x_remove(struct platform_device *pdev) pxa27x_ohci_set_vbus_power(pxa_ohci, i, false); usb_put_hcd(hcd); - return 0; } /*-------------------------------------------------------------------------*/ @@ -577,7 +576,7 @@ static const struct dev_pm_ops ohci_hcd_pxa27x_pm_ops = { static struct platform_driver ohci_hcd_pxa27x_driver = { .probe = ohci_hcd_pxa27x_probe, - .remove = ohci_hcd_pxa27x_remove, + .remove_new = ohci_hcd_pxa27x_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "pxa27x-ohci", 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: 13245927 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6713AC7EE22 for ; Wed, 17 May 2023 23:04:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjEQXEK (ORCPT ); Wed, 17 May 2023 19:04:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbjEQXEF (ORCPT ); Wed, 17 May 2023 19:04:05 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EC615BA5 for ; Wed, 17 May 2023 16:03:35 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:15 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: 13245901 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CF36C7EE22 for ; Wed, 17 May 2023 23:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbjEQXDj (ORCPT ); Wed, 17 May 2023 19:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbjEQXDT (ORCPT ); Wed, 17 May 2023 19:03:19 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 994AA6E87 for ; Wed, 17 May 2023 16:03:03 -0700 (PDT) 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-0008Ny-Va; 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-000wtL-3V; 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-005UZu-I1; Thu, 18 May 2023 01:02:56 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 73/97] usb: ohci-sm501: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:15 +0200 Message-Id: <20230517230239.187727-74-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=2075; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=up1rvxcl2THt3x6C7p0bI43DfWhjvAUHLBt7XLbwvTc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVydBVHXmu1Q/y0OEBvGz5pQmM5EJPiAfeR1/ FeEZ+afja6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcnQAKCRCPgPtYfRL+ TuI+B/98ctrdoPR+hMpNVGs3VRL9BpMm9/iGBCSe84V9USo/oCS9f7iPjPXWP/ZmTLGypF+veWf gpUkFvf7py+SK5bga0UQWlOWdVt0Zu+jEtyMxJhin+d6EwdCp5gXACgj72eGulb3pITvjC3N9Fr 90CYSQH7vANrUrfN8mY5POCC8Ne9bqGYFoJdadSO2qDz4F5Nxfx5iGACX75wWOz1oYFhe8kMaiQ qq/CLeCg3tWYegAcAZxWu8kLa0Ia62Zc0cPDFhCFQ6CjRQA5jI3nxm1RcrBab/MbEJbdZp1/wn1 /WlcPkKEF0zErSnuqtwEyUzNW0jNCDBbAjH2kGGg1Dr1YdHT 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-sm501.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index f5de586454e3..0468eeb4fcfd 100644 --- a/drivers/usb/host/ohci-sm501.c +++ b/drivers/usb/host/ohci-sm501.c @@ -185,7 +185,7 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev) return retval; } -static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev) +static void ohci_hcd_sm501_drv_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct resource *mem; @@ -202,8 +202,6 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev) sm501_modify_reg(pdev->dev.parent, SM501_IRQ_MASK, 0, 1 << 6); sm501_unit_power(pdev->dev.parent, SM501_GATE_USB_HOST, 0); - - return 0; } /*-------------------------------------------------------------------------*/ @@ -255,7 +253,7 @@ static int ohci_sm501_resume(struct platform_device *pdev) */ static struct platform_driver ohci_hcd_sm501_driver = { .probe = ohci_hcd_sm501_drv_probe, - .remove = ohci_hcd_sm501_drv_remove, + .remove_new = ohci_hcd_sm501_drv_remove, .shutdown = usb_hcd_platform_shutdown, .suspend = ohci_sm501_suspend, .resume = ohci_sm501_resume, From patchwork Wed May 17 23:02: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: 13245896 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83C68C77B75 for ; Wed, 17 May 2023 23:03:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229905AbjEQXDf (ORCPT ); Wed, 17 May 2023 19:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229828AbjEQXDO (ORCPT ); Wed, 17 May 2023 19:03:14 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 709306A78 for ; Wed, 17 May 2023 16:03:03 -0700 (PDT) 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-0008N1-DL; 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-000wtE-Ma; 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-005UZy-O7; Thu, 18 May 2023 01:02:56 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alan Stern , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 74/97] usb: ohci-spear: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:16 +0200 Message-Id: <20230517230239.187727-75-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=2005; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6SqCZCQZS2c2IYPV1zkJBguFd8F7bVmtQ8iwH3EbuUU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyjg07HaSLgam1x4CCyft+V5DvR2T1JFv/42 u75lwKQyPOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcowAKCRCPgPtYfRL+ TnzcB/9+Y+uStPhXZzvL0KqnchrAATqXAYsr5Qdzt8bzYhbaQUv2jNi6w1mLi+BM6gvmMgV6j5a rhJfsr2JpxaFyu2HHXviYObsMf6puLRDxe8bhgylOjqc824BsNUnzmEGAnppEMYNTLu0JpHWM7y ON5NCC1+wsRpKrV5zq4RifZdLEj9xgwx1f1H8oddA6rYYLc/9gRKPBPPXd9TXw6PUunpdalf5lx m4kxvVK13IPu/ongWDNazyg7i8EK0fiGxJHcUpIsqTP5JFwLf+BuwnblxrwvRmcPrHGHJopnyRy mBBYJVkZa9zxTUZrlWlkG1OXy/sxvdpfIoWJMc1/SFIuIAEX 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-spear.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 196951a27f3f..f4b2656407dd 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c @@ -98,7 +98,7 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) return retval; } -static int spear_ohci_hcd_drv_remove(struct platform_device *pdev) +static void spear_ohci_hcd_drv_remove(struct platform_device *pdev) { struct usb_hcd *hcd = platform_get_drvdata(pdev); struct spear_ohci *sohci_p = to_spear_ohci(hcd); @@ -108,7 +108,6 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev) clk_disable_unprepare(sohci_p->clk); usb_put_hcd(hcd); - return 0; } #if defined(CONFIG_PM) @@ -159,7 +158,7 @@ MODULE_DEVICE_TABLE(of, spear_ohci_id_table); /* Driver definition to register with the platform bus */ static struct platform_driver spear_ohci_hcd_driver = { .probe = spear_ohci_hcd_drv_probe, - .remove = spear_ohci_hcd_drv_remove, + .remove_new = spear_ohci_hcd_drv_remove, #ifdef CONFIG_PM .suspend = spear_ohci_hcd_drv_suspend, .resume = spear_ohci_hcd_drv_resume, 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: 13245931 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5113C7EE2F for ; Wed, 17 May 2023 23:04:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbjEQXEJ (ORCPT ); Wed, 17 May 2023 19:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbjEQXEF (ORCPT ); Wed, 17 May 2023 19:04:05 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B965A72AA for ; Wed, 17 May 2023 16:03:33 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:18 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: 13245911 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 165DCC7EE22 for ; Wed, 17 May 2023 23:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbjEQXDr (ORCPT ); Wed, 17 May 2023 19:03:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbjEQXDW (ORCPT ); Wed, 17 May 2023 19:03:22 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 035347284 for ; Wed, 17 May 2023 16:03:04 -0700 (PDT) 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-0008PB-Jf; 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-000wti-Ou; 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 1pzQAb-005Ua7-5k; Thu, 18 May 2023 01:02:57 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , "Gustavo A. R. Silva" Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 76/97] usb: oxu210hp-hcd: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:18 +0200 Message-Id: <20230517230239.187727-77-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=1816; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WtBr02uVpsnynmA7DGznlg6jmmC1FMDGRtwJL1hxzmE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyq79ZL9HQCOCzYABpevMxBAN3EPwIWeaxKj lfl/K7QKEGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcqgAKCRCPgPtYfRL+ Tu+JB/9EgVLkrktvLERc7Y7l+/lOORQCvs8Fwvmtx6w6Q+wF+lMRo9LmPJfeEivDS7qLkhksY8q 34oQpuZOH/Yk0PeRPXdmFin9XICJOBksQUHWcZlEvRJgArpFVOOjQj/yixkrekJ9UdalVwe0GU0 rA4X5G2zd3cIMxRu6PL2Yb4AnTGAuX65F9+MY9ZfUXWoRl9I3wcwEHaCmiBBQT5wBgCJ7B6s8ID eOTtWPshWDZVhdm7IvhYYIr4opMUJR+0DXIWjvzzhR7bL+wwZ2B0zU3yUjgbz5HVaQr9jtxQJXC ScLZLxtuCyoOZz46ICKvAt8cziK6zlF53ass858aRdVnPxYI 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/oxu210hp-hcd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index f998d3f1a78a..50c1ccabb0f5 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c @@ -4278,14 +4278,12 @@ static void oxu_remove(struct platform_device *pdev, struct usb_hcd *hcd) usb_put_hcd(hcd); } -static int oxu_drv_remove(struct platform_device *pdev) +static void oxu_drv_remove(struct platform_device *pdev) { struct oxu_info *info = platform_get_drvdata(pdev); oxu_remove(pdev, info->hcd[0]); oxu_remove(pdev, info->hcd[1]); - - return 0; } static void oxu_drv_shutdown(struct platform_device *pdev) @@ -4317,7 +4315,7 @@ static int oxu_drv_resume(struct device *dev) static struct platform_driver oxu_driver = { .probe = oxu_drv_probe, - .remove = oxu_drv_remove, + .remove_new = oxu_drv_remove, .shutdown = oxu_drv_shutdown, .suspend = oxu_drv_suspend, .resume = oxu_drv_resume, From patchwork Wed May 17 23:02: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: 13245897 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76F28C7EE23 for ; Wed, 17 May 2023 23:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229897AbjEQXDg (ORCPT ); Wed, 17 May 2023 19:03:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbjEQXDQ (ORCPT ); Wed, 17 May 2023 19:03:16 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB9236A67 for ; Wed, 17 May 2023 16:03:02 -0700 (PDT) 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-0008Ob-V5; 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 1pzQAc-000wtU-Dr; 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 1pzQAb-005UaC-Bb; Thu, 18 May 2023 01:02:57 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 77/97] usb: r8a66597-hcd: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:19 +0200 Message-Id: <20230517230239.187727-78-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=1947; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WmmbxC2pOqaIXZnzitzClzwAtl2gelBh1b7eRSfQjsk=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUmNVej+fk5XP7f3Rjq9nVUt2jsunHr2DD/4L9vHcYG Xx3vdzVyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBFVrD/dzn9lUXAQTpYnNvG 533P023LdyqI75w7c8vHii9lG6+/TetgLDg0t8grhffswv3sIW/Mb/ukOU417FTM82Va13t2gpb 5fN9oW601H80Et7UUXp0eeNxR63llp/zeWsPou1OkT8VEuNgzCMTFfGiw59jTJ36k1HSKToPHyQ aO5YfcxNP/JvOcn/j6I+dMHoHL/J8eLnpSP8eqPTW5OD7Be19gcPHauFlTr0wvU3SdURtlMDf0s hLrpsibUx2eVyQz+cVxqXJ9XnLk7oU7klkqd/Naqi2fz0j/YPds4eqvP+T36Xv9enIpeo9/gds2 nr13XZ9e3/zJcOUq+/undtcFHa9JtUvWvXons2Cb4qRCAA== 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/r8a66597-hcd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index abb88dd40d4e..9f4bf8c5f8a5 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c @@ -2379,7 +2379,7 @@ static const struct dev_pm_ops r8a66597_dev_pm_ops = { #define R8A66597_DEV_PM_OPS NULL #endif -static int r8a66597_remove(struct platform_device *pdev) +static void r8a66597_remove(struct platform_device *pdev) { struct r8a66597 *r8a66597 = platform_get_drvdata(pdev); struct usb_hcd *hcd = r8a66597_to_hcd(r8a66597); @@ -2390,7 +2390,6 @@ static int r8a66597_remove(struct platform_device *pdev) if (r8a66597->pdata->on_chip) clk_put(r8a66597->clk); usb_put_hcd(hcd); - return 0; } static int r8a66597_probe(struct platform_device *pdev) @@ -2511,7 +2510,7 @@ static int r8a66597_probe(struct platform_device *pdev) static struct platform_driver r8a66597_driver = { .probe = r8a66597_probe, - .remove = r8a66597_remove, + .remove_new = r8a66597_remove, .driver = { .name = hcd_name, .pm = R8A66597_DEV_PM_OPS, From patchwork Wed May 17 23:02:20 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: 13245899 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B30C7EE2A for ; Wed, 17 May 2023 23:03:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229913AbjEQXDh (ORCPT ); Wed, 17 May 2023 19:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbjEQXDQ (ORCPT ); Wed, 17 May 2023 19:03:16 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98F5E6A7D for ; Wed, 17 May 2023 16:03:03 -0700 (PDT) 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-0008Oy-6h; 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-000wtc-Jy; 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 1pzQAb-005UaF-HM; Thu, 18 May 2023 01:02:57 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 78/97] usb: sl811-hcd: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:20 +0200 Message-Id: <20230517230239.187727-79-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=1795; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jVaci8yAuX7gAMmFzYZ3oz25EEEPy3Iq7BAuf/Ya7LQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVyxocboya9WQ2NWAJ0lvB4sP2V9AIL+c5u2W gtDGukQZNWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVcsQAKCRCPgPtYfRL+ TqAvB/9k7+TTe8g6+jn+wCXK5t1wJ4aaFE/NSMhyerdofb+UglML1XuU1qFEURIpnNARL7vbEjb jQMiQ2De//XcKsiClNFzyvBhgZYXp3wI63Ax/Ic81xB4LmhMK2I+41quhieTgXvFMsqiKXjGz0A ZLGzCCeyFarS9dAEBkCV2imm1dAzP5SXRA8sH0a+61opR2sqfp5XGKOlC7TWBAFej7o1U14t/tr 12cyT9Qn8PX3RgXP32baJSHMmfo2Yp0e2jphbxmws5aWx4vVkJV9cHj7QYgd462Y31HqD1JWkpS q1e5pM+FvKjhFR2Z0igNUTlPJdo3Cv3CnG4HoX7DcbFywbib 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/sl811-hcd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index b8b90eec9107..0956495bba57 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -1579,7 +1579,7 @@ static const struct hc_driver sl811h_hc_driver = { /*-------------------------------------------------------------------------*/ -static int +static void sl811h_remove(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); @@ -1599,7 +1599,6 @@ sl811h_remove(struct platform_device *dev) iounmap(sl811->addr_reg); usb_put_hcd(hcd); - return 0; } static int @@ -1783,7 +1782,7 @@ sl811h_resume(struct platform_device *dev) /* this driver is exported so sl811_cs can depend on it */ struct platform_driver sl811h_driver = { .probe = sl811h_probe, - .remove = sl811h_remove, + .remove_new = sl811h_remove, .suspend = sl811h_suspend, .resume = sl811h_resume, From patchwork Wed May 17 23:02:21 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: 13245905 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94552C7EE22 for ; Wed, 17 May 2023 23:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229784AbjEQXDm (ORCPT ); Wed, 17 May 2023 19:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbjEQXDU (ORCPT ); Wed, 17 May 2023 19:03:20 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E24B96E8B for ; Wed, 17 May 2023 16:03:03 -0700 (PDT) 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-0008P8-Cg; 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-000wth-Nb; 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 1pzQAc-005UaJ-1R; 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, kernel@pengutronix.de Subject: [PATCH 79/97] usb: uhci-grlib: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:21 +0200 Message-Id: <20230517230239.187727-80-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=1884; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zFIZ8upc3XCaeowtE0Lngd9b4UTM37aGY8JhPPpoYuo=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUmD09+fcDKkSdLIoaW77LJOnGX9aNMXrZmrh2ryuTg olamnEnozELAyMXg6yYIot945pMqyq5yM61/y7DDGJlApnCwMUpABP5uZSDYXLDbeebmq9tTb7q /2x9fnFa1aSOFxlfWWuqmtVk/25a6L6icrpxKbvC9Tj26+Wfzb+9UOZ8oWT1hDND5uHEHH2+x1c 80rw/M36vMHwT5MssejCx6l328T9/t1ZdDl3IV3SxakLYtTNf+eP/rzzaevmmnJnK48Pe7IXs9g Knu1pUtjir1edw3zDa03j2/V/lf9wP3t630gmb9Cvn0lKhd3vPRu5mYF9a9jR3Xt+PhF3SUulh4 hrPji+ceTNa8qUFQ96jjrzd7wODH3xi0T6sHbRyi1CxpZOIgutbvhjXZQauq9vjec/UhnS4JSX+ KT1ocvKMjvx8Fi2G8jevVv+s3utcsLrdT9836Yf9t6QFAA== 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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-grlib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/uhci-grlib.c b/drivers/usb/host/uhci-grlib.c index 907d5f01edfd..ac3fc5970315 100644 --- a/drivers/usb/host/uhci-grlib.c +++ b/drivers/usb/host/uhci-grlib.c @@ -147,7 +147,7 @@ static int uhci_hcd_grlib_probe(struct platform_device *op) return rv; } -static int uhci_hcd_grlib_remove(struct platform_device *op) +static void uhci_hcd_grlib_remove(struct platform_device *op) { struct usb_hcd *hcd = platform_get_drvdata(op); @@ -157,8 +157,6 @@ static int uhci_hcd_grlib_remove(struct platform_device *op) irq_dispose_mapping(hcd->irq); usb_put_hcd(hcd); - - return 0; } /* Make sure the controller is quiescent and that we're not using it @@ -185,7 +183,7 @@ MODULE_DEVICE_TABLE(of, uhci_hcd_grlib_of_match); static struct platform_driver uhci_grlib_driver = { .probe = uhci_hcd_grlib_probe, - .remove = uhci_hcd_grlib_remove, + .remove_new = uhci_hcd_grlib_remove, .shutdown = uhci_hcd_grlib_shutdown, .driver = { .name = "grlib-uhci", 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: 13245898 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04992C7EE22 for ; Wed, 17 May 2023 23:03:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbjEQXDh (ORCPT ); Wed, 17 May 2023 19:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbjEQXDQ (ORCPT ); Wed, 17 May 2023 19:03:16 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5102B6E9A for ; Wed, 17 May 2023 16:03:04 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: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: 13245906 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81CF1C7EE23 for ; Wed, 17 May 2023 23:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbjEQXDm (ORCPT ); Wed, 17 May 2023 19:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229865AbjEQXDV (ORCPT ); Wed, 17 May 2023 19:03:21 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA34B6EB3 for ; Wed, 17 May 2023 16:03:04 -0700 (PDT) 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-0008Re-Pb; 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-000wty-Bz; 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-005UaS-Dw; Thu, 18 May 2023 01:02:58 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mathias Nyman , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 81/97] usb: xhci-histb: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:23 +0200 Message-Id: <20230517230239.187727-82-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=1910; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=eZyDJVhxkrTcsnnyfDchhvK9mON+Q+WN1AbSH6Ne9+A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzRzHfjo2UFiE9YzfaIlFAKoEsE1Dr/s5alB nDZn5BYpmCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc0QAKCRCPgPtYfRL+ TgZCB/0TK6aj7ABPtAbBwnsi66xfVmlFVmOkV56MTcuqcAPUZrGioR7/pFuBQlamhsE3oX+dY7/ VXKTCp057dF/ctp9EozwQtIDMbc90TKKjQkjTpX1nqq2quuUjkQZPo3zhoHOX4hH52yjxdcqNMI 2d/+IdPsfq5UI+z8XkEDmu1butgPtBtSuimkeyUzkQzHPSPKgQcDCfKowvVN+YUjxVXaY0rar9s x8Lmcx/FG7OoOs7oq/Ef7tQv0Or4bprFdyrGLG0Iy1AyfUnXrZvPNlT5fvsgLgHwXu7C5DU0U96 /FJUPhCiPQ0BSEFq4DWkq9lm66aC6a/OttycTxV0BnJhNNDn 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/xhci-histb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-histb.c b/drivers/usb/host/xhci-histb.c index 08369857686e..9d953c91cb46 100644 --- a/drivers/usb/host/xhci-histb.c +++ b/drivers/usb/host/xhci-histb.c @@ -319,7 +319,7 @@ static int xhci_histb_probe(struct platform_device *pdev) return ret; } -static int xhci_histb_remove(struct platform_device *dev) +static void xhci_histb_remove(struct platform_device *dev) { struct xhci_hcd_histb *histb = platform_get_drvdata(dev); struct usb_hcd *hcd = histb->hcd; @@ -339,8 +339,6 @@ static int xhci_histb_remove(struct platform_device *dev) usb_put_hcd(hcd); pm_runtime_put_sync(&dev->dev); pm_runtime_disable(&dev->dev); - - return 0; } static int __maybe_unused xhci_histb_suspend(struct device *dev) @@ -385,7 +383,7 @@ MODULE_DEVICE_TABLE(of, histb_xhci_of_match); static struct platform_driver histb_xhci_driver = { .probe = xhci_histb_probe, - .remove = xhci_histb_remove, + .remove_new = xhci_histb_remove, .driver = { .name = "xhci-histb", .pm = DEV_PM_OPS, 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: 13245919 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 591ECC7EE2A for ; Wed, 17 May 2023 23:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229936AbjEQXD4 (ORCPT ); Wed, 17 May 2023 19:03:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbjEQXDx (ORCPT ); Wed, 17 May 2023 19:03:53 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AF167281 for ; Wed, 17 May 2023 16:03:25 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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:25 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: 13245907 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5563C7EE22 for ; Wed, 17 May 2023 23:03:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbjEQXDn (ORCPT ); Wed, 17 May 2023 19:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229877AbjEQXDW (ORCPT ); Wed, 17 May 2023 19:03:22 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D73C7287 for ; Wed, 17 May 2023 16:03:04 -0700 (PDT) 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-0008St-UD; 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-000wu2-HB; 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-005Uab-Pf; Thu, 18 May 2023 01:02:58 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mathias Nyman , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 83/97] usb: xhci-plat: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:25 +0200 Message-Id: <20230517230239.187727-84-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=1949; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Vqbc/3PW5qh79IHdJ4H2BfiDs2TNE9zMPHVzTUEbZTI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzeTFRjL68W/Vo7KGLnt0qCo7oQcUMJwNBaR KPIaYURknKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc3gAKCRCPgPtYfRL+ TjUeCAC2FXJxrCmWXoWCsd+VsbEHCYJsF+kZbORIqMeaypiwxUCIZfazYBzs+h+GsGG3yPKn+KC aU6GYYg1j4tjv5RwEQDsoCkukv0TbXMkYvn2O7Mxi/V/0keOK+ma77XCnQIBvdzmm3D+SqoAs0C 0t+tnWbqpHe0ZGo7nO5X1WIHY+eGz45UvhXRauEFFAL4WdQaQSCKlzYGvXMzpO0uM80iZdoG5CU 0fgZfbdNfxgWJlEFjQoUfxE9UiexzqD5Lc3X8PcwgRAfikvhddcrkZ1XrAaFsh9AhTMwa/KPEMv QiXHoS7nKytnQroFYBPaqiNfFGh5kKkyZnxvPqQvhSON3gQx 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/xhci-plat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index b0c8e8efc43b..523e3843db5e 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -399,7 +399,7 @@ static int xhci_generic_plat_probe(struct platform_device *pdev) return xhci_plat_probe(pdev, sysdev, priv_match); } -int xhci_plat_remove(struct platform_device *dev) +void xhci_plat_remove(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); @@ -430,8 +430,6 @@ int xhci_plat_remove(struct platform_device *dev) pm_runtime_disable(&dev->dev); pm_runtime_put_noidle(&dev->dev); pm_runtime_set_suspended(&dev->dev); - - return 0; } EXPORT_SYMBOL_GPL(xhci_plat_remove); @@ -530,7 +528,7 @@ MODULE_DEVICE_TABLE(acpi, usb_xhci_acpi_match); static struct platform_driver usb_generic_xhci_driver = { .probe = xhci_generic_plat_probe, - .remove = xhci_plat_remove, + .remove_new = xhci_plat_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "xhci-hcd", From patchwork Wed May 17 23:02:26 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: 13245920 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B333AC77B75 for ; Wed, 17 May 2023 23:04:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229945AbjEQXEB (ORCPT ); Wed, 17 May 2023 19:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbjEQXD7 (ORCPT ); Wed, 17 May 2023 19:03:59 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD7BE6EB7 for ; Wed, 17 May 2023 16:03:26 -0700 (PDT) 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 1pzQAf-0008Up-FQ; Thu, 18 May 2023 01:03:01 +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-000wuD-Uf; 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 1pzQAd-005Uag-1p; Thu, 18 May 2023 01:02:59 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mathias Nyman , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter Cc: linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 84/97] usb: xhci-tegra: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:26 +0200 Message-Id: <20230517230239.187727-85-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=1988; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=21KhsgD79jCY/jj4wlw9t+6lKXxL2xNLqCJlfvOuhEI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzf3fyOgAHyIiUkoVyf5oQAUoiZxPo7rnZjQ duiQ8Qyy1qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc3wAKCRCPgPtYfRL+ TvqBCACV3RZ7ISD5f1hbO6jT9lClUbaAOrXoY6D4P+jRUeTYSlV1QoLYrXBpMscAbjQ3t3KOUqD 9lWugroRNb4tjehvqlDz7kOysJ5CT0cMQIoUn6TVplsT6oJ1dgCTD3YEHq8Kyb6E3oL/I9OwECa amv23RG0IgMCr5EjFvFNTD6qz+XS/Ql7EWVJ38tKlb4C4J3BdtRyuU5Hl6FWevnhxQ5nmgOZv0j glg9RLKDUZO7e5acAtHLVW6imeDfHHP5szFLE0YMGRfgsLYRPUXkTV+lbndIpMa1050/5zXdajQ JuaIaPLQHyPsEGZNAAiay0ICKkL08JnJ+n04rwSPP+nitugv 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/xhci-tegra.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index c75d93244143..a36df04b9513 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -1909,7 +1909,7 @@ static int tegra_xusb_probe(struct platform_device *pdev) return err; } -static int tegra_xusb_remove(struct platform_device *pdev) +static void tegra_xusb_remove(struct platform_device *pdev) { struct tegra_xusb *tegra = platform_get_drvdata(pdev); struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); @@ -1939,8 +1939,6 @@ static int tegra_xusb_remove(struct platform_device *pdev) tegra_xusb_clk_disable(tegra); regulator_bulk_disable(tegra->soc->num_supplies, tegra->supplies); tegra_xusb_padctl_put(tegra->padctl); - - return 0; } static bool xhci_hub_ports_suspended(struct xhci_hub *hub) @@ -2650,7 +2648,7 @@ MODULE_DEVICE_TABLE(of, tegra_xusb_of_match); static struct platform_driver tegra_xusb_driver = { .probe = tegra_xusb_probe, - .remove = tegra_xusb_remove, + .remove_new = tegra_xusb_remove, .driver = { .name = "tegra-xusb", .pm = &tegra_xusb_pm_ops, From patchwork Wed May 17 23:02: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: 13245900 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70DF2C77B75 for ; Wed, 17 May 2023 23:03:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbjEQXDi (ORCPT ); Wed, 17 May 2023 19:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbjEQXDS (ORCPT ); Wed, 17 May 2023 19:03:18 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95FAA6EA7 for ; Wed, 17 May 2023 16:03:04 -0700 (PDT) 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 1pzQAf-0008UP-Bd; Thu, 18 May 2023 01:03:01 +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-000wuA-Su; 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 1pzQAd-005Uaj-7V; Thu, 18 May 2023 01:02:59 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rui Miguel Silva , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 85/97] usb: isp1760: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:27 +0200 Message-Id: <20230517230239.187727-86-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=1686; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zx5eFNdBEfbBf29p8AiqPnJl9f3cTf3nzxMymr67huQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzgzSLxEDCfQYlRbxlchejtq7kmgElllpkns 2qK1dqvRRCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc4AAKCRCPgPtYfRL+ Ts4dCACopMNTpv61PjuR4HZh6N5BcF+4P5jG0xcCYyGZnU/a6tTLIPVorUeOhV1vrtcKjD8G+zH PFMLXeQGq0lkBkj50ct5yFVE6MXlAlUAqptIBPJ6P8t3S/nUK41aFI96WYZAC9LidPLStcbVJcg 2yjePpt0wvh60c6XpgVb3MDLnQJzVFCOWiSRsInbqEeaXKsvsC63M7QR5EJct8H1/3MSW3shCB1 n+FqI8vebCbTn3CDuPNrb2WZodKvexXCLYJTEtNIkDqudgATvyy0lsNKOLGCr1PiwNK8cgs7laQ lDj0Wf545Ccfv+dvNzzp9gfNi01+axOfvf8nArs+5kJnP+Td 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Rui Miguel Silva --- drivers/usb/isp1760/isp1760-if.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/isp1760/isp1760-if.c b/drivers/usb/isp1760/isp1760-if.c index 65ba5aca2a4f..fe1e3985419a 100644 --- a/drivers/usb/isp1760/isp1760-if.c +++ b/drivers/usb/isp1760/isp1760-if.c @@ -246,11 +246,9 @@ static int isp1760_plat_probe(struct platform_device *pdev) return 0; } -static int isp1760_plat_remove(struct platform_device *pdev) +static void isp1760_plat_remove(struct platform_device *pdev) { isp1760_unregister(&pdev->dev); - - return 0; } #ifdef CONFIG_OF @@ -265,7 +263,7 @@ MODULE_DEVICE_TABLE(of, isp1760_of_match); static struct platform_driver isp1760_plat_driver = { .probe = isp1760_plat_probe, - .remove = isp1760_plat_remove, + .remove_new = isp1760_plat_remove, .driver = { .name = "isp1760", .of_match_table = of_match_ptr(isp1760_of_match), From patchwork Wed May 17 23:02: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: 13245929 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C407FC7EE23 for ; Wed, 17 May 2023 23:04:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbjEQXEM (ORCPT ); Wed, 17 May 2023 19:04:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbjEQXEG (ORCPT ); Wed, 17 May 2023 19:04:06 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E217161B3 for ; Wed, 17 May 2023 16:03:35 -0700 (PDT) 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 1pzQAf-0008VA-Ei; Thu, 18 May 2023 01:03:01 +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 1pzQAe-000wuH-0v; Thu, 18 May 2023 01:03:00 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAd-005Uan-DD; Thu, 18 May 2023 01:02:59 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Souradeep Chowdhury , Greg Kroah-Hartman Cc: Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 86/97] usb: misc: eud: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:28 +0200 Message-Id: <20230517230239.187727-87-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=1778; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=gXC9rVl2pw5bincUuXdnbdAsnFWzlYOy2N7dqZnzTgE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzhF3hCq8feIfX5FFMUuN8atMsYG3uYrfx3k sDaBv3npACJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc4QAKCRCPgPtYfRL+ TnStB/0RZND0Jd3VUbIl3YmyvVztDUCf8V+OdnKr2zs48EPYQFkqb9U1bWwbJ8E0OZ3iU8D9i2l 8Y++ARALP7Z+6BWz9gP2OsrNCMQK/5Q+Aesh0WMECpvI4utwJBLpz8yWurT3KoB0BJC6bUm7J6I 71jvrV6L8uwGnHXxAAhwJYsDzQNk4Pu0ikiKDkuoqPYI21hMw5jRFRaNtzP6ijE+c2QConYDqX3 Ljvx7uY0D+f608C8VvZq9WbzNQvScGLMT5MA/LcMj47fwGYZnFoiYL9q23DV6TucSSiEoThLQej L2142iouqhS68syFIunaRFbdOGJTXN/rHcqO7burR39VXUQ4 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Konrad Dybcio Reviewed-by: Bhupesh Sharma --- drivers/usb/misc/qcom_eud.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index b7f13df00764..0dc414463759 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -217,7 +217,7 @@ static int eud_probe(struct platform_device *pdev) return 0; } -static int eud_remove(struct platform_device *pdev) +static void eud_remove(struct platform_device *pdev) { struct eud_chip *chip = platform_get_drvdata(pdev); @@ -226,8 +226,6 @@ static int eud_remove(struct platform_device *pdev) device_init_wakeup(&pdev->dev, false); disable_irq_wake(chip->irq); - - return 0; } static const struct of_device_id eud_dt_match[] = { @@ -238,7 +236,7 @@ MODULE_DEVICE_TABLE(of, eud_dt_match); static struct platform_driver eud_driver = { .probe = eud_probe, - .remove = eud_remove, + .remove_new = eud_remove, .driver = { .name = "qcom_eud", .dev_groups = eud_groups, From patchwork Wed May 17 23:02:29 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: 13245916 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33207C7EE30 for ; Wed, 17 May 2023 23:03:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229924AbjEQXDv (ORCPT ); Wed, 17 May 2023 19:03:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbjEQXDa (ORCPT ); Wed, 17 May 2023 19:03:30 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58754619A for ; Wed, 17 May 2023 16:03:07 -0700 (PDT) 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 1pzQAf-00005J-Rx; Thu, 18 May 2023 01:03:01 +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 1pzQAe-000wuS-FS; Thu, 18 May 2023 01:03:00 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAd-005Uar-Ku; Thu, 18 May 2023 01:02:59 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Francesco Dolcini , Emanuele Ghidoli , Jean Delvare , Dongliang Mu Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 87/97] usb: misc: usb3503: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:29 +0200 Message-Id: <20230517230239.187727-88-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=1772; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=NgdhQ98xuWMJywVBOLIAjmOKsL9Iy5UsqlOE5dXGH0U=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVznRZtByKr3TabTrhlDTm77yg5ZwAP1WK8VA w7ahAlOO6eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc5wAKCRCPgPtYfRL+ ThmnB/9aZySG1GH580q8ApzyTaGiGKCPvUZOIOstMAsI/TajJsE4ZY392U3eGcm4zkYWaAJdxBo 9OHf1dusAqorOBNhzAbYVvted5AJRpItsYtXgJ5si8KSkV3+KWFRkPKprzgqvjuG03UGq9GhnjY 1/FKrY2WYoFe8ucVg04e2A3D1AqrLZ15z5IKvt24AHiPv4ErHzH2g3MBvAUQY5m3yyTdIX4FXB5 1q+0lbY/hU3DopW/H123a9q9mGh7OjC75MzjGrVSA2UqltT2W8ngR1a4YsmEuAy5O6Vrp0FdJ3/ sUS08+RcZBObbTMhnMIQPKybtN5+3MVSeBglBO4Jg38LUqhW 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/misc/usb3503.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c index c6cfd1edaf76..fa3005934942 100644 --- a/drivers/usb/misc/usb3503.c +++ b/drivers/usb/misc/usb3503.c @@ -335,14 +335,12 @@ static int usb3503_platform_probe(struct platform_device *pdev) return usb3503_probe(hub); } -static int usb3503_platform_remove(struct platform_device *pdev) +static void usb3503_platform_remove(struct platform_device *pdev) { struct usb3503 *hub; hub = platform_get_drvdata(pdev); clk_disable_unprepare(hub->clk); - - return 0; } static int __maybe_unused usb3503_suspend(struct usb3503 *hub) @@ -425,7 +423,7 @@ static struct platform_driver usb3503_platform_driver = { .pm = pm_ptr(&usb3503_platform_pm_ops), }, .probe = usb3503_platform_probe, - .remove = usb3503_platform_remove, + .remove_new = usb3503_platform_remove, }; static int __init usb3503_init(void) From patchwork Wed May 17 23:02:30 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: 13245904 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A98DC77B75 for ; Wed, 17 May 2023 23:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbjEQXDl (ORCPT ); Wed, 17 May 2023 19:03:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbjEQXDT (ORCPT ); Wed, 17 May 2023 19:03:19 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D848F7281 for ; Wed, 17 May 2023 16:03:04 -0700 (PDT) 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 1pzQAf-00005k-Ox; Thu, 18 May 2023 01:03:01 +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 1pzQAe-000wuY-Iz; Thu, 18 May 2023 01:03:00 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAd-005Uaw-Ro; Thu, 18 May 2023 01:02:59 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Krzysztof Kozlowski Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 88/97] usb: renesas_usbhs: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:30 +0200 Message-Id: <20230517230239.187727-89-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=1843; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PE3Y8VeKdt6Y5BRvWuchRxkAbkaOsO8OtYOEhPv3/nM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzt8vvwBhyKvOgc59T3rV+T7ahqC/26xQizy eQ3GTlnfvOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc7QAKCRCPgPtYfRL+ ThMSCACyhp0r3FSO6MLicvwc2MeBj6hClocQgjbpIkdc2ZmrzcYhYaKR3tZWjidH09xbuDgxxYJ Eto3JqjFgpDHz+7UEahvxPzQ/ywP+5HCFKwZIjvNZY/3UnED1hQZwbmcjd3ggHY24loUxFTlA96 T++aTlpzufRb9/GZPoMWJrrJp38WMtvtmTUkoTfNiAX2A/kLhukqQpvkEfhluOP2hl2jiq0foa7 hKTOO1N8AkVmsOUFOkAUmTWThB6D+8JK3uDsY3nldmmpGfGOC+pOsmq3yb47Cyjpq7IJ2PaO3m5 Whsnwncas3KlcFL7PtlGjHAPmi4lE0hJrxfVaP2A/ur86BD9 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/renesas_usbhs/common.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index fa34efabcccf..111b7ee152c4 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -762,7 +762,7 @@ static int usbhs_probe(struct platform_device *pdev) return ret; } -static int usbhs_remove(struct platform_device *pdev) +static void usbhs_remove(struct platform_device *pdev) { struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev); @@ -780,8 +780,6 @@ static int usbhs_remove(struct platform_device *pdev) usbhs_mod_remove(priv); usbhs_fifo_remove(priv); usbhs_pipe_remove(priv); - - return 0; } static __maybe_unused int usbhsc_suspend(struct device *dev) @@ -826,7 +824,7 @@ static struct platform_driver renesas_usbhs_driver = { .of_match_table = usbhs_of_match, }, .probe = usbhs_probe, - .remove = usbhs_remove, + .remove_new = usbhs_remove, }; module_platform_driver(renesas_usbhs_driver); From patchwork Wed May 17 23:02:31 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: 13245910 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09AEDC7EE2E for ; Wed, 17 May 2023 23:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbjEQXDq (ORCPT ); Wed, 17 May 2023 19:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjEQXDW (ORCPT ); Wed, 17 May 2023 19:03:22 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE4054EF3 for ; Wed, 17 May 2023 16:03:04 -0700 (PDT) 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 1pzQAf-00007p-QZ; Thu, 18 May 2023 01:03:01 +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 1pzQAe-000wuf-VC; Thu, 18 May 2023 01:03:00 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAe-005Ub1-4e; Thu, 18 May 2023 01:03:00 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 89/97] usb: roles: intel_xhci: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:31 +0200 Message-Id: <20230517230239.187727-90-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=2011; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=n4nGPWtvqUb1gdJxB+XAECFUCtiRK4+aQDiSJkU1qaE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzu8xta3Vpo1vyB2nknmrbxdy0SElHFvAryK 0M9T4NjyKWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc7gAKCRCPgPtYfRL+ TvLbB/92yuIgV43in4FXkzoQCcJT/MNfFx561VsKf2KaeoQit/LnmtxLgJZwYjsRtotUWjeHbtl rvZ5rj1pG7DMwF4lDOXvmBqa+NUGYE1Ihtqyxna5ioWjZepANU/KvmqDgb6PoZ7vMLrHUq+aMZ2 1mxaHnn+rdwHSBunu7t+kQCsezsaxtcOZrf2RQCtVXjXS61owVskqt5v7UMyLU7SnvYJsi03+I5 Fi8zLuWm3Si/gNm6I6KFRwHnfr+Kqhrt1zCmp6CjyuKxqggznLOtTgjFF7o5q6NSm1IvgnukOod 9KXBlrtZV13dlS6DzTDIypq9NFAb2rTnQDOdOmXkhNCaYwqr 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/roles/intel-xhci-usb-role-switch.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/roles/intel-xhci-usb-role-switch.c b/drivers/usb/roles/intel-xhci-usb-role-switch.c index 5c96e929acea..e5c6c413a075 100644 --- a/drivers/usb/roles/intel-xhci-usb-role-switch.c +++ b/drivers/usb/roles/intel-xhci-usb-role-switch.c @@ -195,7 +195,7 @@ static int intel_xhci_usb_probe(struct platform_device *pdev) return 0; } -static int intel_xhci_usb_remove(struct platform_device *pdev) +static void intel_xhci_usb_remove(struct platform_device *pdev) { struct intel_xhci_usb_data *data = platform_get_drvdata(pdev); @@ -203,8 +203,6 @@ static int intel_xhci_usb_remove(struct platform_device *pdev) usb_role_switch_unregister(data->role_sw); fwnode_handle_put(software_node_fwnode(&intel_xhci_usb_node)); - - return 0; } static const struct platform_device_id intel_xhci_usb_table[] = { @@ -219,7 +217,7 @@ static struct platform_driver intel_xhci_usb_driver = { }, .id_table = intel_xhci_usb_table, .probe = intel_xhci_usb_probe, - .remove = intel_xhci_usb_remove, + .remove_new = intel_xhci_usb_remove, }; module_platform_driver(intel_xhci_usb_driver); From patchwork Wed May 17 23:02:32 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: 13245921 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F7AFC7EE2E for ; Wed, 17 May 2023 23:04:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbjEQXEE (ORCPT ); Wed, 17 May 2023 19:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbjEQXED (ORCPT ); Wed, 17 May 2023 19:04:03 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCA755FD1 for ; Wed, 17 May 2023 16:03:30 -0700 (PDT) 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 1pzQAg-0000AF-Cp; Thu, 18 May 2023 01:03:02 +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 1pzQAf-000wup-FX; Thu, 18 May 2023 01:03:01 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAe-005Ub5-AH; Thu, 18 May 2023 01:03:00 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Heikki Krogerus , Greg Kroah-Hartman , Bjorn Andersson Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 90/97] usb: typec: mux: gpio-sbu: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:32 +0200 Message-Id: <20230517230239.187727-91-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=1936; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qjAzdgMwqEwupxRubXSTpAyidjKfJ+8kW4+IpN4xQt0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzvlZrki88pByhT+NB+qsOry1koP/h1cyjcq qTnquxbT0WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc7wAKCRCPgPtYfRL+ TlsvB/9KpjhgWNmHNL6NRUGdFO6A0vfecADkswWLpwS32QMkXRmoHEqDjhUxtYoJe0D1VgMmoK4 CXvWlwmyKOvmcuKBQMH0674NXOiO0I179JLFG89iWCU3BrAvHbJQgWx9QkqdKxx6/cXYuD/lVfk RpULl+kYXms6ZhVP5LxKfMgH9hi4HHCUCUopdcwruBTvQvjCSAmMuEtxN+g06/d2/vslYboVoWd LUmcB1jPHdUeyvWpx2Vm/XOz6/KUxl0lj6fIMcmuHGntyna+PVDro6X+JxiFAH8jETKSwWrLbUP aSUqmhSlHB7eaw5RgBqnfnR+D0L5KuI4Ct1NqRHGcu4EBhNK 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Heikki Krogerus Reviewed-by: Bjorn Andersson Reviewed-by: Bjorn Andersson --- drivers/usb/typec/mux/gpio-sbu-mux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c index f62516dafe8f..94c5bc0f467d 100644 --- a/drivers/usb/typec/mux/gpio-sbu-mux.c +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c @@ -140,7 +140,7 @@ static int gpio_sbu_mux_probe(struct platform_device *pdev) return 0; } -static int gpio_sbu_mux_remove(struct platform_device *pdev) +static void gpio_sbu_mux_remove(struct platform_device *pdev) { struct gpio_sbu_mux *sbu_mux = platform_get_drvdata(pdev); @@ -148,8 +148,6 @@ static int gpio_sbu_mux_remove(struct platform_device *pdev) typec_mux_unregister(sbu_mux->mux); typec_switch_unregister(sbu_mux->sw); - - return 0; } static const struct of_device_id gpio_sbu_mux_match[] = { @@ -160,7 +158,7 @@ MODULE_DEVICE_TABLE(of, gpio_sbu_mux_match); static struct platform_driver gpio_sbu_mux_driver = { .probe = gpio_sbu_mux_probe, - .remove = gpio_sbu_mux_remove, + .remove_new = gpio_sbu_mux_remove, .driver = { .name = "gpio_sbu_mux", .of_match_table = gpio_sbu_mux_match, From patchwork Wed May 17 23:02:33 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: 13245914 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5635AC7EE2D for ; Wed, 17 May 2023 23:03:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbjEQXDt (ORCPT ); Wed, 17 May 2023 19:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbjEQXDY (ORCPT ); Wed, 17 May 2023 19:03:24 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 320627292 for ; Wed, 17 May 2023 16:03:05 -0700 (PDT) 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 1pzQAg-00009X-Cc; Thu, 18 May 2023 01:03:02 +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 1pzQAf-000wul-Ah; Thu, 18 May 2023 01:03:01 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAe-005Ub8-Fs; Thu, 18 May 2023 01:03:00 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Heikki Krogerus , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 91/97] usb: typec: intel_pmc_mux: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:33 +0200 Message-Id: <20230517230239.187727-92-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=1831; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bG9wBd28wxmLTMkKSTsItzp6QolRIHljhEIInTU+sK4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVzwYs91iWZdJd2wNFkojDi3JYx1q1JnMXne1 jSWIPSi1TeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc8AAKCRCPgPtYfRL+ TqJDB/9PLyY/BEcczFaQlTIjoPGVuTuFIvzy1fRCyz5aexotLPiSAcm/Wo4eyPBK0RvbB8XYrV7 kkhsPFxf91qqJRrJClL8b7SwTNjTV2FwrWgZIhrNGF2ZI9dYlyJGuKbxPWksXtx6aVFZs5asxwK j4OMYXJ2T/z3D8ocXLENwp172BViZbfJT8ayPm/kzOItsEYlel4n3qmDIZIPV2NqFjVCMTZrWHy d+X2N9L3Vee/PXeeZx7truPG5GZcb7cR2MHGsRS3WJAqUylm8vqcJ0c+I2LnpxjGgkN46U/rKUD iiLW37SUAdX9JfBadQz7he3MWfxqZ2hydrXMcpJDXtI5m9v7 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Heikki Krogerus --- drivers/usb/typec/mux/intel_pmc_mux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c index 34e4188a40ff..e049eadb591e 100644 --- a/drivers/usb/typec/mux/intel_pmc_mux.c +++ b/drivers/usb/typec/mux/intel_pmc_mux.c @@ -706,7 +706,7 @@ static int pmc_usb_probe(struct platform_device *pdev) return ret; } -static int pmc_usb_remove(struct platform_device *pdev) +static void pmc_usb_remove(struct platform_device *pdev) { struct pmc_usb *pmc = platform_get_drvdata(pdev); int i; @@ -718,8 +718,6 @@ static int pmc_usb_remove(struct platform_device *pdev) } acpi_dev_put(pmc->iom_adev); - - return 0; } static const struct acpi_device_id pmc_usb_acpi_ids[] = { @@ -734,7 +732,7 @@ static struct platform_driver pmc_usb_driver = { .acpi_match_table = ACPI_PTR(pmc_usb_acpi_ids), }, .probe = pmc_usb_probe, - .remove = pmc_usb_remove, + .remove_new = pmc_usb_remove, }; module_platform_driver(pmc_usb_driver); From patchwork Wed May 17 23:02:34 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: 13245930 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9031C7EE2A for ; Wed, 17 May 2023 23:04:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229988AbjEQXEM (ORCPT ); Wed, 17 May 2023 19:04:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbjEQXEG (ORCPT ); Wed, 17 May 2023 19:04:06 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40FB872B6 for ; Wed, 17 May 2023 16:03:36 -0700 (PDT) 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 1pzQAg-0000Cb-KR; Thu, 18 May 2023 01:03:02 +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 1pzQAf-000wuv-Tq; Thu, 18 May 2023 01:03:01 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAe-005UbC-Oq; Thu, 18 May 2023 01:03:00 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Heikki Krogerus , Greg Kroah-Hartman Cc: Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 92/97] usb: typec: qcom-pmic-typec: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:34 +0200 Message-Id: <20230517230239.187727-93-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=1929; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=e9Uv9LXrIIGsj5N351WmwTwqQfqC/Nbvqs89zTJbUdU=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTUmE8NKp8mp4Xq7nDade9dgUJTePfG6+oXnrO/dJfWr GcS5JLpZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAiu6PY/8peCU0J65u319Q6 wzufO3x+52nFf8G8fy/OnbZOev186TsdsWpSvpd9Mr4HxBks2vPRyLns7YKy1VeFntoob9Td/i1 N9oFTu/jcfvMag5s/ZxXLe9m9WyvLHBy3VYFHeppoZffJc7lcU27k2v2TfbGMIfJx+XTZuQzHDX OFjDZG7zF+7PG42yfUjOVD0xSx2vxJEX89vx1ZxGDX2Hx7f6aih61cZeBL5+iNprdnXr5bHh4ZW ldwMCB71nu32/yiBnIld57vPH5o0mEJqfwpf27Lai20iDbjEjl/W+CejoeKd4THFu4Lyqo3rvBM XaZ0t/9EhnhggcvtOyvqvTfJSt1/c+9OYNVzQYsj4VNcAQ== 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Konrad Dybcio Acked-by: Bryan O'Donoghue Acked-by: Heikki Krogerus --- drivers/usb/typec/qcom-pmic-typec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/qcom-pmic-typec.c b/drivers/usb/typec/qcom-pmic-typec.c index 432ea62f1bab..924af87fb26d 100644 --- a/drivers/usb/typec/qcom-pmic-typec.c +++ b/drivers/usb/typec/qcom-pmic-typec.c @@ -228,7 +228,7 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev) return ret; } -static int qcom_pmic_typec_remove(struct platform_device *pdev) +static void qcom_pmic_typec_remove(struct platform_device *pdev) { struct qcom_pmic_typec *qcom_usb = platform_get_drvdata(pdev); @@ -237,8 +237,6 @@ static int qcom_pmic_typec_remove(struct platform_device *pdev) typec_unregister_port(qcom_usb->port); usb_role_switch_put(qcom_usb->role_sw); - - return 0; } static const struct of_device_id qcom_pmic_typec_table[] = { @@ -253,7 +251,7 @@ static struct platform_driver qcom_pmic_typec = { .of_match_table = qcom_pmic_typec_table, }, .probe = qcom_pmic_typec_probe, - .remove = qcom_pmic_typec_remove, + .remove_new = qcom_pmic_typec_remove, }; module_platform_driver(qcom_pmic_typec); 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: 13245936 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 911E5C7EE23 for ; Wed, 17 May 2023 23:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbjEQXER (ORCPT ); Wed, 17 May 2023 19:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbjEQXEH (ORCPT ); Wed, 17 May 2023 19:04:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3C2761AD for ; Wed, 17 May 2023 16:03:38 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: 13245934 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1776C7EE2A for ; Wed, 17 May 2023 23:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbjEQXEP (ORCPT ); Wed, 17 May 2023 19:04:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbjEQXEH (ORCPT ); Wed, 17 May 2023 19:04:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 303FA61B5 for ; Wed, 17 May 2023 16:03:39 -0700 (PDT) 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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); From patchwork Wed May 17 23:02:37 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: 13245933 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69D19C7EE2D for ; Wed, 17 May 2023 23:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229990AbjEQXEO (ORCPT ); Wed, 17 May 2023 19:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbjEQXEG (ORCPT ); Wed, 17 May 2023 19:04:06 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B3433AB3 for ; Wed, 17 May 2023 16:03:38 -0700 (PDT) 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-0000KK-Or; 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 1pzQAj-000wvE-00; Thu, 18 May 2023 01:03:05 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAi-005UbQ-4Z; Thu, 18 May 2023 01:03:04 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 95/97] usb: typec: wcove: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:37 +0200 Message-Id: <20230517230239.187727-96-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=xfNyIZ49j7sBxqDhXVimkSXV6vubEqwDh0T/tNqP7H8=; b=owEBbAGT/pANAwAKAY+A+1h9Ev5OAcsmYgBkZVz/JP+8NR2JfT15n7w0RnMkv8ov2VL3EC+ty uG0Z8Bi2gSJATIEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVc/wAKCRCPgPtYfRL+ TjqaB/dgiB9Sd9IHfhV9kqmZglDsARJtSXkHriKoBKTo+oymYJ74AKytbPP5ME3/XzNQPg9aisl 0ECraAF1WVhdMqMpbLJVKkO93xCh4KuGT3ubvuqnpQfso/7WdhIaCg6cHv6sVHETO1F70F+3Prl JRMEGAYodLJQW5B3UH8Buq1T4ywwdLnk+DKNdLLiJHs51G/z8D820Bb9QPnwuhH+VLw+99Hg4aU nEocVYYzYiN7UzWRX+VIpmz6QxXEVaH1m8kOUdchHCPb8HY4xvb20lYum6XYEnpNvV0x8+rMXCj litq455W1efms0ayMpSk1l7Rka7DzMDxGtvYNSNeMYbxtH0= 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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/wcove.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/tcpm/wcove.c b/drivers/usb/typec/tcpm/wcove.c index 20917d85d6f4..87d4abde0ea2 100644 --- a/drivers/usb/typec/tcpm/wcove.c +++ b/drivers/usb/typec/tcpm/wcove.c @@ -671,7 +671,7 @@ static int wcove_typec_probe(struct platform_device *pdev) return 0; } -static int wcove_typec_remove(struct platform_device *pdev) +static void wcove_typec_remove(struct platform_device *pdev) { struct wcove_typec *wcove = platform_get_drvdata(pdev); unsigned int val; @@ -684,8 +684,6 @@ static int wcove_typec_remove(struct platform_device *pdev) tcpm_unregister_port(wcove->tcpm); fwnode_remove_software_node(wcove->tcpc.fwnode); - - return 0; } static struct platform_driver wcove_typec_driver = { @@ -693,7 +691,7 @@ static struct platform_driver wcove_typec_driver = { .name = "bxt_wcove_usbc", }, .probe = wcove_typec_probe, - .remove = wcove_typec_remove, + .remove_new = wcove_typec_remove, }; module_platform_driver(wcove_typec_driver); From patchwork Wed May 17 23:02:38 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: 13245935 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 089F9C7EE2C for ; Wed, 17 May 2023 23:04:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229985AbjEQXEP (ORCPT ); Wed, 17 May 2023 19:04:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbjEQXEG (ORCPT ); Wed, 17 May 2023 19:04:06 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91328768C for ; Wed, 17 May 2023 16:03:37 -0700 (PDT) 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-0000L4-TG; 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 1pzQAj-000wvH-8s; Thu, 18 May 2023 01:03:05 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAi-005UbT-A9; Thu, 18 May 2023 01:03:04 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Heikki Krogerus , Greg Kroah-Hartman , Dan Carpenter , Hans de Goede , =?utf-8?q?Samuel_=C4=8Cavoj?= Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 96/97] usb: typec: ucsi: acpi: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:38 +0200 Message-Id: <20230517230239.187727-97-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=1899; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=TxAZQR+6V48OEiodlRUPKA8wNn8lRv8uDH0e5dgPQ8M=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZV0Fg69ufz5KF/pNePgaChnxkM+TxnIyS0MzR 17qTmDpoiyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVdBQAKCRCPgPtYfRL+ TrUeB/9pueVdriQuInGJMvM8ohck32POoFjmzk1VTIqWGQuwIBg19f+WridmwSOL5Z9wZ4xVXbt vY5ngVFf53YVflpHHVKpFpva9pS3DMKr10+utBAw6ZCk62R8RRz2aV4EnubEguUGaP/0ROfFR1t oLzxT5SxxiiCGid3TTLtOdWJyaYCM4PdarKQvpqA/EsjsdrrD3DLtMJ8xqHnUAHAoM/YGk8p1F9 RYLv3l+vgO6O6foUOu9IwGXCXoUnrwM+GshDAtAOhNcjs4NmjHGDPOpg42NkNvLwDzpB19cOJuB qpG2xFrNLMaIFAWp7sQoq6bwVb60eFbLbylgkrsN4Y9q/iV1 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_acpi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c index 217355f1f9b9..6bbf490ac401 100644 --- a/drivers/usb/typec/ucsi/ucsi_acpi.c +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c @@ -212,7 +212,7 @@ static int ucsi_acpi_probe(struct platform_device *pdev) return 0; } -static int ucsi_acpi_remove(struct platform_device *pdev) +static void ucsi_acpi_remove(struct platform_device *pdev) { struct ucsi_acpi *ua = platform_get_drvdata(pdev); @@ -221,8 +221,6 @@ static int ucsi_acpi_remove(struct platform_device *pdev) acpi_remove_notify_handler(ACPI_HANDLE(&pdev->dev), ACPI_DEVICE_NOTIFY, ucsi_acpi_notify); - - return 0; } static int ucsi_acpi_resume(struct device *dev) @@ -247,7 +245,7 @@ static struct platform_driver ucsi_acpi_platform_driver = { .acpi_match_table = ACPI_PTR(ucsi_acpi_match), }, .probe = ucsi_acpi_probe, - .remove = ucsi_acpi_remove, + .remove_new = ucsi_acpi_remove, }; module_platform_driver(ucsi_acpi_platform_driver); From patchwork Wed May 17 23:02: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: 13245932 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB60EC77B75 for ; Wed, 17 May 2023 23:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229987AbjEQXEN (ORCPT ); Wed, 17 May 2023 19:04:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbjEQXEG (ORCPT ); Wed, 17 May 2023 19:04:06 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E6D661B2 for ; Wed, 17 May 2023 16:03:38 -0700 (PDT) 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 1pzQAk-0000Ns-L0; Thu, 18 May 2023 01:03:06 +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 1pzQAj-000wvN-Ta; Thu, 18 May 2023 01:03:05 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pzQAi-005UbW-Ff; Thu, 18 May 2023 01:03:04 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Valentina Manea , Shuah Khan , Greg Kroah-Hartman Cc: Hongren Zheng , linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 97/97] usbip: vhci_hcd: Convert to platform remove callback returning void Date: Thu, 18 May 2023 01:02:39 +0200 Message-Id: <20230517230239.187727-98-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=1812; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0LgWXFceXNFs2eq7jVPvidHwyCZD4crjmLMr3H/BMtY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkZV0HPI0bCahkP3LFOX8d3fyDXrF2G6/cdF/pr 3+WPab/pJeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZGVdBwAKCRCPgPtYfRL+ TlfpB/9oI9Xi+sCVVmeUyY6J7AS6iJaKWITYMBdBakvmNAo4fHxrIVESA59RnnWQSgz9R8Tri64 lcPZqFHjZHlpY1GZR6jp3WTp/omuCp1L3dcCsSCVI+UliH1YVmqDmDLRvzey+VRFrU1VFbFfmgO cTi0noTEentvmA1bUbTgXIO61Vu4+kfbH4zRww/+NLvFlfTwwA204cQej1EtYCFO9TiRSF/7qrl C0fSCCVN6Z/iWMWhlL69AMWnr4qMvSJNBllvU5zsfVa3NScG16J+6LcH6K6ywa0uBvxR/xkrd1F SCt6ii7bxXDmii4iqqqlw7xq+80LkGPXO+SzvJHAJ3ZLkYkW 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-usb@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() 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: Shuah Khan --- drivers/usb/usbip/vhci_hcd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 233265550fc6..37d1fc34e8a5 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1393,7 +1393,7 @@ static int vhci_hcd_probe(struct platform_device *pdev) return ret; } -static int vhci_hcd_remove(struct platform_device *pdev) +static void vhci_hcd_remove(struct platform_device *pdev) { struct vhci *vhci = *((void **)dev_get_platdata(&pdev->dev)); @@ -1410,8 +1410,6 @@ static int vhci_hcd_remove(struct platform_device *pdev) vhci->vhci_hcd_hs = NULL; vhci->vhci_hcd_ss = NULL; - - return 0; } #ifdef CONFIG_PM @@ -1485,7 +1483,7 @@ static int vhci_hcd_resume(struct platform_device *pdev) static struct platform_driver vhci_driver = { .probe = vhci_hcd_probe, - .remove = vhci_hcd_remove, + .remove_new = vhci_hcd_remove, .suspend = vhci_hcd_suspend, .resume = vhci_hcd_resume, .driver = {