From patchwork Mon Sep 18 13:36: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: 13390080 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 BEBB3C46CA1 for ; Mon, 18 Sep 2023 16:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230249AbjIRQgZ (ORCPT ); Mon, 18 Sep 2023 12:36:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbjIRQgO (ORCPT ); Mon, 18 Sep 2023 12:36:14 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED17126D00 for ; Mon, 18 Sep 2023 09:15:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER1-0001om-9Z; Mon, 18 Sep 2023 15:37:07 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER0-007EY3-FT; Mon, 18 Sep 2023 15:37:06 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER0-002fVs-6G; Mon, 18 Sep 2023 15:37:06 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Linus Walleij , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 01/32] power: supply: ab8500_btemp: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:29 +0200 Message-Id: <20230918133700.1254499-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1832; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=DuMdnxlT2YsjI546j0PS0ER176m7NpNBOPzP/WV3SNc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJRMoV+2NrmxnsWLNVb6ZTh1ZRzLmxlG7LhU SZUnal0nbCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSUQAKCRCPgPtYfRL+ TgJUB/wP53GGY2BElWx0ZPTGBaqiLBtRsxrOjSDtsfB1Hhi9fUGADdPVbtrQArcGYEJbNr7wTYA MMHhH72wPWSajmdHRwsogMNcMVtJ6YPr3T7UC46tXP+NtAAx4dapLQDuQ5vIaZ8/ZH6DzUXSROK cXGdMykCwq2fb/FSdYRKHiR6xjUB9wcjLTOX6E0PtLjtkxGk8ZWkQINmhd+IvOpv70heDYPAq4u qoGcLXcOqMyj5FPH4vyaPYg7eARWoeOqtChudF4XtpZM6iq7jOFJffoaRnxknUUxFbOkz+hhkXe Ihh/kKrFYw4BRzlMxOpMG+z+n5B8C8gRYXNIcCNkqN8qL7AO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/ab8500_btemp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c index ce36d6ca3422..7905eba93dea 100644 --- a/drivers/power/supply/ab8500_btemp.c +++ b/drivers/power/supply/ab8500_btemp.c @@ -804,11 +804,9 @@ static int ab8500_btemp_probe(struct platform_device *pdev) return component_add(dev, &ab8500_btemp_component_ops); } -static int ab8500_btemp_remove(struct platform_device *pdev) +static void ab8500_btemp_remove(struct platform_device *pdev) { component_del(&pdev->dev, &ab8500_btemp_component_ops); - - return 0; } static SIMPLE_DEV_PM_OPS(ab8500_btemp_pm_ops, ab8500_btemp_suspend, ab8500_btemp_resume); @@ -821,7 +819,7 @@ MODULE_DEVICE_TABLE(of, ab8500_btemp_match); struct platform_driver ab8500_btemp_driver = { .probe = ab8500_btemp_probe, - .remove = ab8500_btemp_remove, + .remove_new = ab8500_btemp_remove, .driver = { .name = "ab8500-btemp", .of_match_table = ab8500_btemp_match, From patchwork Mon Sep 18 13:36: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: 13390013 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 EA100CD13D2 for ; Mon, 18 Sep 2023 16:18:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230154AbjIRQSp (ORCPT ); Mon, 18 Sep 2023 12:18:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbjIRQSc (ORCPT ); Mon, 18 Sep 2023 12:18:32 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 252FB21EA0 for ; Mon, 18 Sep 2023 09:14:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER1-0001on-9c; Mon, 18 Sep 2023 15:37:07 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER0-007EY6-Mv; Mon, 18 Sep 2023 15:37:06 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER0-002fVw-Da; Mon, 18 Sep 2023 15:37:06 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Linus Walleij , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/32] power: supply: ab8500_chargalg: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:30 +0200 Message-Id: <20230918133700.1254499-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1909; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=p2JgJPao1VX1HaXnHaunh6Rgmqpd1W8otqx7WXjs1gk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJSsdD+zNZ0ZBSFyT/S7YhQDOgZFtRmzwSku 1lPA1Il3kiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSUgAKCRCPgPtYfRL+ TgtJCACyR3LF6scCNnj2qvxCmiroaxtsP7173Hbvse9Dzbki4fqO2xXa4h+ebdqFhlUEbVhrG7F wCCHlQlNs8IRILh4KLE1kEZr0kIhYCEKSC+gLCM24B+Ln8S5lF9U4RXVbRP0Ie44jr9EIprTDo4 lBWYQIUUzpsS+LCvo/tu/OJziyGeO1NF1xqiDbz2KY9nlKvtQpkBYyNqXk+tuSHVjyuzWDwA4RH pJp8mgz7GzIM6QZ1XPw6ZCQzNuoY0U5frupQaPx31XDBONBVojW8/1AVpX1wrVx6xVkFWUl74QE oRANT/L/RpMA2FXq3fpPyziLNGd9L/rWs/Y6Cn55+XyhLs0g X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/ab8500_chargalg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/ab8500_chargalg.c b/drivers/power/supply/ab8500_chargalg.c index 2205ea0834a6..de912658facb 100644 --- a/drivers/power/supply/ab8500_chargalg.c +++ b/drivers/power/supply/ab8500_chargalg.c @@ -1824,11 +1824,9 @@ static int ab8500_chargalg_probe(struct platform_device *pdev) return component_add(dev, &ab8500_chargalg_component_ops); } -static int ab8500_chargalg_remove(struct platform_device *pdev) +static void ab8500_chargalg_remove(struct platform_device *pdev) { component_del(&pdev->dev, &ab8500_chargalg_component_ops); - - return 0; } static SIMPLE_DEV_PM_OPS(ab8500_chargalg_pm_ops, ab8500_chargalg_suspend, ab8500_chargalg_resume); @@ -1840,7 +1838,7 @@ static const struct of_device_id ab8500_chargalg_match[] = { struct platform_driver ab8500_chargalg_driver = { .probe = ab8500_chargalg_probe, - .remove = ab8500_chargalg_remove, + .remove_new = ab8500_chargalg_remove, .driver = { .name = "ab8500_chargalg", .of_match_table = ab8500_chargalg_match, From patchwork Mon Sep 18 13:36: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: 13390029 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 6EA2CCD37B0 for ; Mon, 18 Sep 2023 16:20:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbjIRQUm (ORCPT ); Mon, 18 Sep 2023 12:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbjIRQUW (ORCPT ); Mon, 18 Sep 2023 12:20:22 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54E4225206 for ; Mon, 18 Sep 2023 09:15:18 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER1-0001oo-BI; Mon, 18 Sep 2023 15:37:07 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER0-007EY9-Ul; Mon, 18 Sep 2023 15:37:06 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER0-002fW0-La; Mon, 18 Sep 2023 15:37:06 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Linus Walleij , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 03/32] power: supply: ab8500_charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:31 +0200 Message-Id: <20230918133700.1254499-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2051; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7u3UR9ADHU07PXCvgUDHV/7GbKQS0VXsIVWFe3/T+WU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJTVaI4QQiBUTrnTvSWXYH70haZwdxTDFqAW QTBbhzfPFmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSUwAKCRCPgPtYfRL+ TvL7CACiDXvimA4BFKEo7V5XM+AIH10ikAjvF1nSayLf6C2TbQoh7dc7ItXA4URKGjPYm5bxJQX 2/HUGttYZ7ahzl9rH/f8x0HJnyQJhI59eTpYQlrXuWh/rQ0fPUiJoUtP5TvE3N3VJol3u7CSNbY vt8z3WO93VH6Y03NkFb8+4cowk68ToTHLmi/sixuVCq5iX99KYyNdaZfPsfcKUjWs+3nqHCcL7m il6Vzv82om4pFU9mCYor7TgGaxCes82g3KNFZql7GDLa17W4DGBqbUq3Lq6OJgyGZI6+sM5QtVo sxGP3NnKyB78V0VtS4Zy4pJ0rht2Ex/zMOeZkPr8nn5ha8S1 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/ab8500_charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c index 308e68545d44..d72f32c663bc 100644 --- a/drivers/power/supply/ab8500_charger.c +++ b/drivers/power/supply/ab8500_charger.c @@ -3679,7 +3679,7 @@ static int ab8500_charger_probe(struct platform_device *pdev) return ret; } -static int ab8500_charger_remove(struct platform_device *pdev) +static void ab8500_charger_remove(struct platform_device *pdev) { struct ab8500_charger *di = platform_get_drvdata(pdev); @@ -3688,8 +3688,6 @@ static int ab8500_charger_remove(struct platform_device *pdev) usb_unregister_notifier(di->usb_phy, &di->nb); ab8500_bm_of_remove(di->usb_chg.psy, di->bm); usb_put_phy(di->usb_phy); - - return 0; } static SIMPLE_DEV_PM_OPS(ab8500_charger_pm_ops, ab8500_charger_suspend, ab8500_charger_resume); @@ -3702,7 +3700,7 @@ MODULE_DEVICE_TABLE(of, ab8500_charger_match); static struct platform_driver ab8500_charger_driver = { .probe = ab8500_charger_probe, - .remove = ab8500_charger_remove, + .remove_new = ab8500_charger_remove, .driver = { .name = "ab8500-charger", .of_match_table = ab8500_charger_match, From patchwork Mon Sep 18 13:36: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: 13390010 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 BF0F7C46CA1 for ; Mon, 18 Sep 2023 16:18:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbjIRQS1 (ORCPT ); Mon, 18 Sep 2023 12:18:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbjIRQSM (ORCPT ); Mon, 18 Sep 2023 12:18:12 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1956426680 for ; Mon, 18 Sep 2023 09:15:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER1-0001p3-HZ; Mon, 18 Sep 2023 15:37:07 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER1-007EYC-4q; Mon, 18 Sep 2023 15:37:07 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER0-002fW6-Rt; Mon, 18 Sep 2023 15:37:06 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Linus Walleij , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/32] power: supply: ab8500_fg: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:32 +0200 Message-Id: <20230918133700.1254499-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-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=ADtUmThe7B/F65ZTLF4xh3VmKB7oYD/CHASvC6+n88Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJUTJUC+4ZdUHl4I3O5O3nX+SZhnkxScZVkY m94Y2OAtj2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSVAAKCRCPgPtYfRL+ Tu7rCAC29GVvunBFfaHiqiU3Y0ie0vyzL9MF857j5rJoTjIfW8jt6Ie8tJHaUWgWY3i4dfsnuS6 E41JKSreZZXHjIz7wLtmlvYJ/sgyTid8AK6WqrT83agUPWsthVuJTlwo6RA/hQNMf0WICTd+PdH XKcKLV9V49psYMcsAI/R3zUOvk1Iukud5UzRrnJOfZwcz7IyV51KLly2Tff3P6KXCRiWy1a2dir awlqtHbisepLWvjJ4BRnbvc00PZB3kRVsy/eu5lur52i32gk1VVMyPSxceLTBRhTpDPmuVPpCR5 G8yLd2J6Tq3zSdQE+5cUczXQhbLiybhMyYDc8jUE70q1AnIZ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/ab8500_fg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c index 53560fbb6dcd..8c593fbdd45a 100644 --- a/drivers/power/supply/ab8500_fg.c +++ b/drivers/power/supply/ab8500_fg.c @@ -3227,7 +3227,7 @@ static int ab8500_fg_probe(struct platform_device *pdev) return component_add(dev, &ab8500_fg_component_ops); } -static int ab8500_fg_remove(struct platform_device *pdev) +static void ab8500_fg_remove(struct platform_device *pdev) { struct ab8500_fg *di = platform_get_drvdata(pdev); @@ -3236,8 +3236,6 @@ static int ab8500_fg_remove(struct platform_device *pdev) list_del(&di->node); ab8500_fg_sysfs_exit(di); ab8500_fg_sysfs_psy_remove_attrs(di); - - return 0; } static SIMPLE_DEV_PM_OPS(ab8500_fg_pm_ops, ab8500_fg_suspend, ab8500_fg_resume); @@ -3250,7 +3248,7 @@ MODULE_DEVICE_TABLE(of, ab8500_fg_match); struct platform_driver ab8500_fg_driver = { .probe = ab8500_fg_probe, - .remove = ab8500_fg_remove, + .remove_new = ab8500_fg_remove, .driver = { .name = "ab8500-fg", .of_match_table = ab8500_fg_match, From patchwork Mon Sep 18 13:36: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: 13390016 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 BD8A4CD13DA for ; Mon, 18 Sep 2023 16:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbjIRQSv (ORCPT ); Mon, 18 Sep 2023 12:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229983AbjIRQSi (ORCPT ); Mon, 18 Sep 2023 12:18:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C2622828C for ; Mon, 18 Sep 2023 09:15:56 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER1-0001pK-O6; Mon, 18 Sep 2023 15:37:07 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER1-007EYF-BT; Mon, 18 Sep 2023 15:37:07 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER1-002fWA-2F; Mon, 18 Sep 2023 15:37:07 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/32] power: supply: acer_a500_battery: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:33 +0200 Message-Id: <20230918133700.1254499-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1803; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=RVvqO+ymhWgSeh8g6agtGal0Qe2LXfVnXpY96cOmFRI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJVUc6mQe3t+89eg4IqcIjIBtrUxbpMmQ4M2 59hAGAKxMqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSVQAKCRCPgPtYfRL+ Tki6CACt+jpHoZ3YsldR2QCv6sUau6bIX1BpKpysro0cnAEV48PkSjPd3D5CVrHhCtJ2VBp8t0y k+mKibkestjGQQeTMJevfquT6N+HEXgkHONO4aj2rPXUFYv1RvkJIteMv5IbSc0808rO1j597DF j4IEd7N2W5oCRKjH43/BE0WxGSIAZy8G82cc0OE/Wo8Lup/G9nTGNF31NnKkLcq6cTqcm9TCw52 bnqv6mAVsowx9FDKLJmtUHJJBUoXwTsDw+cxXeb0FtyFNYqSvcISmVA85TPb+qrz4TLTEcjAAxc Y7jR2YVMDZ4/32Tk99Qvz0nSsHCpk0HonlPt+8dmnn3YrlR+ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/acer_a500_battery.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/acer_a500_battery.c b/drivers/power/supply/acer_a500_battery.c index 32a0bfcac08f..ef5c419b1b7f 100644 --- a/drivers/power/supply/acer_a500_battery.c +++ b/drivers/power/supply/acer_a500_battery.c @@ -251,13 +251,11 @@ static int a500_battery_probe(struct platform_device *pdev) return 0; } -static int a500_battery_remove(struct platform_device *pdev) +static void a500_battery_remove(struct platform_device *pdev) { struct a500_battery *bat = dev_get_drvdata(&pdev->dev); cancel_delayed_work_sync(&bat->poll_work); - - return 0; } static int __maybe_unused a500_battery_suspend(struct device *dev) @@ -287,7 +285,7 @@ static struct platform_driver a500_battery_driver = { .pm = &a500_battery_pm_ops, }, .probe = a500_battery_probe, - .remove = a500_battery_remove, + .remove_new = a500_battery_remove, }; module_platform_driver(a500_battery_driver); From patchwork Mon Sep 18 13:36: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: 13390028 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 A97B9C46CA1 for ; Mon, 18 Sep 2023 16:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbjIRQUe (ORCPT ); Mon, 18 Sep 2023 12:20:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbjIRQUW (ORCPT ); Mon, 18 Sep 2023 12:20:22 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 558A82446C for ; Mon, 18 Sep 2023 09:15:07 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER1-0001pX-Vc; Mon, 18 Sep 2023 15:37:07 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER1-007EYL-Ix; Mon, 18 Sep 2023 15:37:07 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER1-002fWE-9O; Mon, 18 Sep 2023 15:37:07 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/32] power: supply: act8945a_charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:34 +0200 Message-Id: <20230918133700.1254499-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1850; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PrM3ABfp3OcWBml0epzzHjGdmmv7wwl3Zc85DMdKIpc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJWxtNSwtYwdobrM3XIrpAeDDxEqYexugNfu iGvXzGvxi6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSVgAKCRCPgPtYfRL+ Tl9zB/4/lqL9QMmgjMasb+FpyhfmnwVA0UjmpCuuVfnlLM8/gMiyAsvyXhwuxrrGFDxYfOBqujM OrVUugNwoM7CcUVFrUErZc0RdeNBucej22qbYOXQ/pqghAyKhD1D+Ne57HKSV2pMrHsaAoLckuB ktje5bEkXspNq9bapixcZKvr4VjqKafjVAORef2xuoO8m/FpcC7bxsxdwtYtIVpyNuh1zsxeM3G gL2BNF57igd5N/s6hpC8+dDfQrPeMgD9IiZowHwWshO/Gosy+tnhfL68fLng/mhRGr9uwyl/Mxi VGfLoHMwy9g7ZMoJE3SP7s4OXWJXzryBGlDMyfaypYlvcKVO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/act8945a_charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/act8945a_charger.c b/drivers/power/supply/act8945a_charger.c index e9b5f4283772..51122bfbf196 100644 --- a/drivers/power/supply/act8945a_charger.c +++ b/drivers/power/supply/act8945a_charger.c @@ -638,14 +638,12 @@ static int act8945a_charger_probe(struct platform_device *pdev) return 0; } -static int act8945a_charger_remove(struct platform_device *pdev) +static void act8945a_charger_remove(struct platform_device *pdev) { struct act8945a_charger *charger = platform_get_drvdata(pdev); charger->init_done = false; cancel_work_sync(&charger->work); - - return 0; } static struct platform_driver act8945a_charger_driver = { @@ -653,7 +651,7 @@ static struct platform_driver act8945a_charger_driver = { .name = "act8945a-charger", }, .probe = act8945a_charger_probe, - .remove = act8945a_charger_remove, + .remove_new = act8945a_charger_remove, }; module_platform_driver(act8945a_charger_driver); From patchwork Mon Sep 18 13:36: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: 13390011 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 6E1F5CD13D8 for ; Mon, 18 Sep 2023 16:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230177AbjIRQS1 (ORCPT ); Mon, 18 Sep 2023 12:18:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbjIRQSM (ORCPT ); Mon, 18 Sep 2023 12:18:12 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A41328B54 for ; Mon, 18 Sep 2023 09:16:02 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER2-0001pg-61; Mon, 18 Sep 2023 15:37:08 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER1-007EYP-Pc; Mon, 18 Sep 2023 15:37:07 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER1-002fWI-GV; Mon, 18 Sep 2023 15:37:07 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/32] power: supply: charger-manager: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:35 +0200 Message-Id: <20230918133700.1254499-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1978; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=KqEoNkZswna/cW3TF94N+vJqjiKIadMqGZaYqwX2DNU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJYs34AjvWSLcclIIlLStG9lutR2Ye+gbLDX 81C6n2suq2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSWAAKCRCPgPtYfRL+ Tr/OB/4hsMR4YyZ+2Ke0Gn8P2EOUPY0Z9xKeh/K5JvTGezmngdNISbARnZI+RJa0zfES45kw+ke IcdJe/+rMug70JkpQuttFf73Ocu5Hph7Aq7+V+BX7sB7uh6XwANr6HrnLkIhdjwXkhmisf0eI1u /taaGMZXMbrpcn+m0WOgkiUFXCMjFymkvWjVK7TQYC5GMuwMT0gfkVPOm/3pbxHw8HueVhIo3kj cgfyHBiuhQjRaKbw9H+cLKKbs3uLgMWNApcm02jvDdZYnvUGzJ8XV5COeDxjAx+/9nGLmq2ziqc hMR68sUxyK2gpT6OtN6gO1il2tD8f5DABmNxZ8vWjauU4eKb X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/charger-manager.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c index 5fa6ba7f41e1..3936ff066600 100644 --- a/drivers/power/supply/charger-manager.c +++ b/drivers/power/supply/charger-manager.c @@ -1628,7 +1628,7 @@ static int charger_manager_probe(struct platform_device *pdev) return ret; } -static int charger_manager_remove(struct platform_device *pdev) +static void charger_manager_remove(struct platform_device *pdev) { struct charger_manager *cm = platform_get_drvdata(pdev); struct charger_desc *desc = cm->desc; @@ -1648,8 +1648,6 @@ static int charger_manager_remove(struct platform_device *pdev) power_supply_unregister(cm->charger_psy); try_charger_enable(cm, false); - - return 0; } static const struct platform_device_id charger_manager_id[] = { @@ -1740,7 +1738,7 @@ static struct platform_driver charger_manager_driver = { .of_match_table = charger_manager_match, }, .probe = charger_manager_probe, - .remove = charger_manager_remove, + .remove_new = charger_manager_remove, .id_table = charger_manager_id, }; From patchwork Mon Sep 18 13:36: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: 13390015 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 642ACCD13D9 for ; Mon, 18 Sep 2023 16:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230196AbjIRQSu (ORCPT ); Mon, 18 Sep 2023 12:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230064AbjIRQSi (ORCPT ); Mon, 18 Sep 2023 12:18:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28B38274AB for ; Mon, 18 Sep 2023 09:15:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER2-0001q7-E3; Mon, 18 Sep 2023 15:37:08 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER2-007EYT-1A; Mon, 18 Sep 2023 15:37:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER1-002fWM-NY; Mon, 18 Sep 2023 15:37:07 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/32] power: supply: cpcap-battery: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:36 +0200 Message-Id: <20230918133700.1254499-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-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=W1BPXiZHc1y9UWzOM4V1wlkQL4JKJicHGy1RNjT0lrA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJZJAQpHI3yHQIUs8a6dbf9YlOqnzosFZ1N7 +NceNXnwReJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSWQAKCRCPgPtYfRL+ Tqb8CACVuiy7XcBY7aPhuZmCcK4h5tdDlFr/Kg15fFqy+Bhc41GptCarIWU6Gs/slpKF3lxzo4U TQccGhOLtCaTN/AeArL1Mfyjkxdvg/U2IvKX4MpqqBX7QsvpVVLw8MQbUEjDRC7jWIpNH4yyJe/ v9FwTMcYp1f2eAxlK9MbwPSni5wjz6SP5oS+2Gm9QGhS9mHs0vLQXEfEjbhLWBBsu3gFIK7L/tc Zk8/d8bTNDo3hcqsKprBNAVMU9Na25y8cHPHnF9TAS5ewT9bux/6EDIx2HL24Gq7XvndvusKfXH KFwRBNsODVFMaeVHYgOeNgliLNICKKcGzbAJoRH71RCBfT2E X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/cpcap-battery.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c index 5dd76c0ac98d..30ec76cdf34b 100644 --- a/drivers/power/supply/cpcap-battery.c +++ b/drivers/power/supply/cpcap-battery.c @@ -1151,7 +1151,7 @@ static int cpcap_battery_probe(struct platform_device *pdev) return 0; } -static int cpcap_battery_remove(struct platform_device *pdev) +static void cpcap_battery_remove(struct platform_device *pdev) { struct cpcap_battery_ddata *ddata = platform_get_drvdata(pdev); int error; @@ -1161,8 +1161,6 @@ static int cpcap_battery_remove(struct platform_device *pdev) 0xffff, 0); if (error) dev_err(&pdev->dev, "could not disable: %i\n", error); - - return 0; } static struct platform_driver cpcap_battery_driver = { @@ -1171,7 +1169,7 @@ static struct platform_driver cpcap_battery_driver = { .of_match_table = of_match_ptr(cpcap_battery_id_table), }, .probe = cpcap_battery_probe, - .remove = cpcap_battery_remove, + .remove_new = cpcap_battery_remove, }; module_platform_driver(cpcap_battery_driver); From patchwork Mon Sep 18 13:36: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: 13390008 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 CF7E7CD37B0 for ; Mon, 18 Sep 2023 16:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbjIRQR7 (ORCPT ); Mon, 18 Sep 2023 12:17:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbjIRQRu (ORCPT ); Mon, 18 Sep 2023 12:17:50 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E6647EC7 for ; Mon, 18 Sep 2023 09:12:35 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER2-0001rv-OV; Mon, 18 Sep 2023 15:37:08 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER2-007EYX-7x; Mon, 18 Sep 2023 15:37:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER1-002fWQ-Uz; Mon, 18 Sep 2023 15:37:07 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/32] power: supply: cpcap-charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:37 +0200 Message-Id: <20230918133700.1254499-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-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=kWIuKkcEOY/YuvtSZPWzQr8KtYlwW0QvkJgYDYl6Kqc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJaQWpmWbSVxRlKqzPjI9Ff76c8yLetU6T7h H1XLymr0cWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSWgAKCRCPgPtYfRL+ TuZKCAClm9WnRs1+dbGtK7OxoPg/A8GA2N3C6LIhF9m04Kdex3E+3pi/4Fad4E9fajd15Co7jmI Zy2NoHrStgcwR0DtO8ZHn2JUr3PINziOGeTXQDgbvn2NmGhTqajT8VIlg1Csr/WxHK/2IAZXNqC aV4zHT21mUjPkZrADTxw6gK5aLuPrh7bkEl7Da5SQDtsoV/f2DAuWl9wB5SgkBn0UIF+PtXc2KM 2Z+gF/ZfZGccej/eJPJNKkxLsKpNrzy0t7v4GORdCxiI7LL5s/NI4/xzt6buZJNnJsUFz7SDsxI HnUmtxx5Q7xyXM8plityb9B3UFe8LPHERGX04Q56wKUaovpS X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/cpcap-charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c index be9764541d52..431e951cccf0 100644 --- a/drivers/power/supply/cpcap-charger.c +++ b/drivers/power/supply/cpcap-charger.c @@ -966,11 +966,9 @@ static void cpcap_charger_shutdown(struct platform_device *pdev) cancel_delayed_work_sync(&ddata->detect_work); } -static int cpcap_charger_remove(struct platform_device *pdev) +static void cpcap_charger_remove(struct platform_device *pdev) { cpcap_charger_shutdown(pdev); - - return 0; } static struct platform_driver cpcap_charger_driver = { @@ -980,7 +978,7 @@ static struct platform_driver cpcap_charger_driver = { .of_match_table = of_match_ptr(cpcap_charger_id_table), }, .shutdown = cpcap_charger_shutdown, - .remove = cpcap_charger_remove, + .remove_new = cpcap_charger_remove, }; module_platform_driver(cpcap_charger_driver); From patchwork Mon Sep 18 13:36: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: 13390031 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 87E73CD13D2 for ; Mon, 18 Sep 2023 16:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbjIRQVS (ORCPT ); Mon, 18 Sep 2023 12:21:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbjIRQVQ (ORCPT ); Mon, 18 Sep 2023 12:21:16 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B762227BA0 for ; Mon, 18 Sep 2023 09:15:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER2-0001tv-UZ; Mon, 18 Sep 2023 15:37:08 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER2-007EYb-Es; Mon, 18 Sep 2023 15:37:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER2-002fWU-5a; Mon, 18 Sep 2023 15:37:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 10/32] power: supply: da9030_battery: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:38 +0200 Message-Id: <20230918133700.1254499-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-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=hwZNMSZkop1+SgTyObRP+0cK97gOyPx2nA78664gY1c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJbBW/bPf61DKhYyi9P/VW0uT77iVM88BSnb nVXEpJNcySJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSWwAKCRCPgPtYfRL+ Ts+mCACYrb2MHAMl3sR2nh40u5ZCMapYsWhl+093BLHkR1w5jllHkXK2TZgMqBc3wEFqY6ZbaId i2qA21UpCojw4DuJLsZPyYDTgjCaqS04d9CuDuPMs5G4XTJaQQfLMrYkH7W56b3bHlkc39TLWk7 TrVMj+9IJGfYwCq5mMIm/sC8a9CeJbY+Cln87mNlRyBvdNheMChj/kKYoGrkeWmlzz6juTU2H4a DVc9GbdiqeTujWjSi85LEc6MF5GMGhcBfsI/wmN55W603QqZLJhgiaa+rbelYiahs+7duESjpzG sjhgxnhMrhUqinAIy7KYtnX/3gpL0u967sTU07Wns63uJiGE X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/da9030_battery.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/da9030_battery.c b/drivers/power/supply/da9030_battery.c index 0deba48d22d3..581cf956d2d2 100644 --- a/drivers/power/supply/da9030_battery.c +++ b/drivers/power/supply/da9030_battery.c @@ -552,7 +552,7 @@ static int da9030_battery_probe(struct platform_device *pdev) return ret; } -static int da9030_battery_remove(struct platform_device *dev) +static void da9030_battery_remove(struct platform_device *dev) { struct da9030_charger *charger = platform_get_drvdata(dev); @@ -564,8 +564,6 @@ static int da9030_battery_remove(struct platform_device *dev) cancel_delayed_work_sync(&charger->work); da9030_set_charge(charger, 0); power_supply_unregister(charger->psy); - - return 0; } static struct platform_driver da903x_battery_driver = { @@ -573,7 +571,7 @@ static struct platform_driver da903x_battery_driver = { .name = "da903x-battery", }, .probe = da9030_battery_probe, - .remove = da9030_battery_remove, + .remove_new = da9030_battery_remove, }; module_platform_driver(da903x_battery_driver); From patchwork Mon Sep 18 13:36: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: 13390079 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 09631CD37B0 for ; Mon, 18 Sep 2023 16:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229698AbjIRQgY (ORCPT ); Mon, 18 Sep 2023 12:36:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbjIRQgO (ORCPT ); Mon, 18 Sep 2023 12:36:14 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE1F226D01 for ; Mon, 18 Sep 2023 09:15:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER3-0001vJ-C6; Mon, 18 Sep 2023 15:37:09 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER2-007EYf-LJ; Mon, 18 Sep 2023 15:37:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER2-002fWY-CB; Mon, 18 Sep 2023 15:37:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Support Opensource , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/32] power: supply: da9052-battery: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:39 +0200 Message-Id: <20230918133700.1254499-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1788; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4lxqRDdb3quCiuhhOyQrGTC7aVig9wuBPxjLCQR+PZE=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSOoJhbl7sOiFw9FFm6fZrJ+xUfppxMSTljFZDe9zTq9 EPtTVPFOxmNWRgYuRhkxRRZ7BvXZFpVyUV2rv13GWYQKxPIFAYuTgGYyFR29n92Wvvt395W+9bm ommUl/L3Rn7h5tQZEdbyRkWbPTkFJzS0/OWOu8b2onJltyEPM0+M5tKelhIens7cZZz7phWXLvm gsCcyN1YgVUjzDd/WzAe68/hyb6mlFb8oaH/AEVP2MO2Q6Mnmmdkb+hkU5jrMUnpbvTaqR7I5fs Hycxe0XKLlDzQlS+90CHsl9aDt/tey2dPU3OZ8velzdH3m7Oq56nt38JakXBL8qiJlwFB6RPac9 fmqtV9YVvw2V+ur+CNa6F2yooxnR0ZQSern/PMbuW1+PJjCuTZdu6FnkrjP9YCfpV0vtmkd0dwZ wdufFtLJE1x91WBv9+ovx+qf79NjsJaZKdZmXv51wh4mAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/da9052-battery.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/da9052-battery.c b/drivers/power/supply/da9052-battery.c index d87bdecc9501..6f7c58a41e91 100644 --- a/drivers/power/supply/da9052-battery.c +++ b/drivers/power/supply/da9052-battery.c @@ -637,7 +637,7 @@ static s32 da9052_bat_probe(struct platform_device *pdev) return ret; } -static int da9052_bat_remove(struct platform_device *pdev) +static void da9052_bat_remove(struct platform_device *pdev) { int i; struct da9052_battery *bat = platform_get_drvdata(pdev); @@ -646,13 +646,11 @@ static int da9052_bat_remove(struct platform_device *pdev) da9052_free_irq(bat->da9052, da9052_bat_irq_bits[i], bat); power_supply_unregister(bat->psy); - - return 0; } static struct platform_driver da9052_bat_driver = { .probe = da9052_bat_probe, - .remove = da9052_bat_remove, + .remove_new = da9052_bat_remove, .driver = { .name = "da9052-bat", }, From patchwork Mon Sep 18 13:36: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: 13390058 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 A50A3CD13D2 for ; Mon, 18 Sep 2023 16:33:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbjIRQdm (ORCPT ); Mon, 18 Sep 2023 12:33:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbjIRQd1 (ORCPT ); Mon, 18 Sep 2023 12:33:27 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 722FE86A1 for ; Mon, 18 Sep 2023 09:13:05 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER3-0001vq-JC; Mon, 18 Sep 2023 15:37:09 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER2-007EYk-SX; Mon, 18 Sep 2023 15:37:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER2-002fWc-JO; Mon, 18 Sep 2023 15:37:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Support Opensource , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/32] power: supply: da9150-charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:40 +0200 Message-Id: <20230918133700.1254499-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1976; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rfRJg6wF+UuCSl+xHxeTBBO5T3UDOwPUJnZS1pr/gpU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJd7QaxM+j15WNYpIpEzD35pn4gZg+Lv4vi1 KDHalAx/M+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSXQAKCRCPgPtYfRL+ TqcLB/9ClgwOP84v7fi6FfdZUSSr4PriuO2y4EkAlIRqji3oTU4MmUjebYl7Q8FdqHXeRlx/ncK JZrPkw4kyJ9LDb0/LO4U1StgvwdzTaZi0/MGkEXjtXnUxcS4qa2MLnRx9ijCaJk2U2xdknk4QUX ypuudZUslVQVykEf5u/vyl/e9dhZxV/pbJliC6/rBHpfXmkVhF0nz+Kjem85kN2vnobyJLX3Cp8 KLkJQf9+s9gNWOk+U1paTURNc9WkU93lVoKO4S0CZ/5FyXtUPb21DHXDR3mlID4uC0NogbLzdsX s324i/Rmy59siJr5AKGPPG1ZXGdxcJv/O2GV33qhr1szqeOB X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/da9150-charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/da9150-charger.c b/drivers/power/supply/da9150-charger.c index 27f897067aa3..37db9e4ed7f3 100644 --- a/drivers/power/supply/da9150-charger.c +++ b/drivers/power/supply/da9150-charger.c @@ -635,7 +635,7 @@ static int da9150_charger_probe(struct platform_device *pdev) return ret; } -static int da9150_charger_remove(struct platform_device *pdev) +static void da9150_charger_remove(struct platform_device *pdev) { struct da9150_charger *charger = platform_get_drvdata(pdev); int irq; @@ -665,8 +665,6 @@ static int da9150_charger_remove(struct platform_device *pdev) iio_channel_release(charger->vbus_chan); iio_channel_release(charger->tjunc_chan); iio_channel_release(charger->vbat_chan); - - return 0; } static struct platform_driver da9150_charger_driver = { @@ -674,7 +672,7 @@ static struct platform_driver da9150_charger_driver = { .name = "da9150-charger", }, .probe = da9150_charger_probe, - .remove = da9150_charger_remove, + .remove_new = da9150_charger_remove, }; module_platform_driver(da9150_charger_driver); From patchwork Mon Sep 18 13:36: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: 13390173 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 3D888C46CA1 for ; Mon, 18 Sep 2023 17:14:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231509AbjIRROy (ORCPT ); Mon, 18 Sep 2023 13:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231405AbjIRROx (ORCPT ); Mon, 18 Sep 2023 13:14:53 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7651E1FED for ; Mon, 18 Sep 2023 09:10:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER3-0001wC-Pt; Mon, 18 Sep 2023 15:37:09 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER3-007EYo-55; Mon, 18 Sep 2023 15:37:09 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER2-002fWg-SA; Mon, 18 Sep 2023 15:37:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 13/32] power: supply: goldfish_battery: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:41 +0200 Message-Id: <20230918133700.1254499-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1930; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=y72EgNf7ctYp9lWq0PeLJDCgY7D5jVZUxz3iBX7F2jk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJf3yS00YSrK648+vECAajvRAkSVYCEXyZ39 vb40PQmF3CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSXwAKCRCPgPtYfRL+ TrPyCAC0nrKtPc6swKT6BLF/PQg2Wn50MgNiHvV4YQIG0jN01xJQVeg1bknBD7iJ/WV0bsTGcMi f5Run/7woOiMzKYh9GfYSL72Ifzxa7fbCEshHtxSgrymCe8xPkb6wCoqf8us165pQIFhsc9Zy64 SqfdbmN49WDbSiGRhMQZtB1Q3gS9g7PdkIu90zeCsynWoKYK2cI0DAFd+PE5+EZUWumTJihwTpP oWfO38LiDKNiWDi6UQuxXC30XinBx0dKySJtHjfNaMxIIR2Bx75ke6v1Kz4iRiXH67p01n75L5x kriB8KnDq+0L4qAJmqFFh7J4aiPDwTedHH0refic8vPqCW4j X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/goldfish_battery.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/goldfish_battery.c b/drivers/power/supply/goldfish_battery.c index a58d713d75ce..8bb645ad1e5d 100644 --- a/drivers/power/supply/goldfish_battery.c +++ b/drivers/power/supply/goldfish_battery.c @@ -249,13 +249,12 @@ static int goldfish_battery_probe(struct platform_device *pdev) return 0; } -static int goldfish_battery_remove(struct platform_device *pdev) +static void goldfish_battery_remove(struct platform_device *pdev) { struct goldfish_battery_data *data = platform_get_drvdata(pdev); power_supply_unregister(data->battery); power_supply_unregister(data->ac); - return 0; } static const struct of_device_id goldfish_battery_of_match[] = { @@ -274,7 +273,7 @@ MODULE_DEVICE_TABLE(acpi, goldfish_battery_acpi_match); static struct platform_driver goldfish_battery_device = { .probe = goldfish_battery_probe, - .remove = goldfish_battery_remove, + .remove_new = goldfish_battery_remove, .driver = { .name = "goldfish-battery", .of_match_table = goldfish_battery_of_match, From patchwork Mon Sep 18 13:36: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: 13390060 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 49D7CCD13D2 for ; Mon, 18 Sep 2023 16:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbjIRQd7 (ORCPT ); Mon, 18 Sep 2023 12:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbjIRQdd (ORCPT ); Mon, 18 Sep 2023 12:33:33 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79C0C25455 for ; Mon, 18 Sep 2023 09:15:26 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER4-0001wt-1U; Mon, 18 Sep 2023 15:37:10 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER3-007EYr-Bd; Mon, 18 Sep 2023 15:37:09 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER3-002fWk-2W; Mon, 18 Sep 2023 15:37:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/32] power: supply: ipaq_micro_battery: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:42 +0200 Message-Id: <20230918133700.1254499-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1959; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=10tTuouqM0XxEjfGh5+rhGaANufdmub8QOVolPz9Ac0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJgxPa9j0raRKc9m+G6veBrFGEXqD+KSKby3 sCeycc9TkWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSYAAKCRCPgPtYfRL+ ThRQCACIrZOMqLaw3uRUjVmRHICNZINY2wbuw9Ekjz/t6Ori0Yv7jXfJJ4PcbliI0MhbKf1wQB8 WLFi111zR31IonJQJlTzcXwG2ZjdOwszirihNwyq/uh8eRdOoDirJl5fNok1CMbpsSI9sMNIktf iYabxLGJpUpeVJdXAuwLtFTM4oNlbBxKwQ0+mKFiUNPth4u64fofPjXQZ6+NVgKchvdz75IE6FG Ukl+1ca7TOUdtWibIOzZMwszYICs6nYtT0XswWq6KwiJLlCQ0DITuwX6qzbniYzGt03XcVENLX5 nAcCgHT5HBn8yx9DJoRbVLCRxPhrvaCTpUFNkUwkGXCTq0kU X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/ipaq_micro_battery.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/ipaq_micro_battery.c b/drivers/power/supply/ipaq_micro_battery.c index 192d9db0fb00..66cc649f702a 100644 --- a/drivers/power/supply/ipaq_micro_battery.c +++ b/drivers/power/supply/ipaq_micro_battery.c @@ -265,7 +265,7 @@ static int micro_batt_probe(struct platform_device *pdev) return ret; } -static int micro_batt_remove(struct platform_device *pdev) +static void micro_batt_remove(struct platform_device *pdev) { struct micro_battery *mb = platform_get_drvdata(pdev); @@ -274,8 +274,6 @@ static int micro_batt_remove(struct platform_device *pdev) power_supply_unregister(micro_batt_power); cancel_delayed_work_sync(&mb->update); destroy_workqueue(mb->wq); - - return 0; } static int __maybe_unused micro_batt_suspend(struct device *dev) @@ -304,7 +302,7 @@ static struct platform_driver micro_batt_device_driver = { .pm = µ_batt_dev_pm_ops, }, .probe = micro_batt_probe, - .remove = micro_batt_remove, + .remove_new = micro_batt_remove, }; module_platform_driver(micro_batt_device_driver); From patchwork Mon Sep 18 13:36: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: 13390109 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 0DCC8CD13D2 for ; Mon, 18 Sep 2023 16:46:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230495AbjIRQqf (ORCPT ); Mon, 18 Sep 2023 12:46:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230498AbjIRQqT (ORCPT ); Mon, 18 Sep 2023 12:46:19 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C671D6A5F for ; Mon, 18 Sep 2023 09:11:37 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER4-0001y0-73; Mon, 18 Sep 2023 15:37:10 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER3-007EYv-IZ; Mon, 18 Sep 2023 15:37:09 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER3-002fWo-9X; Mon, 18 Sep 2023 15:37:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: =?utf-8?q?Pali_Roh=C3=A1r?= , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/32] power: supply: isp1704_charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:43 +0200 Message-Id: <20230918133700.1254499-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1876; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wUgZNYjo2rBLlxtBn6e9lMzocGxL0LFh0SBZ40XoaK4=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSOoEQJY4UU4xdiGfrCe78GVTpOvOyeP0NFSySCIY7p0 hW9OwKdjMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAEwkM4GDYfayIK/TD7criMix peUs+3FZw03H+PyD/d4M/ZkPOH4dsNWM3lqvd0J5o/TyJCfubUkOreWl0Taii5MXGVhPSfn5hF+ u39Hg3zw2a8sn4tp3p2q+Vih02q8oK702IEN2aWSKTWGxTtSu2SyeLXsrfj5usS5K31KSI5H30c Uuskx53+HqX2dP2rNI7irSfjt5YsmqHI+lwSs9jI6lsMxhDzs26/21P+/y0v/EuJUF9IYcUjziZ T5z29XAvzurjzF2uiX+PTw/ryNvfUhZxJRp9w/qpmf+nNLVXrzdfzX3tyV82s8YC3f0pGRseBQq 2urmNIVblV3KOa3To+X+uZBbfQy3zorxcO63MH/ZXQ4A X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/isp1704_charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/isp1704_charger.c b/drivers/power/supply/isp1704_charger.c index b6efc454e4f0..860d8614c98f 100644 --- a/drivers/power/supply/isp1704_charger.c +++ b/drivers/power/supply/isp1704_charger.c @@ -477,15 +477,13 @@ static int isp1704_charger_probe(struct platform_device *pdev) return ret; } -static int isp1704_charger_remove(struct platform_device *pdev) +static void isp1704_charger_remove(struct platform_device *pdev) { struct isp1704_charger *isp = platform_get_drvdata(pdev); usb_unregister_notifier(isp->phy, &isp->nb); power_supply_unregister(isp->psy); isp1704_charger_set_power(isp, 0); - - return 0; } #ifdef CONFIG_OF @@ -503,7 +501,7 @@ static struct platform_driver isp1704_charger_driver = { .of_match_table = of_match_ptr(omap_isp1704_of_match), }, .probe = isp1704_charger_probe, - .remove = isp1704_charger_remove, + .remove_new = isp1704_charger_remove, }; module_platform_driver(isp1704_charger_driver); From patchwork Mon Sep 18 13:36: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: 13390062 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 67E95C46CA1 for ; Mon, 18 Sep 2023 16:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjIRQeV (ORCPT ); Mon, 18 Sep 2023 12:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbjIRQeL (ORCPT ); Mon, 18 Sep 2023 12:34:11 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8889325ACD for ; Mon, 18 Sep 2023 09:15:33 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER4-0001yT-Ci; Mon, 18 Sep 2023 15:37:10 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER3-007EYz-Pb; Mon, 18 Sep 2023 15:37:09 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER3-002fWs-Gf; Mon, 18 Sep 2023 15:37:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 16/32] power: supply: lp8788-charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:44 +0200 Message-Id: <20230918133700.1254499-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1736; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=vruG3hHwLNuGO+rhcyQSr1FrN2aCzwC5edWfN4UfJA0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJib33hVw1j0LE8NR7CK3SnDOi+72DKg5Zzz pdaavJhg/iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSYgAKCRCPgPtYfRL+ Tj8dCACSmI4t0sfgPoBYznDxinSngThl3zShC87Cw/C+gnV3NbOLI3luQA+M2+ObVFoE6Gi3CDI hRfN+kfxJoRs8D5/85i76Mq8g+ve6XQqy8ycQj6hDKbvZNuoqZT1B2ii3Z+tozQ7m7rtc4xzCHK YJ9gkRjEWcNqDS5pDWCm5UJ2H/QibAdwMDlUc5FF0Y5BJnYM76GiLSm7WN9UL7BuOU15fzeMTB+ YdeLRKGfWL2nfJ+3DNe7a/WbQgyAWvmRvHZjBnWFYvd0q8fTkup7Qf2mrygwkrgfYyw8c/8sVXP ZtTWtMSQ6QvlENuslok+YqwNMzxXBS4v+K4QhBcqfL1jO1s3 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/lp8788-charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/lp8788-charger.c b/drivers/power/supply/lp8788-charger.c index 755b6a4379b8..2c81be82a41a 100644 --- a/drivers/power/supply/lp8788-charger.c +++ b/drivers/power/supply/lp8788-charger.c @@ -714,20 +714,18 @@ static int lp8788_charger_probe(struct platform_device *pdev) return 0; } -static int lp8788_charger_remove(struct platform_device *pdev) +static void lp8788_charger_remove(struct platform_device *pdev) { struct lp8788_charger *pchg = platform_get_drvdata(pdev); flush_work(&pchg->charger_work); lp8788_irq_unregister(pdev, pchg); lp8788_psy_unregister(pchg); - - return 0; } static struct platform_driver lp8788_charger_driver = { .probe = lp8788_charger_probe, - .remove = lp8788_charger_remove, + .remove_new = lp8788_charger_remove, .driver = { .name = LP8788_DEV_CHARGER, }, From patchwork Mon Sep 18 13:36: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: 13390074 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 A99DECD13D8 for ; Mon, 18 Sep 2023 16:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbjIRQfK (ORCPT ); Mon, 18 Sep 2023 12:35:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230428AbjIRQes (ORCPT ); Mon, 18 Sep 2023 12:34:48 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE89125AC7 for ; Mon, 18 Sep 2023 09:15:32 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER4-0001yp-NZ; Mon, 18 Sep 2023 15:37:10 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER3-007EZ3-WA; Mon, 18 Sep 2023 15:37:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER3-002fWw-N7; Mon, 18 Sep 2023 15:37:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Krzysztof Kozlowski , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/32] power: supply: max14577_charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:45 +0200 Message-Id: <20230918133700.1254499-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1948; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uBHJekQpPQTr78dF4bso7U9NPKH5evEJEaQhwnGCj+Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJjRFcfhKw9k7UBSi0/i09wSsmfHcVXH7pU/ IiKdDgT1NGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSYwAKCRCPgPtYfRL+ TpG9B/978GK4fFPkbedD1BodrwRd3bcP0vC2zx6JjvfcJjgKRHxX4PfoFc8ITrkRoNcPovvsuk7 bFWZ0eWBCDT5pmRz+JBQC/jaY0uv5sEQ8PI2jOKbfzvjXt2eZJ7+VZuxoyQLoVEpV9Iprr7rg9i tsgtIRdr+sM0PJ+ztijKKhz0OMa1GVOmSQI6NGdYXdE+yr7xeklrF6WuojNLEOQxaOnQfHcz1jV Oiqx6Va1Nu2namzd+uvzq2NTLlNmmbzDyIePth/HX2GXH93ddXNV3dGx4eXdB+HCYKHF6+21G+u Q7ZRU53sNDBCyExXY3kbDFuAebOxYYVCGusTiSDAZfRbBOx1 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/max14577_charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/max14577_charger.c b/drivers/power/supply/max14577_charger.c index 96f9de775043..7c23fa89ea19 100644 --- a/drivers/power/supply/max14577_charger.c +++ b/drivers/power/supply/max14577_charger.c @@ -606,14 +606,12 @@ static int max14577_charger_probe(struct platform_device *pdev) return ret; } -static int max14577_charger_remove(struct platform_device *pdev) +static void max14577_charger_remove(struct platform_device *pdev) { struct max14577_charger *chg = platform_get_drvdata(pdev); device_remove_file(&pdev->dev, &dev_attr_fast_charge_timer); power_supply_unregister(chg->charger); - - return 0; } static const struct platform_device_id max14577_charger_id[] = { @@ -638,7 +636,7 @@ static struct platform_driver max14577_charger_driver = { .of_match_table = of_max14577_charger_dt_match, }, .probe = max14577_charger_probe, - .remove = max14577_charger_remove, + .remove_new = max14577_charger_remove, .id_table = max14577_charger_id, }; module_platform_driver(max14577_charger_driver); From patchwork Mon Sep 18 13:36: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: 13390009 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 A6A55CD37B0 for ; Mon, 18 Sep 2023 16:18:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbjIRQS0 (ORCPT ); Mon, 18 Sep 2023 12:18:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbjIRQSL (ORCPT ); Mon, 18 Sep 2023 12:18:11 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11FD026682 for ; Mon, 18 Sep 2023 09:15:37 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER4-0001zC-TD; Mon, 18 Sep 2023 15:37:10 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER4-007EZ7-8V; Mon, 18 Sep 2023 15:37:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER3-002fX0-Vf; Mon, 18 Sep 2023 15:37:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Bartosz Golaszewski , kernel@pengutronix.de, linux-pm@vger.kernel.org Subject: [PATCH 18/32] power: supply: max77650-charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:46 +0200 Message-Id: <20230918133700.1254499-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1868; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=XOybgwAn2tFly982ZUfG7G7frYaU5FokLnhT2ZIRGqc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJkbaQ2jGwLdIztgbOu6o78NJxHmScK5e/aB HQuIVZEFyWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSZAAKCRCPgPtYfRL+ Ts3oB/4wvuXK7l49rvd/6g7injmlrzZNakOQWDj5Q4NWlYTx4P2V3F65Qg6duo4CkrqYiBMmFXx Whn86bvmt3cMZTjlcxy8kZI7bw5dJL6GPeX6e1M+bMJaBl5q4kzfEAHlFF9CLkdsQKiFdlQ5bXe Pqz9byHrojQeSSNBdj6S3dfs+3THmHFfRSf6OnaRpvdR9XmyHwh1DtIfCm5TTjDvD2XqQoyo520 92mYelxHXOV05cK/ssybWD+dfzVcXe1eIEDH98qUopCgomFyS8QHRk8oJBvvZxPVolr1KwjMaOe zQxrGaFiwD9aryKeUboPVgyWlw02oQ44gQBswfkMv3GVyOc2 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/max77650-charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/max77650-charger.c b/drivers/power/supply/max77650-charger.c index e8c25da40ab2..818e13c613e3 100644 --- a/drivers/power/supply/max77650-charger.c +++ b/drivers/power/supply/max77650-charger.c @@ -345,13 +345,11 @@ static int max77650_charger_probe(struct platform_device *pdev) return max77650_charger_enable(chg); } -static int max77650_charger_remove(struct platform_device *pdev) +static void max77650_charger_remove(struct platform_device *pdev) { struct max77650_charger_data *chg = platform_get_drvdata(pdev); max77650_charger_disable(chg); - - return 0; } static const struct of_device_id max77650_charger_of_match[] = { @@ -366,7 +364,7 @@ static struct platform_driver max77650_charger_driver = { .of_match_table = max77650_charger_of_match, }, .probe = max77650_charger_probe, - .remove = max77650_charger_remove, + .remove_new = max77650_charger_remove, }; module_platform_driver(max77650_charger_driver); From patchwork Mon Sep 18 13:36: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: 13390030 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 B5758CD37B0 for ; Mon, 18 Sep 2023 16:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbjIRQVR (ORCPT ); Mon, 18 Sep 2023 12:21:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbjIRQVJ (ORCPT ); Mon, 18 Sep 2023 12:21:09 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B991627BA1 for ; Mon, 18 Sep 2023 09:15:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER5-0001zz-13; Mon, 18 Sep 2023 15:37:11 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER4-007EZB-Fo; Mon, 18 Sep 2023 15:37:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER4-002fX4-6i; Mon, 18 Sep 2023 15:37:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Krzysztof Kozlowski , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 19/32] power: supply: max77693_charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:47 +0200 Message-Id: <20230918133700.1254499-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2015; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hP/9uSFJvxgAhTG3pj6HfTvOFbRqa4UMb/e+j3vn7Ls=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJmjCsC9W4TRzBLC8nPGd8UIRbO4KRk6Dwko lhEqn1D//2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSZgAKCRCPgPtYfRL+ Tp5ACACe36zZmQdn/o5Ikt9lrrE0ObpEXIRsn0uv3mmeA2g4KaQ5pArZARKdQjkiFs0k5vkgR8u zzqg0oJmpN+4OrT0Lja8ibI3c77pLlvOMviMv0BhcoTN9SlpCJY/xKJNE/hNfuEj6NZJYVOrDad ND4x15SaPeToIrdNFQJ6sB51dtfCJYfKRpM7WccKMo335lOYeN7anxM7njWjWrOYwym/UH/tOb+ OkeS37ruY1pxZokv7RZAwfMBBqqTehDQxMozG4NnjlYtlv/fj43iqHZh7CtrWcK9DrsrFCDDCWj 46rT+z8qQlpmZ28Czyaaw/DquZ2uccS86YPrNiRgoNEHBm2U X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/max77693_charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/max77693_charger.c b/drivers/power/supply/max77693_charger.c index 794c8c054450..d0157e63b8b5 100644 --- a/drivers/power/supply/max77693_charger.c +++ b/drivers/power/supply/max77693_charger.c @@ -728,7 +728,7 @@ static int max77693_charger_probe(struct platform_device *pdev) return ret; } -static int max77693_charger_remove(struct platform_device *pdev) +static void max77693_charger_remove(struct platform_device *pdev) { struct max77693_charger *chg = platform_get_drvdata(pdev); @@ -737,8 +737,6 @@ static int max77693_charger_remove(struct platform_device *pdev) device_remove_file(&pdev->dev, &dev_attr_fast_charge_timer); power_supply_unregister(chg->charger); - - return 0; } static const struct platform_device_id max77693_charger_id[] = { @@ -752,7 +750,7 @@ static struct platform_driver max77693_charger_driver = { .name = "max77693-charger", }, .probe = max77693_charger_probe, - .remove = max77693_charger_remove, + .remove_new = max77693_charger_remove, .id_table = max77693_charger_id, }; module_platform_driver(max77693_charger_driver); From patchwork Mon Sep 18 13:36: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: 13390061 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 11300CD13DA for ; Mon, 18 Sep 2023 16:33:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbjIRQeC (ORCPT ); Mon, 18 Sep 2023 12:34:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbjIRQdf (ORCPT ); Mon, 18 Sep 2023 12:33:35 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DB3B282BC for ; Mon, 18 Sep 2023 09:15:59 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER5-00020T-85; Mon, 18 Sep 2023 15:37:11 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER4-007EZF-Mq; Mon, 18 Sep 2023 15:37:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER4-002fX8-Dr; Mon, 18 Sep 2023 15:37:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/32] power: supply: max8925_power: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:48 +0200 Message-Id: <20230918133700.1254499-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1783; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=O39TpgR518JvrGhlAmCobiVC+NVkwxXu4+RkO0zKYJ8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJnpsXmCrgGt0a6UCL1H50/XAJwx1OQ4DSQl E/RNhk+TXKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSZwAKCRCPgPtYfRL+ Tg08B/9rycNNttFQsJrZP7qQLblKCwSfzbRNx8FRZmVs8OVAup0HbGm6FHCWKPMWARmV63w/Cjm f809J/mDM/bodydKwqeqIdg3TzmWXPPWDrA2mnf6+6Mkbrr/XSKpVb3tmKsOlrRjrZEdDqEalYZ 3vz58o+zdsTfcoB9R01EJnX8HYjXaQa6Oox+aatd1qD6Dkq5mr4AHAkA48ZC9aiBP+0Nnko9I19 fIZKZ65wvdSQcG/L5esnREeVS28+yfbZB0hLB5v24g50LLOzEPs0Lln5Ed+E0bAhwKqjMNTHmx2 2ynIfwlDomiXSwywZKtS/oINspQP2fdZiDoPvLW+mGLHdJM8 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/max8925_power.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/max8925_power.c b/drivers/power/supply/max8925_power.c index 8878f9131184..4a2d6894f94e 100644 --- a/drivers/power/supply/max8925_power.c +++ b/drivers/power/supply/max8925_power.c @@ -566,7 +566,7 @@ static int max8925_power_probe(struct platform_device *pdev) return ret; } -static int max8925_power_remove(struct platform_device *pdev) +static void max8925_power_remove(struct platform_device *pdev) { struct max8925_power_info *info = platform_get_drvdata(pdev); @@ -576,12 +576,11 @@ static int max8925_power_remove(struct platform_device *pdev) power_supply_unregister(info->battery); max8925_deinit_charger(info); } - return 0; } static struct platform_driver max8925_power_driver = { .probe = max8925_power_probe, - .remove = max8925_power_remove, + .remove_new = max8925_power_remove, .driver = { .name = "max8925-power", }, From patchwork Mon Sep 18 13:36: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: 13390014 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 E14D8CD37B0 for ; Mon, 18 Sep 2023 16:18:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbjIRQSu (ORCPT ); Mon, 18 Sep 2023 12:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbjIRQSi (ORCPT ); Mon, 18 Sep 2023 12:18:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28806274AA for ; Mon, 18 Sep 2023 09:15:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER5-00021q-DE; Mon, 18 Sep 2023 15:37:11 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER4-007EZJ-UG; Mon, 18 Sep 2023 15:37:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER4-002fXC-LC; Mon, 18 Sep 2023 15:37:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 21/32] power: supply: pcf50633-charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:49 +0200 Message-Id: <20230918133700.1254499-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1938; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YYvLO9P69QKCjKr7Gs/6YSWBHBfCqXLTkFvH9WwQtIw=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSOoAwh67Loh20nJ78VvH3nRrP4BI9N4W++qBmvZvFYE fkk4ntUJ6MxCwMjF4OsmCKLfeOaTKsqucjOtf8uwwxiZQKZwsDFKQATMeTkYNjioipzx69dd/YW 2fueAXLTJydLF3w7rSZaucF/1V6n64dlsuJzWgp5J8yvECjRSMqXCdsvyz37Xlpnd3bEucv5qkw 7dH8dDf5Rc73czTNtirBl1obCtYuKiuf84pbPd4pqfHV03QP/pqsR5ssu2aavMqrkZxfS8bye0l 7zdPPOSwc3LLXxusF27O9B47SuutUStuJirmceautO32Czs0w1RWOLPfv6qx6fVvmKqfzp1dI8f t7FdOIaiaXyr098PcC7skTdpl+EU8Ao5B6X33L10EOi23nWh3TEGc/7Kq5grevheyn/hu3PaUWv Iqtez7EPP+YeKr1rVYb2760/s3xkjHTmn9JvmbnZuuYeAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/pcf50633-charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/pcf50633-charger.c b/drivers/power/supply/pcf50633-charger.c index fd44cb8ac0e2..950e30917c63 100644 --- a/drivers/power/supply/pcf50633-charger.c +++ b/drivers/power/supply/pcf50633-charger.c @@ -441,7 +441,7 @@ static int pcf50633_mbc_probe(struct platform_device *pdev) return 0; } -static int pcf50633_mbc_remove(struct platform_device *pdev) +static void pcf50633_mbc_remove(struct platform_device *pdev) { struct pcf50633_mbc *mbc = platform_get_drvdata(pdev); int i; @@ -453,8 +453,6 @@ static int pcf50633_mbc_remove(struct platform_device *pdev) power_supply_unregister(mbc->usb); power_supply_unregister(mbc->adapter); power_supply_unregister(mbc->ac); - - return 0; } static struct platform_driver pcf50633_mbc_driver = { @@ -462,7 +460,7 @@ static struct platform_driver pcf50633_mbc_driver = { .name = "pcf50633-mbc", }, .probe = pcf50633_mbc_probe, - .remove = pcf50633_mbc_remove, + .remove_new = pcf50633_mbc_remove, }; module_platform_driver(pcf50633_mbc_driver); From patchwork Mon Sep 18 13:36: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: 13390026 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 2013DCD13D2 for ; Mon, 18 Sep 2023 16:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbjIRQTh (ORCPT ); Mon, 18 Sep 2023 12:19:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230205AbjIRQTX (ORCPT ); Mon, 18 Sep 2023 12:19:23 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4349659FE for ; Mon, 18 Sep 2023 09:09:37 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER5-00024w-JQ; Mon, 18 Sep 2023 15:37:11 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER5-007EZO-5Y; Mon, 18 Sep 2023 15:37:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER4-002fXG-Sa; Mon, 18 Sep 2023 15:37:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 22/32] power: supply: qcom_smbb: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:50 +0200 Message-Id: <20230918133700.1254499-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-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=4twwal5CxO05aJdYGCbLEbuMJZAYxeRM+s8fOAENmkE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJpl1W9dWhwlKYrUlRNCGkMmYKxzkyXXwa2c Rr+map4pUWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSaQAKCRCPgPtYfRL+ TtNYCACt0BLDIBGVZ16APWEjpvAppn36ltBpvcueMFQUST8wu0scA9Uog2gi/Z2bX12n+CVmQC+ 7WOTEoMO0BH9T/RkWUvNtsQUv7thWg6mCnv3FiN/Fsc+tiUHpYqqKzsSPj0CYkeQRqzTwtMiqVF UJeN9NqG+cCqb8jQ1GtbOLOACmHlRjVs900JWOdY5xv0VGrUKFcs4i+OT3WQRqjNaqvoTDVHq/x mzHTSF+0yegOczp/9wjWHco6dUZdb8W8AWCDsQFtEHFqscNi6fOL4zpi8mSWeAa31rsmFdKvE34 j/TnLb8Z0Og74Ht/22i2FO940CUFF8jNQdKMj2CPw+TU2/r6 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 --- drivers/power/supply/qcom_smbb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/qcom_smbb.c b/drivers/power/supply/qcom_smbb.c index bd50124eef9f..4e57762e27ba 100644 --- a/drivers/power/supply/qcom_smbb.c +++ b/drivers/power/supply/qcom_smbb.c @@ -1000,15 +1000,13 @@ static int smbb_charger_probe(struct platform_device *pdev) return 0; } -static int smbb_charger_remove(struct platform_device *pdev) +static void smbb_charger_remove(struct platform_device *pdev) { struct smbb_charger *chg; chg = platform_get_drvdata(pdev); regmap_update_bits(chg->regmap, chg->addr + SMBB_CHG_CTRL, CTRL_EN, 0); - - return 0; } static const struct of_device_id smbb_charger_id_table[] = { @@ -1020,7 +1018,7 @@ MODULE_DEVICE_TABLE(of, smbb_charger_id_table); static struct platform_driver smbb_charger_driver = { .probe = smbb_charger_probe, - .remove = smbb_charger_remove, + .remove_new = smbb_charger_remove, .driver = { .name = "qcom-smbb", .of_match_table = smbb_charger_id_table, From patchwork Mon Sep 18 13:36: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: 13390076 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 8EDD3CD13D8 for ; Mon, 18 Sep 2023 16:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbjIRQfc (ORCPT ); Mon, 18 Sep 2023 12:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230134AbjIRQfU (ORCPT ); Mon, 18 Sep 2023 12:35:20 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B03D0216E5 for ; Mon, 18 Sep 2023 09:14:35 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER5-00028K-Py; Mon, 18 Sep 2023 15:37:11 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER5-007EZS-Bu; Mon, 18 Sep 2023 15:37:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER5-002fXK-2y; Mon, 18 Sep 2023 15:37:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: =?utf-8?q?Pali_Roh=C3=A1r?= , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/32] power: supply: rx51_battery: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:51 +0200 Message-Id: <20230918133700.1254499-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1953; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kt4IFqfKKkCG5RhT/CM6kvvOCQQyrT7zf+d5hrLijmw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJqMwDYLrXWTugpf/tNx+vdtgXDeM1yHvCS2 PH++h7AMEyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSagAKCRCPgPtYfRL+ TqVYCAC1xm4u7aMk163A4dmFDRJuTpoFSquxZKBJXGjZndYVyaF9iA5DVyMcGUqmYBbmUQwGf5k z2vLZddHZHHDUkpi1cLDDBKRaFDwA9PtWsx6y5ZS+aOntudfKR4sw28Ozn+7MtBFlPNfm0dloI7 Oc1W562vgDEGJE6rOxk6HXY6hh4V5yBabqjr8Qg8eR3puVoqgYz4rpVwTIiMie4OWx+3wsRaq2D /cWAGRcR6iV9WiJaUW/SOHtt6PaFFCbVdVh3npDB0FM309IPLx8H9m7nYl/EiKfbAKHL9rQEJfp Fa590jCLg830fzp5Dica5RSklHMO4IKqbvBSBk1jJ1WnGtMI X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/rx51_battery.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/rx51_battery.c b/drivers/power/supply/rx51_battery.c index 6e488ecf4dcb..e2bfc81f0fd9 100644 --- a/drivers/power/supply/rx51_battery.c +++ b/drivers/power/supply/rx51_battery.c @@ -246,7 +246,7 @@ static int rx51_battery_probe(struct platform_device *pdev) return ret; } -static int rx51_battery_remove(struct platform_device *pdev) +static void rx51_battery_remove(struct platform_device *pdev) { struct rx51_device_info *di = platform_get_drvdata(pdev); @@ -255,8 +255,6 @@ static int rx51_battery_remove(struct platform_device *pdev) iio_channel_release(di->channel_vbat); iio_channel_release(di->channel_bsi); iio_channel_release(di->channel_temp); - - return 0; } #ifdef CONFIG_OF @@ -269,7 +267,7 @@ MODULE_DEVICE_TABLE(of, n900_battery_of_match); static struct platform_driver rx51_battery_driver = { .probe = rx51_battery_probe, - .remove = rx51_battery_remove, + .remove_new = rx51_battery_remove, .driver = { .name = "rx51-battery", .of_match_table = of_match_ptr(n900_battery_of_match), From patchwork Mon Sep 18 13:36: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: 13390059 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 AFE17CD37B0 for ; Mon, 18 Sep 2023 16:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbjIRQdx (ORCPT ); Mon, 18 Sep 2023 12:33:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjIRQda (ORCPT ); Mon, 18 Sep 2023 12:33:30 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A2939EDF for ; Mon, 18 Sep 2023 09:13:38 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER6-0002Ar-01; Mon, 18 Sep 2023 15:37:12 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER5-007EZW-Id; Mon, 18 Sep 2023 15:37:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER5-002fXO-9V; Mon, 18 Sep 2023 15:37:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: Orson Zhai , Baolin Wang , Chunyan Zhang , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 24/32] power: supply: sc2731_charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:52 +0200 Message-Id: <20230918133700.1254499-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1838; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=JOFB5KtMSpNaNpp0ew+p4vz8n3NR6mr5udfy08IINEg=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSOoOwbgU4f/3W6ONotEUz43FftbHBBrmInx8Qq5V8bO mKElUw7GY1ZGBi5GGTFFFnsG9dkWlXJRXau/XcZZhArE8gUBi5OAZjI1escDIv3Twy2/rSQTzY0 V9S1ulx515nGr46qJh17r/xj5VjxstE/uPAT802Np99MbVtnHOrVXuYqkJvHIr+2dfWaN0ubvr1 VPxSzq+3PtFiLKQLsXIkzDjCxxC05GeK2+QLzK1PRGhFux4/uBXueKKX1svknrQy7UdCwP4Hl6A yTlQ57Ao9Hq7u/Y1zmvv5Hd/i0azNiHT1LL3qm1cm01i2QdXq8vTVZPKb6yHeZiwkvzxvbZ78/c q0uT7nFPEwyaP2DU29StvzP/+wyr9xPt0iLtaEnP3GXf47wpGh7pbUtHbL2Yq5N21pfnjNvFOff l9k0d6nPO6mM5PzytOUdmz1YN73sUvCzkndcu3Oy60cA X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/sc2731_charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/sc2731_charger.c b/drivers/power/supply/sc2731_charger.c index 9ac17cf7a126..b3d8b1ca97da 100644 --- a/drivers/power/supply/sc2731_charger.c +++ b/drivers/power/supply/sc2731_charger.c @@ -511,13 +511,11 @@ static int sc2731_charger_probe(struct platform_device *pdev) return 0; } -static int sc2731_charger_remove(struct platform_device *pdev) +static void sc2731_charger_remove(struct platform_device *pdev) { struct sc2731_charger_info *info = platform_get_drvdata(pdev); usb_unregister_notifier(info->usb_phy, &info->usb_notify); - - return 0; } static const struct of_device_id sc2731_charger_of_match[] = { @@ -532,7 +530,7 @@ static struct platform_driver sc2731_charger_driver = { .of_match_table = sc2731_charger_of_match, }, .probe = sc2731_charger_probe, - .remove = sc2731_charger_remove, + .remove_new = sc2731_charger_remove, }; module_platform_driver(sc2731_charger_driver); From patchwork Mon Sep 18 13:36: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: 13390017 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 4C810CD13D2 for ; Mon, 18 Sep 2023 16:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbjIRQSw (ORCPT ); Mon, 18 Sep 2023 12:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbjIRQSi (ORCPT ); Mon, 18 Sep 2023 12:18:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C34C2828D for ; Mon, 18 Sep 2023 09:15:56 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER6-0002BX-7Z; Mon, 18 Sep 2023 15:37:12 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER5-007EZa-RH; Mon, 18 Sep 2023 15:37:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER5-002fXS-G6; Mon, 18 Sep 2023 15:37:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/32] power: supply: tps65090-charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:53 +0200 Message-Id: <20230918133700.1254499-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-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=c/R0iiWKUAuxhbZs2UzVuSv3IZQ7onqB4kRUXrgixZg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJt6hBvNJ8nhvTmdZltrD5zsq2rHUjgxzBBT 34N0pmWYa2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSbQAKCRCPgPtYfRL+ TtRlB/9a6P7/6oCcuJ5ewpHApIvsckogDp5vyXYg/1Vdd7wRyz7KWk9hsfAd1uzql8U3DEZ9PyJ YhzCiRTkTola3un5zE7tkwpPUHzIoTzNdAuvJm1bzcxiRJyxjyPaRMlzj+hw/p/5Xqzc1h6qFI/ gkF15XnsQ7luj9QvB+Q30hrylniD5q0J59t42h31Oza5yRA0mpmdH0ZkhgSvL4eZUGG1GyCGiKf yJzeCvtLBF4aWTuWWmUu6dAK/Y7Ens5y1Yc/sBZjZhP3Pf3VCMlOzB+ITA7whrfyfuRUpKDZRN9 pVNN60e340eIFj7ksb68n694QoRK4mGFqJ6zMcg04yeTZszI X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/tps65090-charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/tps65090-charger.c b/drivers/power/supply/tps65090-charger.c index f96c705e0a9f..c59197d2aa87 100644 --- a/drivers/power/supply/tps65090-charger.c +++ b/drivers/power/supply/tps65090-charger.c @@ -328,15 +328,13 @@ static int tps65090_charger_probe(struct platform_device *pdev) return ret; } -static int tps65090_charger_remove(struct platform_device *pdev) +static void tps65090_charger_remove(struct platform_device *pdev) { struct tps65090_charger *cdata = platform_get_drvdata(pdev); if (cdata->irq == -ENXIO) kthread_stop(cdata->poll_task); power_supply_unregister(cdata->ac); - - return 0; } static const struct of_device_id of_tps65090_charger_match[] = { @@ -351,7 +349,7 @@ static struct platform_driver tps65090_charger_driver = { .of_match_table = of_tps65090_charger_match, }, .probe = tps65090_charger_probe, - .remove = tps65090_charger_remove, + .remove_new = tps65090_charger_remove, }; module_platform_driver(tps65090_charger_driver); From patchwork Mon Sep 18 13:36: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: 13390018 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 9C211C46CA1 for ; Mon, 18 Sep 2023 16:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbjIRQSw (ORCPT ); Mon, 18 Sep 2023 12:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230143AbjIRQSi (ORCPT ); Mon, 18 Sep 2023 12:18:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E77F28B55 for ; Mon, 18 Sep 2023 09:16:02 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER6-0002Bi-G0; Mon, 18 Sep 2023 15:37:12 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER6-007EZf-3O; Mon, 18 Sep 2023 15:37:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER5-002fXW-Qo; Mon, 18 Sep 2023 15:37:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 26/32] power: supply: tps65217_charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:54 +0200 Message-Id: <20230918133700.1254499-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-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=hxLVxo1RDsCupUrRyCdIqyE5U8lnxZsJiBUnX7hsWtg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJurxLHNRfvvKcumNeZ+8+VZev5Xs1OgBQ5x Ele3ZvBizyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSbgAKCRCPgPtYfRL+ TlZJB/45LQrki28CSvL/Nz1r2KbXfFQvOI5E2fBtIo92tPI5yD0LqxXiUsW6b+WdCngTW/0p5yX 6Uzw9m55IH0w5hbY2cKzn4+84R5IIeRJAFjKD6tcSKAedCDQB5rkDc/3OnkS1TyheSpS7Giq+id u+9tu0eBW5gDEkVSQi88pQ6pOgHOUvHPNvGbiGCnHr0r5QhK0YCP35didlsWtHiRF2d6ZLfS4fl K/blHs0NanbsDYX4JXfk6Io9QFsR9UgUFonrXZiJrqHOl63ySF3OpPm0TvPIkm1oH6qaTbcI0Xw dW7oupK9S5ZjV+5jQsRnFMljx81pWosx4bABiv8XyGHxhZsw X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/tps65217_charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/tps65217_charger.c b/drivers/power/supply/tps65217_charger.c index 96341cbde4fa..b3a1ba326a3e 100644 --- a/drivers/power/supply/tps65217_charger.c +++ b/drivers/power/supply/tps65217_charger.c @@ -253,14 +253,12 @@ static int tps65217_charger_probe(struct platform_device *pdev) return 0; } -static int tps65217_charger_remove(struct platform_device *pdev) +static void tps65217_charger_remove(struct platform_device *pdev) { struct tps65217_charger *charger = platform_get_drvdata(pdev); if (charger->poll_task) kthread_stop(charger->poll_task); - - return 0; } static const struct of_device_id tps65217_charger_match_table[] = { @@ -271,7 +269,7 @@ MODULE_DEVICE_TABLE(of, tps65217_charger_match_table); static struct platform_driver tps65217_charger_driver = { .probe = tps65217_charger_probe, - .remove = tps65217_charger_remove, + .remove_new = tps65217_charger_remove, .driver = { .name = "tps65217-charger", .of_match_table = of_match_ptr(tps65217_charger_match_table), From patchwork Mon Sep 18 13:36: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: 13390027 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 3E0F9CD13D2 for ; Mon, 18 Sep 2023 16:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjIRQUd (ORCPT ); Mon, 18 Sep 2023 12:20:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229982AbjIRQUS (ORCPT ); Mon, 18 Sep 2023 12:20:18 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF47216D7 for ; Mon, 18 Sep 2023 09:14:33 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER6-0002Bw-MF; Mon, 18 Sep 2023 15:37:12 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER6-007EZi-9f; Mon, 18 Sep 2023 15:37:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER6-002fXa-0d; Mon, 18 Sep 2023 15:37:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 27/32] power: supply: twl4030_charger: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:55 +0200 Message-Id: <20230918133700.1254499-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2003; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=85UwmSf+vOQeEPfWwSLPmM3+kPkAsNcqdfQSv9IJGuk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJvyf2xr1r4LVWPQpcD3cPr8OxEc3ULvymU4 fF6W4Pe8TmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSbwAKCRCPgPtYfRL+ Tm8QB/4m2QPcD0SxPUIAGsCaRuplQVlcrpJ9jhK61jg8tjlUQc/H/aG14PTQx7s+V1APQ5mKTnE f7htpwcsKYwvmL7Uu8Un/f+j5fO2cdTV/i3YQbIOn2M5DV96S8aOiwM2TD6Ay5Lb+AiN+vj0G/x iOXcDG7MYLVa9DY+JVqRlQhEyXOGbM8cw6cuHMQiH56Yp8NvjpWMPttvfATvK/NRcGBLvQVQ/ZN 35w671aJB5q/LpcDW9O4/xmqfsoguvTUIlTs0/I7JCs+9BEgt7Bq0YAOsmmTeBx13Y5ZRdf8dt5 yeYtbJNaI8YeqEqpzBUbAJS6sYmmJ2rmE1epl4WFtx65spPZ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/twl4030_charger.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/supply/twl4030_charger.c index e78d061d8d32..7b9b0b3e164e 100644 --- a/drivers/power/supply/twl4030_charger.c +++ b/drivers/power/supply/twl4030_charger.c @@ -1108,7 +1108,7 @@ static int twl4030_bci_probe(struct platform_device *pdev) return 0; } -static int twl4030_bci_remove(struct platform_device *pdev) +static void twl4030_bci_remove(struct platform_device *pdev) { struct twl4030_bci *bci = platform_get_drvdata(pdev); @@ -1123,8 +1123,6 @@ static int twl4030_bci_remove(struct platform_device *pdev) TWL4030_INTERRUPTS_BCIIMR1A); twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff, TWL4030_INTERRUPTS_BCIIMR2A); - - return 0; } static const struct of_device_id twl_bci_of_match[] __maybe_unused = { @@ -1135,7 +1133,7 @@ MODULE_DEVICE_TABLE(of, twl_bci_of_match); static struct platform_driver twl4030_bci_driver = { .probe = twl4030_bci_probe, - .remove = twl4030_bci_remove, + .remove_new = twl4030_bci_remove, .driver = { .name = "twl4030_bci", .of_match_table = of_match_ptr(twl_bci_of_match), From patchwork Mon Sep 18 13:36: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: 13390078 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 412EECD13D2 for ; Mon, 18 Sep 2023 16:36:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230215AbjIRQgF (ORCPT ); Mon, 18 Sep 2023 12:36:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230261AbjIRQfk (ORCPT ); Mon, 18 Sep 2023 12:35:40 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C74F724459 for ; Mon, 18 Sep 2023 09:15:05 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER6-0002C7-S6; Mon, 18 Sep 2023 15:37:12 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER6-007EZm-Fb; Mon, 18 Sep 2023 15:37:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER6-002fXe-6f; Mon, 18 Sep 2023 15:37:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/32] power: supply: twl4030_madc_battery: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:56 +0200 Message-Id: <20230918133700.1254499-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2062; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=c7b6a/yY2cHhQhAalJOkOIPM4z4s53ZS49MhjTzEN3Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJwWoX9w3SzcTHNkAb83mg23R0vf7noeVIDt SczjDeMIXGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhScAAKCRCPgPtYfRL+ Tk7QCACjJLf472fwBGwJcK3X4nuLJoGi4Nr7HLE83jEhwrTleqIkKoEoMXnvht4D5yYL3435BMG c538WpkxgF8sESxvyDAgTww9BRwHVvPKmyOIOqSe01bCEtVU3YZ7ek7HYPdF/glE2ZUitZfHTNl EmkRme6JeyFN6SGWKGvVs3uY/4yVMfzHQSpIH2y6N3PJIQL0iJOo6J1FYEm8yZDNfRIrw3H4WSp pP/pAnDMMREskwvMzpWF+SOirPsRrh+EpbF5GUbo2RbslAvesKHzHH09oD/Hppt0+OchDdjLGS8 rrsFjtFjRLGUpHHIFRZzYD4Z65MG7EjwOGhJaXmPwFMNlkYD X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/twl4030_madc_battery.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/twl4030_madc_battery.c b/drivers/power/supply/twl4030_madc_battery.c index 7fe029673b22..33106476bea2 100644 --- a/drivers/power/supply/twl4030_madc_battery.c +++ b/drivers/power/supply/twl4030_madc_battery.c @@ -244,7 +244,7 @@ static int twl4030_madc_battery_probe(struct platform_device *pdev) return ret; } -static int twl4030_madc_battery_remove(struct platform_device *pdev) +static void twl4030_madc_battery_remove(struct platform_device *pdev) { struct twl4030_madc_battery *bat = platform_get_drvdata(pdev); @@ -253,8 +253,6 @@ static int twl4030_madc_battery_remove(struct platform_device *pdev) iio_channel_release(bat->channel_vbat); iio_channel_release(bat->channel_ichg); iio_channel_release(bat->channel_temp); - - return 0; } static struct platform_driver twl4030_madc_battery_driver = { @@ -262,7 +260,7 @@ static struct platform_driver twl4030_madc_battery_driver = { .name = "twl4030_madc_battery", }, .probe = twl4030_madc_battery_probe, - .remove = twl4030_madc_battery_remove, + .remove_new = twl4030_madc_battery_remove, }; module_platform_driver(twl4030_madc_battery_driver); From patchwork Mon Sep 18 13:36: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: 13390073 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 9BE64C46CA1 for ; Mon, 18 Sep 2023 16:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229485AbjIRQex (ORCPT ); Mon, 18 Sep 2023 12:34:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230249AbjIRQee (ORCPT ); Mon, 18 Sep 2023 12:34:34 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 917D8282BE for ; Mon, 18 Sep 2023 09:15:59 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER7-0002CP-3c; Mon, 18 Sep 2023 15:37:13 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER6-007EZq-ND; Mon, 18 Sep 2023 15:37:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER6-002fXi-Dx; Mon, 18 Sep 2023 15:37:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: patches@opensource.cirrus.com, linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 29/32] power: supply: wm831x_backup: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:57 +0200 Message-Id: <20230918133700.1254499-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1693; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=O+UPWfl8slAr0QvbbYlMXqYrxqhJnYUbTJbUZe2vRkw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJxljr+co1/s5FVcZwWtagN3k0PAa4h3abYN YkP7rzntieJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhScQAKCRCPgPtYfRL+ TovsCAC0gPEgZDQ7YISnuOGSp/U5gEpZ493oV/Qdvyc296HRPG33sUD5ToLeh/qm7IWP5WA9zQL nn7ar4kHOD1EMPXTQrfXA3ZKoDT2UN4jCIPn6sDxGzSTcmhRFLv8a0zUu0ZJpQPpOFYfYg2RvK/ njqj0FFedrENL6NWZ2ONrDOE4ycZIB7Y/pOTxi6Gnov7pqIDIaY6qdTYIZkoMu5Q0YWjXPYM/VJ kXMGGR0idH+UEtCEB9rnPEndJe4G0PzcTnZ0Kf+CqVnyQ4kKJArp7y6BxBilvJ6who9UN4GyxdS gdc0UKwVh1pyqYX1Lwc+dP6Vsy6j8qlVtzjKUFqQS3gms73g X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/wm831x_backup.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/wm831x_backup.c b/drivers/power/supply/wm831x_backup.c index ffb265b8526d..1a7265660ade 100644 --- a/drivers/power/supply/wm831x_backup.c +++ b/drivers/power/supply/wm831x_backup.c @@ -197,18 +197,16 @@ static int wm831x_backup_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(devdata->backup); } -static int wm831x_backup_remove(struct platform_device *pdev) +static void wm831x_backup_remove(struct platform_device *pdev) { struct wm831x_backup *devdata = platform_get_drvdata(pdev); power_supply_unregister(devdata->backup); - - return 0; } static struct platform_driver wm831x_backup_driver = { .probe = wm831x_backup_probe, - .remove = wm831x_backup_remove, + .remove_new = wm831x_backup_remove, .driver = { .name = "wm831x-backup", }, From patchwork Mon Sep 18 13:36: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: 13390075 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 26EC0CD13D2 for ; Mon, 18 Sep 2023 16:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230326AbjIRQfR (ORCPT ); Mon, 18 Sep 2023 12:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229937AbjIRQe4 (ORCPT ); Mon, 18 Sep 2023 12:34:56 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8AAB21AC0 for ; Mon, 18 Sep 2023 09:14:10 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER7-0002Cc-Bz; Mon, 18 Sep 2023 15:37:13 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER6-007EZv-Va; Mon, 18 Sep 2023 15:37:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER6-002fXm-MT; Mon, 18 Sep 2023 15:37:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: patches@opensource.cirrus.com, linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 30/32] power: supply: wm831x_power: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:58 +0200 Message-Id: <20230918133700.1254499-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-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=bryEUPVoOQQ2wo8mmXbRwX9lGUFBv/XUcwjw14lpV20=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJyf+duCL1WMNaTufPnU8hVa47EaXCQIy+9p lEkr0uj8GCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhScgAKCRCPgPtYfRL+ Ttr8B/9hgeMueXh3JJrYmdH1tQKYwbbsJYxUSEVxISl9vV5QDmDM3MYKRpWG+kz6wntz5mYxtgn fr7nEJoSf4BL3PKnrx4tu1z2E326/LS/2LOQ5bQPDBKvonHqkT+zy0q8qhTEkg0zhEj+m8GGXbN lfmffx3xIyFxNs1vfeEjzt8YGrM91uXpI46ZLQxR2lJEAQLe5bWfYAyGbnrXPYRclY20yCXfWnx 8D7l0MJssT9HI2D9JrM3lc1VTSTyHs7TYeUP2GD7JgGpFkjqb+S9GEgpTE3Ru1iy3u7EMLqUGTv iyrT5vBzs2qT+nelQtaI4NRORS9SSb9lqMuRT8BHhRVJE5hF X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/wm831x_power.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/wm831x_power.c b/drivers/power/supply/wm831x_power.c index 82e31066c746..e49b01ee5f3e 100644 --- a/drivers/power/supply/wm831x_power.c +++ b/drivers/power/supply/wm831x_power.c @@ -694,7 +694,7 @@ static int wm831x_power_probe(struct platform_device *pdev) return ret; } -static int wm831x_power_remove(struct platform_device *pdev) +static void wm831x_power_remove(struct platform_device *pdev) { struct wm831x_power *wm831x_power = platform_get_drvdata(pdev); struct wm831x *wm831x = wm831x_power->wm831x; @@ -722,12 +722,11 @@ static int wm831x_power_remove(struct platform_device *pdev) power_supply_unregister(wm831x_power->battery); power_supply_unregister(wm831x_power->wall); power_supply_unregister(wm831x_power->usb); - return 0; } static struct platform_driver wm831x_power_driver = { .probe = wm831x_power_probe, - .remove = wm831x_power_remove, + .remove_new = wm831x_power_remove, .driver = { .name = "wm831x-power", }, From patchwork Mon Sep 18 13:36: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: 13390077 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 7ADEAC46CA1 for ; Mon, 18 Sep 2023 16:36:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbjIRQgF (ORCPT ); Mon, 18 Sep 2023 12:36:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230249AbjIRQfk (ORCPT ); Mon, 18 Sep 2023 12:35:40 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C706D21EAD for ; Mon, 18 Sep 2023 09:14:50 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER7-0002Ct-La; Mon, 18 Sep 2023 15:37:13 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER7-007EZz-8U; Mon, 18 Sep 2023 15:37:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER6-002fXq-VN; Mon, 18 Sep 2023 15:37:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: patches@opensource.cirrus.com, linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 31/32] power: supply: wm8350_power: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:36:59 +0200 Message-Id: <20230918133700.1254499-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1844; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=gP2Nc0rlnS5gMqo9RvYkINwXnyPtzZQPMBd4Yz6KJjE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJ0rUOrLB5uvUHNwcWb7RXz/LT2wWIQ4CB9i NhBJwSh+2qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSdAAKCRCPgPtYfRL+ TsEjCACFPG+pcLnpZtSeaFFd+macuS+92b1nxNzfKuQUhfqkRB6RPnJ33k+gKst9iy5DZAmlhxK SQKkw//aFHzpGXRN4kC68FVmW7cOdQ6ZjtMlXjcMymXLtyvN8UzB7igwWXjIBvTJIjgt95dkMBN OFz2tHYNok+o/dscUfsMlg2UpjbvEjFNZ51SAWQlM39TUBBPaGITlM4EYIIfcwrkU6NewhHizNF ZD6U8E6ZWmK4bx7HL4EO+70M6KY/NExdcU0USHwXAR5NqQyMme6Qsx8M0oYM/MRBFTs4BLQZD1a b9ZEwq+GSoHJgZQcgzScLY2Y5v3p24gHkfC7oR596ztcPa9M X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/wm8350_power.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/wm8350_power.c b/drivers/power/supply/wm8350_power.c index f2786761299c..f23b4f5343bc 100644 --- a/drivers/power/supply/wm8350_power.c +++ b/drivers/power/supply/wm8350_power.c @@ -579,7 +579,7 @@ static int wm8350_power_probe(struct platform_device *pdev) return ret; } -static int wm8350_power_remove(struct platform_device *pdev) +static void wm8350_power_remove(struct platform_device *pdev) { struct wm8350 *wm8350 = platform_get_drvdata(pdev); struct wm8350_power *power = &wm8350->power; @@ -589,12 +589,11 @@ static int wm8350_power_remove(struct platform_device *pdev) power_supply_unregister(power->battery); power_supply_unregister(power->ac); power_supply_unregister(power->usb); - return 0; } static struct platform_driver wm8350_power_driver = { .probe = wm8350_power_probe, - .remove = wm8350_power_remove, + .remove_new = wm8350_power_remove, .driver = { .name = "wm8350-power", }, From patchwork Mon Sep 18 13:37: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: 13390012 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 83B19CD13D2 for ; Mon, 18 Sep 2023 16:18:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229952AbjIRQS2 (ORCPT ); Mon, 18 Sep 2023 12:18:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbjIRQSM (ORCPT ); Mon, 18 Sep 2023 12:18:12 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F7EC2444B for ; Mon, 18 Sep 2023 09:15:17 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiER7-0002Cy-SC; Mon, 18 Sep 2023 15:37:13 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiER7-007Ea2-FC; Mon, 18 Sep 2023 15:37:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiER7-002fXu-67; Mon, 18 Sep 2023 15:37:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 32/32] power: supply: wm97xx_battery: Convert to platform remove callback returning void Date: Mon, 18 Sep 2023 15:37:00 +0200 Message-Id: <20230918133700.1254499-33-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918133700.1254499-1-u.kleine-koenig@pengutronix.de> References: <20230918133700.1254499-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=86lFsZwJMSgVyKKda596lesvIVZT5K3jttAFwX2tjYQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCFJ1AGE7iQEINiuQce8oMcgQDY0qB8RaCoEzk Nfh900qMX+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQhSdQAKCRCPgPtYfRL+ TviDB/0Y2buJBBuPbVkRoR334NcCe+R5/30p6dLEmo+kOEi0+UMDOil+iBQyXGf6TrePxSz9dj6 RvC5t+s+fMZZpGzYOSdyh3UHE0Osb5sNgyEgG1nWkUZZykZuWw5Yk0tUwKdDnLIy5tU0/3oV52Y 8GPdnjnQV+tn4A8k3Ou+9GB7o8Vgg6s7USeFSsa84y5VWOzn5nGYjMODOti5jr8HqR3R9KUUFLA mPKkO/c6cUwGK+JNVuYrzfxqWFuxA9Dh6QzxJYEo2cCxarn7oOlJtKCay4IBcKRuXdLMPEQO+FK BezJzVWcqFy27YT9oaHPiXug69nCDRufM5CHI/3bdxtmfMEV X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/power/supply/wm97xx_battery.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/wm97xx_battery.c b/drivers/power/supply/wm97xx_battery.c index f4b190adb335..1cc38d1437d9 100644 --- a/drivers/power/supply/wm97xx_battery.c +++ b/drivers/power/supply/wm97xx_battery.c @@ -248,14 +248,13 @@ static int wm97xx_bat_probe(struct platform_device *dev) return ret; } -static int wm97xx_bat_remove(struct platform_device *dev) +static void wm97xx_bat_remove(struct platform_device *dev) { if (charge_gpiod) free_irq(gpiod_to_irq(charge_gpiod), dev); cancel_work_sync(&bat_work); power_supply_unregister(bat_psy); kfree(prop); - return 0; } static struct platform_driver wm97xx_bat_driver = { @@ -266,7 +265,7 @@ static struct platform_driver wm97xx_bat_driver = { #endif }, .probe = wm97xx_bat_probe, - .remove = wm97xx_bat_remove, + .remove_new = wm97xx_bat_remove, }; module_platform_driver(wm97xx_bat_driver);