From patchwork Sun Mar 19 09:24: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: 665160 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 6DD2CC6FD1F for ; Sun, 19 Mar 2023 09:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229694AbjCSJYm (ORCPT ); Sun, 19 Mar 2023 05:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjCSJYk (ORCPT ); Sun, 19 Mar 2023 05:24:40 -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 4F4CC1630E for ; Sun, 19 Mar 2023 02:24: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 1pdpHF-0003OS-RS; Sun, 19 Mar 2023 10:24:33 +0100 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 1pdpHF-005C7e-6Z; Sun, 19 Mar 2023 10:24:33 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHE-0066P0-Ft; Sun, 19 Mar 2023 10:24:32 +0100 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/11] usb: phy: ab8500: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:18 +0100 Message-Id: <20230319092428.283054-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1815; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SIF2N0pmcxiRbDelgQ2VPpL6bcfW7vXj264alJ7PUTM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtS8bEWdHgT8lqiLY82G5a+iIYksqcz5pHqYU 8wjyuGWGayJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUvAAKCRCPgPtYfRL+ TkGgB/wMBl8fbeAtw1gG/lZd7qKiHCyBlvUnh6oc1zIHWGL422t1UP/2OEemP8xWTwvLfLV3/Tc GUn62ERxA0O2vP4nli4CgVnUJJZJYAgFGXlXZ8ymmKOWaVKT1AN5O/v6vzM+lqb8T3Wweyy9ELB H0zkhOeAyIc5o2ifsMQIeoPomiy3SmJCSKaAvAVKCSi4d+JoD8FKLGGw35tQPQKoqgkUzYaIG2A YgccrKkdu04+zUkEB94cIx66sYaQduTgWSlrluinFkFA/4otxx9tQOtbj8dHADlPgx83U/iznBS diQfOVOTdBrsSzn7wI7zrcawYrbf8VLbaayRtkftrw0JtasF 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 (mostly) ignored 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. 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/phy/phy-ab8500-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 4c52ba96f17e..408f47e39025 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c @@ -965,7 +965,7 @@ static int ab8500_usb_probe(struct platform_device *pdev) return 0; } -static int ab8500_usb_remove(struct platform_device *pdev) +static void ab8500_usb_remove(struct platform_device *pdev) { struct ab8500_usb *ab = platform_get_drvdata(pdev); @@ -977,8 +977,6 @@ static int ab8500_usb_remove(struct platform_device *pdev) ab8500_usb_host_phy_dis(ab); else if (ab->mode == USB_PERIPHERAL) ab8500_usb_peri_phy_dis(ab); - - return 0; } static const struct platform_device_id ab8500_usb_devtype[] = { @@ -989,7 +987,7 @@ MODULE_DEVICE_TABLE(platform, ab8500_usb_devtype); static struct platform_driver ab8500_usb_driver = { .probe = ab8500_usb_probe, - .remove = ab8500_usb_remove, + .remove_new = ab8500_usb_remove, .id_table = ab8500_usb_devtype, .driver = { .name = "abx5x0-usb", From patchwork Sun Mar 19 09:24: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: 665834 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 6984CC7618A for ; Sun, 19 Mar 2023 09:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229472AbjCSJYo (ORCPT ); Sun, 19 Mar 2023 05:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjCSJYk (ORCPT ); Sun, 19 Mar 2023 05:24:40 -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 4EECD15887 for ; Sun, 19 Mar 2023 02:24: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 1pdpHG-0003OT-0c; Sun, 19 Mar 2023 10:24:34 +0100 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 1pdpHF-005C7i-C1; Sun, 19 Mar 2023 10:24:33 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHE-0066P3-M1; Sun, 19 Mar 2023 10:24:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/11] usb: phy: am335x: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:19 +0100 Message-Id: <20230319092428.283054-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1669; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=l1JWSr4Dg3nNw1Z42y7j9KxyX4mmsc1IaXPMdrb2Eng=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtS9X4yD4MrhUknX/ui5l4p5pf2pDV/oG/On4 iqHUwSXMAuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUvQAKCRCPgPtYfRL+ TtrkB/9KDyZ88q69NJvWMMesTRY6C2Nb/U5U18FcJfDJCAFkPwF0nwr3JdKLe9+p225Rc/RnWBo Qbu45JAPvYZI3LJ7d1P2npg07RrjGCg5K51P/jl+DOeYZmXVPj05glRELfS4PHySSFD45uZ7sRC W+w3YG/SnVlow4ir9+cJ0r5O3lU7k5h/vIuKRR+Fw/nckNRlUJWUPhGHtle+sQ5xXA/wQBtvwWN 2J4Z/od5E6e/GeNat7WMB9WWI5Pw4f0hMQvZtZGyBp12OH9LzZI18rbGbEZmEiKAdNBuNXwcUFg XHY6wWfImb0rOdnVZDKKtita254cDz8b50SlzfZ8Ns80mdXb 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 (mostly) ignored 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. 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/phy/phy-am335x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c index 8524475d942d..e39665cf4b4a 100644 --- a/drivers/usb/phy/phy-am335x.c +++ b/drivers/usb/phy/phy-am335x.c @@ -82,12 +82,11 @@ static int am335x_phy_probe(struct platform_device *pdev) return usb_add_phy_dev(&am_phy->usb_phy_gen.phy); } -static int am335x_phy_remove(struct platform_device *pdev) +static void am335x_phy_remove(struct platform_device *pdev) { struct am335x_phy *am_phy = platform_get_drvdata(pdev); usb_remove_phy(&am_phy->usb_phy_gen.phy); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -134,7 +133,7 @@ MODULE_DEVICE_TABLE(of, am335x_phy_ids); static struct platform_driver am335x_phy_driver = { .probe = am335x_phy_probe, - .remove = am335x_phy_remove, + .remove_new = am335x_phy_remove, .driver = { .name = "am335x-phy-driver", .pm = &am335x_pm_ops, From patchwork Sun Mar 19 09:24: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: 665831 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 626C8C6FD1F for ; Sun, 19 Mar 2023 09:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbjCSJYt (ORCPT ); Sun, 19 Mar 2023 05:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbjCSJYl (ORCPT ); Sun, 19 Mar 2023 05:24:41 -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 0CABC18178 for ; Sun, 19 Mar 2023 02:24: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 1pdpHH-0003Oa-FU; Sun, 19 Mar 2023 10:24:35 +0100 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 1pdpHF-005C7n-ON; Sun, 19 Mar 2023 10:24:33 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHE-0066P6-VH; Sun, 19 Mar 2023 10:24:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Ran Wang , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kernel@pengutronix.de Subject: [PATCH 03/11] usb: phy: fsl: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:20 +0100 Message-Id: <20230319092428.283054-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1576; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FznivNj01CkvJ0Tfq79ZXPvIH2iBmPqYvrjxDu3JqL4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtS+Gx9MU/uPvG0E2e38YSGb+CT/REIMrTgOT kVLUaiOS+KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUvgAKCRCPgPtYfRL+ TgLpB/9D68sZE38fxGiX60CbSnNMFrBnHdzgJJ5YMEPSKquUKjOw4adeZvN9qaI4rqkQgbKYGBf xlzMPPD22gaGYsbiEkFOCfeL23CdrGvg2CDvd92s35ciqZFhz9d1o14i/EFW8Q9/AKS2HHXTpRU B3Jhrd16fsFuyc7+xxKhuuekdn4mOSl7mjaEe3kV1If3IpFmNnhCWq46am3ujDKcU3H27dsQ94z wtAOqAfteskKlHiOproDJzC6P6uTX25SSFfTo2LpFZeU+RMLr/nxLmMjgkxvkfzb3Kb2MHrEiBM fsGxFkPJTF00/+/E121qiG55AGfEIbHTc8DsFL3p6NlFc7Em 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 (mostly) ignored 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. 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/phy/phy-fsl-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c index 972704262b02..79617bb0a70e 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c @@ -983,7 +983,7 @@ static int fsl_otg_probe(struct platform_device *pdev) return ret; } -static int fsl_otg_remove(struct platform_device *pdev) +static void fsl_otg_remove(struct platform_device *pdev) { struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); @@ -998,13 +998,11 @@ static int fsl_otg_remove(struct platform_device *pdev) if (pdata->exit) pdata->exit(pdev); - - return 0; } struct platform_driver fsl_otg_driver = { .probe = fsl_otg_probe, - .remove = fsl_otg_remove, + .remove_new = fsl_otg_remove, .driver = { .name = driver_name, .owner = THIS_MODULE, From patchwork Sun Mar 19 09:24: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: 665155 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 A93FFC7618E for ; Sun, 19 Mar 2023 09:24:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbjCSJYx (ORCPT ); Sun, 19 Mar 2023 05:24:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbjCSJYo (ORCPT ); Sun, 19 Mar 2023 05:24:44 -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 8AEC2166D2 for ; Sun, 19 Mar 2023 02:24:42 -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 1pdpHK-0003Ob-8t; Sun, 19 Mar 2023 10:24:38 +0100 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 1pdpHF-005C7o-Ou; Sun, 19 Mar 2023 10:24:33 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHF-0066PA-5Z; Sun, 19 Mar 2023 10:24:33 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Yang Yingliang , Li Jun , Sean Anderson , Sascha Hauer Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/11] usb: phy: generic: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:21 +0100 Message-Id: <20230319092428.283054-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1681; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ydWiiLHjJK9Ik+y7HR48dwJPBFCPagA2sGzhNW7BPq0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtS/kABQDIrOq2bOLlvG5XZTs7h0ddtpOwu8P YYumJywBKCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUvwAKCRCPgPtYfRL+ TihPB/9aDCBEfOjy+SkB2VDP4Ki3GqhtTQipeU72vKbBLmiL7ZBinH6yAfYCDofJQwGbi6Dzvc0 +q/fE9hBfrLlqIb1+jmHaUaXwEnaZO6+f6295C7MIYhDm9qrG5894zZ377S/WoZVTkuy3k1FD23 WpbB2CYHfjV+7bVhMc1xUfXH5rC2fOdI+1F1tzp9Vx+nSN4OrqBZzp9++/1vAgunuKgz/pOomir MRog9OX5AXz8Q1dTi5if+E7n8KOkQVxmmdBVCv9gSC7noPHQwphXVg88eXDGPdtXt01WId6NYXy CE4v02O+5oQE4xZ24yB2UJyMDmSYT3s09+MpmKmuFS/geXAv 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 (mostly) ignored 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. 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/phy/phy-generic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index c1309ea24a52..770081b828a4 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/drivers/usb/phy/phy-generic.c @@ -330,13 +330,11 @@ static int usb_phy_generic_probe(struct platform_device *pdev) return 0; } -static int usb_phy_generic_remove(struct platform_device *pdev) +static void usb_phy_generic_remove(struct platform_device *pdev) { struct usb_phy_generic *nop = platform_get_drvdata(pdev); usb_remove_phy(&nop->phy); - - return 0; } static const struct of_device_id nop_xceiv_dt_ids[] = { @@ -348,7 +346,7 @@ MODULE_DEVICE_TABLE(of, nop_xceiv_dt_ids); static struct platform_driver usb_phy_generic_driver = { .probe = usb_phy_generic_probe, - .remove = usb_phy_generic_remove, + .remove_new = usb_phy_generic_remove, .driver = { .name = "usb_phy_generic", .of_match_table = nop_xceiv_dt_ids, From patchwork Sun Mar 19 09:24: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: 665157 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 D7E64C7619A for ; Sun, 19 Mar 2023 09:24:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbjCSJYs (ORCPT ); Sun, 19 Mar 2023 05:24:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbjCSJYl (ORCPT ); Sun, 19 Mar 2023 05:24:41 -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 0245818174 for ; Sun, 19 Mar 2023 02:24: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 1pdpHH-0003Op-J4; Sun, 19 Mar 2023 10:24:35 +0100 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 1pdpHG-005C81-C6; Sun, 19 Mar 2023 10:24:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHF-0066PE-C2; Sun, 19 Mar 2023 10:24:33 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Linus Walleij Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/11] usb: phy: gpio-vbus: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:22 +0100 Message-Id: <20230319092428.283054-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1733; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qvrRA9u1FB1PRAhAWCHD/P9/clrivgUMclMXJBySd2M=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtTA7H8MqgECmaHJbTEA5uWgdb7wjUXdp3/kS PtqNp0eF0KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUwAAKCRCPgPtYfRL+ TkehCACVNEkHHM63wV5t0pIZxhAcKXNXuzlrHiROYt+BR8E+ogE2mFbBUMK0UYUpzAJqvYhk1xI bLa8Y39X5RLsbfhW+o2Oc+4yAVmC/qLFnwg+7nlJJvfkivjc/3hBC4RyEgIcmJyXP/Ndsw10KHZ 8ekVXUDLoue1NMBglprearuMcG72riXBMLtJr5cuosaIy008Z+YJkQqUaBWjA/Y+ZhnLkRQB6RH NOhcl7fDXr/PqlIWMX2BojinKTBv/lypLFtvC90sojW73+extlJc4/uFYLFO8ST2qwswm4/1tqU Xd58pRIP9b48MP2sV4cZhm9WN+HfSGqIvT81IQLmxu+OSNHW 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 (mostly) ignored 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. 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/phy/phy-gpio-vbus-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c index 12dfeff7de3d..817c242a76ca 100644 --- a/drivers/usb/phy/phy-gpio-vbus-usb.c +++ b/drivers/usb/phy/phy-gpio-vbus-usb.c @@ -325,7 +325,7 @@ static int gpio_vbus_probe(struct platform_device *pdev) return 0; } -static int gpio_vbus_remove(struct platform_device *pdev) +static void gpio_vbus_remove(struct platform_device *pdev) { struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev); @@ -333,8 +333,6 @@ static int gpio_vbus_remove(struct platform_device *pdev) cancel_delayed_work_sync(&gpio_vbus->work); usb_remove_phy(&gpio_vbus->phy); - - return 0; } #ifdef CONFIG_PM @@ -386,7 +384,7 @@ static struct platform_driver gpio_vbus_driver = { .of_match_table = gpio_vbus_of_match, }, .probe = gpio_vbus_probe, - .remove = gpio_vbus_remove, + .remove_new = gpio_vbus_remove, }; module_platform_driver(gpio_vbus_driver); From patchwork Sun Mar 19 09:24: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: 665832 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 A608CC7618A for ; Sun, 19 Mar 2023 09:24:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjCSJYr (ORCPT ); Sun, 19 Mar 2023 05:24:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjCSJYk (ORCPT ); Sun, 19 Mar 2023 05:24:40 -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 53ED217CFD for ; Sun, 19 Mar 2023 02:24: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 1pdpHH-0003Oo-1f; Sun, 19 Mar 2023 10:24:35 +0100 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 1pdpHG-005C7x-6A; Sun, 19 Mar 2023 10:24:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHF-0066PI-Jd; Sun, 19 Mar 2023 10:24:33 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Colin Ian King Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/11] usb: phy: keystone: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:23 +0100 Message-Id: <20230319092428.283054-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1776; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ZHpFdXT1eV+HvtAKyjUeGncmMTPHMww/WftZDERlW9Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtTCYU1Jd5XIG7g4EVipaQ4zfsDKBIxa9okja MPcTckgJoGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUwgAKCRCPgPtYfRL+ Tg4uB/9qnhPSVenLbZqpx4U3tWPbV3bOcI/s3FtXOEBbnYAHdx63NNXjs3+zqA+DXGcTwvLpiYJ GvY9bFf8o2UHbBOdAyPAXJBCdi/gLy8asBJcvyHQJiQi4ppeVwcDMGwp5muEjMvzSNjJR0eJaI+ BRraFd/AIY/HCYApPjiPhL+Q+9hg3E61SBlEnKeF5xYWF/jyduICA/6akIgTXjrqVZIX1G1BZza ea+V54jcxlZYxHnHnamw22ALQ0Rn7byU65ruh3SJT9lMp50/FWTu2UccVp2yDBitayn5HVSGEc3 hHJwFOufN6TCSmFivjXQzgzs4ZaZTIPR7AQ7o/BXE2aAWpvp 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 (mostly) ignored 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. 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/phy/phy-keystone.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-keystone.c b/drivers/usb/phy/phy-keystone.c index f75912279b39..bd9a98ad1b30 100644 --- a/drivers/usb/phy/phy-keystone.c +++ b/drivers/usb/phy/phy-keystone.c @@ -88,13 +88,11 @@ static int keystone_usbphy_probe(struct platform_device *pdev) return usb_add_phy_dev(&k_phy->usb_phy_gen.phy); } -static int keystone_usbphy_remove(struct platform_device *pdev) +static void keystone_usbphy_remove(struct platform_device *pdev) { struct keystone_usbphy *k_phy = platform_get_drvdata(pdev); usb_remove_phy(&k_phy->usb_phy_gen.phy); - - return 0; } static const struct of_device_id keystone_usbphy_ids[] = { @@ -105,7 +103,7 @@ MODULE_DEVICE_TABLE(of, keystone_usbphy_ids); static struct platform_driver keystone_usbphy_driver = { .probe = keystone_usbphy_probe, - .remove = keystone_usbphy_remove, + .remove_new = keystone_usbphy_remove, .driver = { .name = "keystone-usbphy", .of_match_table = keystone_usbphy_ids, From patchwork Sun Mar 19 09:24: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: 665158 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 94282C6FD1F for ; Sun, 19 Mar 2023 09:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbjCSJYn (ORCPT ); Sun, 19 Mar 2023 05:24:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjCSJYk (ORCPT ); Sun, 19 Mar 2023 05:24:40 -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 BCED6166D2 for ; Sun, 19 Mar 2023 02:24: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 1pdpHH-0003Oq-2W; Sun, 19 Mar 2023 10:24:35 +0100 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 1pdpHG-005C83-DP; Sun, 19 Mar 2023 10:24:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHF-0066PL-QR; Sun, 19 Mar 2023 10:24:33 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/11] usb: phy: mv: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:24 +0100 Message-Id: <20230319092428.283054-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1711; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ElIlGN1g/54EG2AJH2PAHYfpjBdFwQ4TsUJFIVPivSE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtTDt0qSjuxkAzaHOqfsavsV3sLzoui6nv3Ky KhNyaHdEqiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUwwAKCRCPgPtYfRL+ TqzHB/93I6HZKPE30jIWZnuRgkSw7Bgr2K5hbB53NRQk6KiRGyHkIsY4YVFQsFJruara0xETqXq lGvBQI0kNOo6pXuCFIim9nxZHafK1/Gm9JwvWT7Mct7ydxv/j8BxUPS3CreCD+lEHCWYJ7NFj8t +4ZSFl8s9tU3g9BdYx24hk1mhfXPlyuDLV7uUREyh4beD5IhM8unPmaNwzd0t/+7hLSB0RN9LL4 SsPTDwTWS0GPpeX857cdbt/onynavJ8QiJNU0NLvvGij+dfr7aXlRn2Wd76qLcUeEGE16WuNUJt +bKcOWJYe/AQ4f4MKSTQhDwtokNeXNNwEEJ/A8Ztab0Zbr23 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 (mostly) ignored 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. 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/phy/phy-mv-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c index 86503b7d695c..df7c27474a75 100644 --- a/drivers/usb/phy/phy-mv-usb.c +++ b/drivers/usb/phy/phy-mv-usb.c @@ -644,7 +644,7 @@ static const struct attribute_group *mv_otg_groups[] = { NULL, }; -static int mv_otg_remove(struct platform_device *pdev) +static void mv_otg_remove(struct platform_device *pdev) { struct mv_otg *mvotg = platform_get_drvdata(pdev); @@ -654,8 +654,6 @@ static int mv_otg_remove(struct platform_device *pdev) mv_otg_disable(mvotg); usb_remove_phy(&mvotg->phy); - - return 0; } static int mv_otg_probe(struct platform_device *pdev) @@ -869,7 +867,7 @@ static int mv_otg_resume(struct platform_device *pdev) static struct platform_driver mv_otg_driver = { .probe = mv_otg_probe, - .remove = mv_otg_remove, + .remove_new = mv_otg_remove, .driver = { .name = driver_name, .dev_groups = mv_otg_groups, From patchwork Sun Mar 19 09:24: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: 665156 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 ABC99C7618A for ; Sun, 19 Mar 2023 09:24:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbjCSJYv (ORCPT ); Sun, 19 Mar 2023 05:24:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbjCSJYn (ORCPT ); Sun, 19 Mar 2023 05:24:43 -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 3A4111630E for ; Sun, 19 Mar 2023 02:24:42 -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 1pdpHJ-0003PP-BY; Sun, 19 Mar 2023 10:24:37 +0100 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 1pdpHG-005C88-Mi; Sun, 19 Mar 2023 10:24:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHG-0066PQ-2M; Sun, 19 Mar 2023 10:24:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Frank Li Cc: Fabio Estevam , NXP Linux Team , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 08/11] usb: phy: mxs: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:25 +0100 Message-Id: <20230319092428.283054-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1628; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FQd/m4OLYSMuLHnbxr6FQyb8hFCGuMIhaYG0O6nsWzM=; b=owGbwMvMwMXY3/A7olbonx/jabUkhhSxK0dYvwT83KFx8fihvHvON//83SH0RLEzw0EzU+Xb8 mXKrMt+djIaszAwcjHIiimy2DeuybSqkovsXPvvMswgViaQKQxcnAIwEa1tHAw7f3wx6l2Vuev1 pzUrt63wWSCvoVcwTWaVpCmr8IJrj7b69V/32N7f0jxldeSuSRJK8u2lnl/uLyydHlpf0cTtci/ 9+ks39hWSCVL/9nnHu9gkduXzNAfGzEqz8b+Q2Fk1Kyktv/64/ayi7Pd1CvzSufLPI8XDWEMFcx JX+d1zsu85G5W57MnMZfzPytPZb/ooh89W+R/26VejJ5e2+b33IXwz7kwxluiZH9DRfuvNRe9bz z64rSyzeK0ke13E7sOhI7KHrJONJI1POuw1j477+ImV4WvJwZtWzT35k2LTXjTb1ei2JpxqcIu+ 3Pq0nOlewuyU04LXG8sLD2g+Yv2xNHyS9bFlLLXydUoPAA== 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 (mostly) ignored 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. 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: Frank Li --- drivers/usb/phy/phy-mxs-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c index d2836ef5d15c..b21eecacc3b7 100644 --- a/drivers/usb/phy/phy-mxs-usb.c +++ b/drivers/usb/phy/phy-mxs-usb.c @@ -801,13 +801,11 @@ static int mxs_phy_probe(struct platform_device *pdev) return usb_add_phy_dev(&mxs_phy->phy); } -static int mxs_phy_remove(struct platform_device *pdev) +static void mxs_phy_remove(struct platform_device *pdev) { struct mxs_phy *mxs_phy = platform_get_drvdata(pdev); usb_remove_phy(&mxs_phy->phy); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -853,7 +851,7 @@ static SIMPLE_DEV_PM_OPS(mxs_phy_pm, mxs_phy_system_suspend, static struct platform_driver mxs_phy_driver = { .probe = mxs_phy_probe, - .remove = mxs_phy_remove, + .remove_new = mxs_phy_remove, .driver = { .name = DRIVER_NAME, .of_match_table = mxs_phy_dt_ids, From patchwork Sun Mar 19 09:24: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: 665833 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 A6BE0C761A6 for ; Sun, 19 Mar 2023 09:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbjCSJYo (ORCPT ); Sun, 19 Mar 2023 05:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbjCSJYk (ORCPT ); Sun, 19 Mar 2023 05:24:40 -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 4C71B17CD5 for ; Sun, 19 Mar 2023 02:24: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 1pdpHH-0003Qd-K3; Sun, 19 Mar 2023 10:24:35 +0100 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 1pdpHG-005C8C-VC; Sun, 19 Mar 2023 10:24:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHG-0066PT-9C; Sun, 19 Mar 2023 10:24:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/11] usb: phy: tahvo: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:26 +0100 Message-Id: <20230319092428.283054-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1614; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PwVttHTKkvQaDC4TxzOACXeyTYsl3btaTzIkidzRG5o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtTFBBqBOA2v86DPb4GsTzpFJgooN7hFcJ5mt DT1T6C1uP+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUxQAKCRCPgPtYfRL+ TkrGB/9LD+ue/9RE+nHE3Ef6wvs3tu1g+lip6TalOCq+ktsGcnUJLGMDKqKTQGPvyjXuwO0v3Lz h/mJ9hO2/Wo9Du0HVT+Ef5F8dETmxxleAQuQXMeMG/PojTRWJGDUM85TCWEWi1mnwwBI1/2HWgc 3FjVGhJpYPfny7VLIQf1q7nNzac+QZ0kLHJhzc95t3heilagpqOPMsiWWAYxxf3p+75Kv4mpTpc kVH54QiSMwHRplEWGAAfTW5jYHobdZm0uYLMvePIFIVrQmcA/gWG7+K35x8uLXfTbgKTzOjmVAr lr+IRYz3+dj4EMknd3eQZOap4kCSfAWKDPjDbl2rlY9vniqQ 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 (mostly) ignored 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. 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/phy/phy-tahvo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c index f2d2cc586c5b..47562d49dfc1 100644 --- a/drivers/usb/phy/phy-tahvo.c +++ b/drivers/usb/phy/phy-tahvo.c @@ -412,7 +412,7 @@ static int tahvo_usb_probe(struct platform_device *pdev) return ret; } -static int tahvo_usb_remove(struct platform_device *pdev) +static void tahvo_usb_remove(struct platform_device *pdev) { struct tahvo_usb *tu = platform_get_drvdata(pdev); @@ -420,13 +420,11 @@ static int tahvo_usb_remove(struct platform_device *pdev) usb_remove_phy(&tu->phy); if (!IS_ERR(tu->ick)) clk_disable(tu->ick); - - return 0; } static struct platform_driver tahvo_usb_driver = { .probe = tahvo_usb_probe, - .remove = tahvo_usb_remove, + .remove_new = tahvo_usb_remove, .driver = { .name = "tahvo-usb", .dev_groups = tahvo_groups, From patchwork Sun Mar 19 09:24: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: 665830 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 91F1BC6FD1F for ; Sun, 19 Mar 2023 09:24:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229738AbjCSJYu (ORCPT ); Sun, 19 Mar 2023 05:24:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjCSJYl (ORCPT ); Sun, 19 Mar 2023 05:24:41 -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 5F04218179 for ; Sun, 19 Mar 2023 02:24: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 1pdpHI-0003Rn-95; Sun, 19 Mar 2023 10:24:36 +0100 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 1pdpHH-005C8I-Dm; Sun, 19 Mar 2023 10:24:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHG-0066PY-Fm; Sun, 19 Mar 2023 10:24:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter , Dmitry Torokhov Cc: linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 10/11] usb: phy: tegra: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:27 +0100 Message-Id: <20230319092428.283054-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1599; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MN1EJiNdXGYOaDxNv5BhfcV4O33BjTjkUCoG2WCtJi0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtTGQQR2LHrdNUbLIP4UWo/CFWV+UwX7hOuYl K8wdYsjweyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUxgAKCRCPgPtYfRL+ TnVoCACGt6AK/01o99qYtQ5TyfW34SQL/dt737UX5Pq0lI/YnDJN/iKI/5RuyY5TK18YrIJysGv cHOjO3mgBRPbyVlNfwh7m4aKlSBwioWWoiD0FbZwDf5Y7BSkyon+lsIFgwKtHVtPJKEZIvQBLBn Gi1r5QcXMPEODZLLO25p3Ziq1Dte8jycMCo9ap7gfV+Tc3u9LO4cqNNt+/jE0f5HuQAGMEPkilc 9lD68r4TtYTo2Bcxkmr5HLFUrplFQBl4oJSeBr/pNf/mmjmimoDZGsi/A3NJy0kQ4w5J+fK7UVf EFZpOq+bfn9/Vgxzu8FNiMhXL8h0ltzAPfIaDJnGhMJPl6iQ 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 (mostly) ignored 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. 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/phy/phy-tegra-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index f0240107edb1..014a96fdbd36 100644 --- a/drivers/usb/phy/phy-tegra-usb.c +++ b/drivers/usb/phy/phy-tegra-usb.c @@ -1486,18 +1486,16 @@ static int tegra_usb_phy_probe(struct platform_device *pdev) return usb_add_phy_dev(&tegra_phy->u_phy); } -static int tegra_usb_phy_remove(struct platform_device *pdev) +static void tegra_usb_phy_remove(struct platform_device *pdev) { struct tegra_usb_phy *tegra_phy = platform_get_drvdata(pdev); usb_remove_phy(&tegra_phy->u_phy); - - return 0; } static struct platform_driver tegra_usb_phy_driver = { .probe = tegra_usb_phy_probe, - .remove = tegra_usb_phy_remove, + .remove_new = tegra_usb_phy_remove, .driver = { .name = "tegra-phy", .of_match_table = tegra_usb_phy_id_table, From patchwork Sun Mar 19 09:24: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: 665159 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 A5165C761AF for ; Sun, 19 Mar 2023 09:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229481AbjCSJYq (ORCPT ); Sun, 19 Mar 2023 05:24:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbjCSJYl (ORCPT ); Sun, 19 Mar 2023 05:24:41 -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 EC7351814A for ; Sun, 19 Mar 2023 02:24: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 1pdpHI-0003Rs-3d; Sun, 19 Mar 2023 10:24:36 +0100 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 1pdpHH-005C8L-GB; Sun, 19 Mar 2023 10:24:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pdpHG-0066Pc-N8; Sun, 19 Mar 2023 10:24:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/11] usb: phy: twl6030: Convert to platform remove callback returning void Date: Sun, 19 Mar 2023 10:24:28 +0100 Message-Id: <20230319092428.283054-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> References: <20230319092428.283054-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1847; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=U9pQGegT+g60+oi7tcjAuIRbzIkvAyBrysvPZGk8zEw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkFtTHo288qorTern4Njm4PO9B3a74+YcwLjT/j 3yn2eKry9OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZBbUxwAKCRCPgPtYfRL+ Tp//CACpk7b1PNIzjtg+kjqZMUovfmAgS3y9gnpW9NxBTe4VQCBk8akwPiO1Y8YwwzqsVdPEu5E G/elnAtjd0LrZQ4B+b7qJC2VycgFu6f7mf3dMQxmaiPKq/qUyOygqe7HD94BAN8LKySI9bVuFBp SuXpzr3fKqAEM3Nd7KShy0n772/du3qWVgjIzZBv8adJqN9JzDq5BuyBV+w1yNR8oKHEdi8vGow 90PoVFipMNBO7ScwwskWhOLiBrrcV5fACV+VSEkRWsl3mKFoDu6nu26gmLuyo8GmHSLx1WID64d nga95oVtRYddBh+eSA4wGBWIEGgQd+5StfaMyb8U53h9HQbb 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 (mostly) ignored 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. 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/phy/phy-twl6030-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-twl6030-usb.c b/drivers/usb/phy/phy-twl6030-usb.c index ab3c38a7d8ac..c3ce6b1054f1 100644 --- a/drivers/usb/phy/phy-twl6030-usb.c +++ b/drivers/usb/phy/phy-twl6030-usb.c @@ -409,7 +409,7 @@ static int twl6030_usb_probe(struct platform_device *pdev) return status; } -static int twl6030_usb_remove(struct platform_device *pdev) +static void twl6030_usb_remove(struct platform_device *pdev) { struct twl6030_usb *twl = platform_get_drvdata(pdev); @@ -422,8 +422,6 @@ static int twl6030_usb_remove(struct platform_device *pdev) free_irq(twl->irq2, twl); regulator_put(twl->usb3v3); cancel_work_sync(&twl->set_vbus_work); - - return 0; } static const struct of_device_id twl6030_usb_id_table[] = { @@ -434,7 +432,7 @@ MODULE_DEVICE_TABLE(of, twl6030_usb_id_table); static struct platform_driver twl6030_usb_driver = { .probe = twl6030_usb_probe, - .remove = twl6030_usb_remove, + .remove_new = twl6030_usb_remove, .driver = { .name = "twl6030_usb", .of_match_table = of_match_ptr(twl6030_usb_id_table),