From patchwork Wed Sep 27 19:37:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401574 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 6F4BFE82CCA for ; Wed, 27 Sep 2023 19:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229664AbjI0Th4 (ORCPT ); Wed, 27 Sep 2023 15:37:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjI0Thz (ORCPT ); Wed, 27 Sep 2023 15:37:55 -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 A143610A for ; Wed, 27 Sep 2023 12:37: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 1qlaLt-00026h-H9; Wed, 27 Sep 2023 21:37:41 +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 1qlaLs-009PZC-RF; Wed, 27 Sep 2023 21:37:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLs-005RfO-Ht; Wed, 27 Sep 2023 21:37:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Guillaume La Roque , Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 01/31] thermal: amlogic: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:06 +0200 Message-Id: <20230927193736.2236447-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2461; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=KxL8aBbxeG861TkwND8mWyXQYKx1VJQ+ig1ZgxFPaLE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRalZDbOoWWsVvgInsGRLaQoIOvEjn79XJqE Owea3jLoz+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEWgAKCRCPgPtYfRL+ Tui2CACKbQGRijUIxoCyJCojT3AqP+lOQDd9LzPQ/2t6lYKyiESE/O/CO7WzHbxyWh7XJWr0FpG 3SQS5HOXhfVXGggOqdQSdEERNpKZgdp+6m8KMbejXJwM3DZJdsvTOrF69Gq4akfa7onMCP/XfsW RyqQ0axmobLx7Ez7vKVFWK1eR9zgyjCC4daAytV1Wyc/YzecAB4a0Kw5wDPcdzF+XDHKAenZa4R X/GvYke2HN/ffw4f1OgiRtkdkDo9DVuOk3CWN0vxFIH3E0BAthid87UZImtjwuVtnrydzWDAyL8 1ACUuqRXEazp9lD2/dFtqKj1Ga0t0H5Jp+EIMr3JwATUfF4h 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() will be renamed to .remove(). amlogic_thermal_disable() always returned zero. Change it to return no value and then trivially convert the driver to .remove_new() and fix a whitespace inconsitency en passant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/amlogic_thermal.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c index 81ebbf6de0de..1426f1eb4ac6 100644 --- a/drivers/thermal/amlogic_thermal.c +++ b/drivers/thermal/amlogic_thermal.c @@ -167,13 +167,11 @@ static int amlogic_thermal_enable(struct amlogic_thermal *data) return 0; } -static int amlogic_thermal_disable(struct amlogic_thermal *data) +static void amlogic_thermal_disable(struct amlogic_thermal *data) { regmap_update_bits(data->regmap, TSENSOR_CFG_REG1, TSENSOR_CFG_REG1_ENABLE, 0); clk_disable_unprepare(data->clk); - - return 0; } static int amlogic_thermal_get_temp(struct thermal_zone_device *tz, int *temp) @@ -291,11 +289,11 @@ static int amlogic_thermal_probe(struct platform_device *pdev) return ret; } -static int amlogic_thermal_remove(struct platform_device *pdev) +static void amlogic_thermal_remove(struct platform_device *pdev) { struct amlogic_thermal *data = platform_get_drvdata(pdev); - return amlogic_thermal_disable(data); + amlogic_thermal_disable(data); } static int __maybe_unused amlogic_thermal_suspend(struct device *dev) @@ -321,8 +319,8 @@ static struct platform_driver amlogic_thermal_driver = { .pm = &amlogic_thermal_pm_ops, .of_match_table = of_amlogic_thermal_match, }, - .probe = amlogic_thermal_probe, - .remove = amlogic_thermal_remove, + .probe = amlogic_thermal_probe, + .remove_new = amlogic_thermal_remove, }; module_platform_driver(amlogic_thermal_driver); From patchwork Wed Sep 27 19:37:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401578 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 51412E82CCD for ; Wed, 27 Sep 2023 19:37:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229693AbjI0Th6 (ORCPT ); Wed, 27 Sep 2023 15:37:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjI0Th5 (ORCPT ); Wed, 27 Sep 2023 15:37:57 -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 9F0A111F for ; Wed, 27 Sep 2023 12:37:55 -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 1qlaLt-00026i-Iw; Wed, 27 Sep 2023 21:37:41 +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 1qlaLt-009PZF-3X; Wed, 27 Sep 2023 21:37:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLs-005RfR-QZ; Wed, 27 Sep 2023 21:37:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Miquel Raynal , Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/31] thermal: armada: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:07 +0200 Message-Id: <20230927193736.2236447-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1733; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=k+cR4OPobg88HU9itjRWNVwx8qVomsKJ09hasuCJL0I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRbLarsQFzS63vMzFY/zL8jaFgO498NNYF1z tM2UR06sBaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEWwAKCRCPgPtYfRL+ Tu1sB/4hT8sjotozHbTpWN+m1OB6dz6CUNhst9A1akTsYEJdFn2DgmRjAMQWuEizUFjnE+OGa4m 5uF+kFk99k7pvSpEPxqCBDNlnCfLLWG65c4zgZpCGFtb+xaKE4Yk7eZz/QyGFZ1L61pDjLLAOh0 HnrbmueWh1B1t75Vh9yfZxh1W3Jqtk3sKYa300VVTXV/kF375bnMW7/G1+5Q+5r4YRUaj0Uh26w CHYz6IIe2V5I0GtmZ+GaL3B5kV1Gv16vkfA9eQEyNvrNDIOMNF844l3uw7X8+7ljnauk9J+8Eg+ 735l5jQzMpIV3cJV9DY4AwECAveK/chs1MIBRrJczNJKjN1U 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Miquel Raynal --- drivers/thermal/armada_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index f00765bfc22e..f783547ef964 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -965,19 +965,17 @@ static int armada_thermal_probe(struct platform_device *pdev) return 0; } -static int armada_thermal_exit(struct platform_device *pdev) +static void armada_thermal_exit(struct platform_device *pdev) { struct armada_drvdata *drvdata = platform_get_drvdata(pdev); if (drvdata->type == LEGACY) thermal_zone_device_unregister(drvdata->data.tz); - - return 0; } static struct platform_driver armada_thermal_driver = { .probe = armada_thermal_probe, - .remove = armada_thermal_exit, + .remove_new = armada_thermal_exit, .driver = { .name = "armada_thermal", .of_match_table = armada_thermal_id_table, From patchwork Wed Sep 27 19:37:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401580 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 88FE5E82CD0 for ; Wed, 27 Sep 2023 19:37:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229542AbjI0Th7 (ORCPT ); Wed, 27 Sep 2023 15:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbjI0Th5 (ORCPT ); Wed, 27 Sep 2023 15:37:57 -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 3791C10A for ; Wed, 27 Sep 2023 12:37: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 1qlaLw-00026y-Cr; Wed, 27 Sep 2023 21:37:44 +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 1qlaLt-009PZI-EU; Wed, 27 Sep 2023 21:37:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLt-005RfW-4t; Wed, 27 Sep 2023 21:37:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , =?utf-8?q?Niklas_S=C3=B6derlund?= , Heiko Stuebner , ye xingchen , linux-pm@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 03/31] thermal: bcm2835: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:08 +0200 Message-Id: <20230927193736.2236447-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1809; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mrALM6qMnmHhWZoKy0F69WBqe/XuYMYedWrmudsZUqo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRdE6wLKka4fdO+P0tIZxesogf3l4sCjbioo yIfEHDExFSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEXQAKCRCPgPtYfRL+ Tp2IB/9K+MjPjnKRK1IUoJhUwqcl5NH1VGINJX8gAEXqyT9S2nA2kHt8l07hCJJfVEB3LeayKuh zpZrjHwrAND+0AhihvehBm+xEftXsZV/he6mnZUxpU7karV8YE2eMcfH36YPUMPRhNpvWkXRXjE Ac6wzHvf1v4EsxJxXM7woLQiWVmGCs95m4jSTyTm2/rcV/1vPSqoQH9QV5/kmDbD87EAjpwlNgC stJfmo9oIqz/DHt6D/JRErzDNc4qCzcRCnQTF+t7Xwsu6+A8z+Ye3meTg0sIRFI8MOUBIW4l59V DV+LgYMYnf6RiPq9MWB+C6XuE2c135aFkum3bmbCToCuv/Tt 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/broadcom/bcm2835_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c index 3acc9288b310..5c1cebe07580 100644 --- a/drivers/thermal/broadcom/bcm2835_thermal.c +++ b/drivers/thermal/broadcom/bcm2835_thermal.c @@ -282,19 +282,17 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) return err; } -static int bcm2835_thermal_remove(struct platform_device *pdev) +static void bcm2835_thermal_remove(struct platform_device *pdev) { struct bcm2835_thermal_data *data = platform_get_drvdata(pdev); debugfs_remove_recursive(data->debugfsdir); clk_disable_unprepare(data->clk); - - return 0; } static struct platform_driver bcm2835_thermal_driver = { .probe = bcm2835_thermal_probe, - .remove = bcm2835_thermal_remove, + .remove_new = bcm2835_thermal_remove, .driver = { .name = "bcm2835_thermal", .of_match_table = bcm2835_thermal_of_match_table, From patchwork Wed Sep 27 19:37:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401582 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 38776E82CCA for ; Wed, 27 Sep 2023 19:38:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbjI0TiA (ORCPT ); Wed, 27 Sep 2023 15:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229730AbjI0Th6 (ORCPT ); Wed, 27 Sep 2023 15:37:58 -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 C0127122 for ; Wed, 27 Sep 2023 12:37: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 1qlaLv-000272-7k; Wed, 27 Sep 2023 21:37:43 +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 1qlaLt-009PZM-Lb; Wed, 27 Sep 2023 21:37:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLt-005Rfa-C2; Wed, 27 Sep 2023 21:37:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Balsam CHIHI , Adam Ward , Kunihiko Hayashi , AngeloGioacchino Del Regno , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/31] thermal: ns: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:09 +0200 Message-Id: <20230927193736.2236447-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-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=2zYvLzrABKf6jXG7bIZewjyas0BWPRAylGAatEx38xc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRe/J8pIPrn0369YrBYdl3PMV+GqUV5RjvN4 DWTEkPbLNKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEXgAKCRCPgPtYfRL+ TiPEB/9pdVpY2EeyM+V8i4wzexrx2BREcMMzRjevN169UpS2RSUs2vPi/ap0U2TkMRvUn5AMJX1 ziFhH7VkeEutDuDQqPLBRqZs0z1cJCHR54jKrVPSvQvYK7Q4/I6ziMZWPhSgPtSnBogADVLGTJA oCHGJxRZfHbHY/NgiklT/fctn2Af5K6a9e0p8Ouwls4tbZJXbYa6xD56QLdDcJFGcoP5gWwKnor jks8KQrm258wJWXWeZLKTMlcwA2tXxSDRWsek1xIqlirUuakOwyHsZ+TxcMUYY93qas9S7MbYMm kPiVTF7AdR5Gh751OEhg07Ov5bj2GaxHiy6JV+X7vzSjUQLM 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/broadcom/ns-thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/broadcom/ns-thermal.c b/drivers/thermal/broadcom/ns-thermal.c index d255aa879fc0..5eaf79c490f0 100644 --- a/drivers/thermal/broadcom/ns-thermal.c +++ b/drivers/thermal/broadcom/ns-thermal.c @@ -65,13 +65,11 @@ static int ns_thermal_probe(struct platform_device *pdev) return 0; } -static int ns_thermal_remove(struct platform_device *pdev) +static void ns_thermal_remove(struct platform_device *pdev) { void __iomem *pvtmon = platform_get_drvdata(pdev); iounmap(pvtmon); - - return 0; } static const struct of_device_id ns_thermal_of_match[] = { @@ -82,7 +80,7 @@ MODULE_DEVICE_TABLE(of, ns_thermal_of_match); static struct platform_driver ns_thermal_driver = { .probe = ns_thermal_probe, - .remove = ns_thermal_remove, + .remove_new = ns_thermal_remove, .driver = { .name = "ns-thermal", .of_match_table = ns_thermal_of_match, From patchwork Wed Sep 27 19:37:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401576 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 4E27EE82CCC for ; Wed, 27 Sep 2023 19:37:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229595AbjI0Th5 (ORCPT ); Wed, 27 Sep 2023 15:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjI0Th4 (ORCPT ); Wed, 27 Sep 2023 15:37: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 274B0114 for ; Wed, 27 Sep 2023 12:37:54 -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 1qlaLu-000273-Lk; Wed, 27 Sep 2023 21:37:42 +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 1qlaLt-009PZQ-U1; Wed, 27 Sep 2023 21:37:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLt-005Rfe-KT; Wed, 27 Sep 2023 21:37:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Support Opensource , Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/31] thermal: da9062: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:10 +0200 Message-Id: <20230927193736.2236447-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1791; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7YtKZQkT5oSffBLlg7apf/UmsPAwRfzLo7tOsDSSduQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRfm6R5vg+T3vI1QuOBs2yJvM/CHF2/PefT7 l+JIntDIlKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEXwAKCRCPgPtYfRL+ TiLwB/4xlNtIrd4d33pWnvwWOximzbp30nbhhwI27Eo+438wQAJg3B+RIkxXiF9WaIYmqXriz7M DhrdU4p6J+3/iHHHyNtsH4sxPmsRt9U8oNrG1YkGMYMOnbnYsBvs5jLQtfN0BV1Yxd6TOhC86MT AmX9T2oKN8DdpbiczZSmTJR2GSDOx11eKBOBjmqKFuA1JIP8vkVwCpA1/FdC0w0bihru+fMacyX 4XibD+OcrlAgK6I7CgGydr/E1IxhIjeIcV9m5rJ5+bOk6qecihnIzER9aoM5YRdu71R7GXMpuG5 dYisTyX6sBK47FzdtSa9PCLIzAI76lXCf83zEH4Azoiyi66e 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/da9062-thermal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/da9062-thermal.c b/drivers/thermal/da9062-thermal.c index 2d31b1f73423..160d64913057 100644 --- a/drivers/thermal/da9062-thermal.c +++ b/drivers/thermal/da9062-thermal.c @@ -239,19 +239,18 @@ static int da9062_thermal_probe(struct platform_device *pdev) return ret; } -static int da9062_thermal_remove(struct platform_device *pdev) +static void da9062_thermal_remove(struct platform_device *pdev) { struct da9062_thermal *thermal = platform_get_drvdata(pdev); free_irq(thermal->irq, thermal); cancel_delayed_work_sync(&thermal->work); thermal_zone_device_unregister(thermal->zone); - return 0; } static struct platform_driver da9062_thermal_driver = { .probe = da9062_thermal_probe, - .remove = da9062_thermal_remove, + .remove_new = da9062_thermal_remove, .driver = { .name = "da9062-thermal", .of_match_table = da9062_compatible_reg_id_table, From patchwork Wed Sep 27 19:37:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401577 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 EBA50E82CC9 for ; Wed, 27 Sep 2023 19:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbjI0Th5 (ORCPT ); Wed, 27 Sep 2023 15:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjI0Th4 (ORCPT ); Wed, 27 Sep 2023 15:37: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 AC3F510E for ; Wed, 27 Sep 2023 12:37: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 1qlaLu-00027A-Iv; Wed, 27 Sep 2023 21:37:42 +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 1qlaLu-009PZT-6B; Wed, 27 Sep 2023 21:37:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLt-005Rfi-TI; Wed, 27 Sep 2023 21:37:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/31] thermal: dove: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:11 +0200 Message-Id: <20230927193736.2236447-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1735; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=EAkFNl1fc/YmI3QCP9+RtHS7shH8VnrEQhLEqsWWxlk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRguQKEgRCnyw8rFT0coBXVUfE9cID6EoujY n/Hc42M9leJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEYAAKCRCPgPtYfRL+ Toz4B/4lGmiuzTkHx/q+ASJRYpPRsv0QhVGwioVNgg0aY4IF8ML9V9hGrVF+lRU0JNPZEl5ioXx fMHf3AT24w9pFh8WWASfYiy6QBV0yUciRoozbZDjZNsmblvwet0Ds56hs6jBg4VliaIj1ew5JDr akqRRQnQbx9htls4inM7usFx1KUsVRTOvBospjJiHzF2EGlNLw3HxsbnB8Jt2TUghtyGhb5Et9D lgOISHwrM2Mjwx0zpVSqQzo66ZJ/Q1/vrm6Bg+qz9KVIaaIovyXnAaoT3y+RgkkIquid7gIqAWG xPNNXTaDHwpFpWQTs66iOiTn06I/GUQ321kNcf9HyImiL10r 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/dove_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c index 7a18cb960bee..ac30de3c0a5f 100644 --- a/drivers/thermal/dove_thermal.c +++ b/drivers/thermal/dove_thermal.c @@ -158,21 +158,19 @@ static int dove_thermal_probe(struct platform_device *pdev) return 0; } -static int dove_thermal_exit(struct platform_device *pdev) +static void dove_thermal_exit(struct platform_device *pdev) { struct thermal_zone_device *dove_thermal = platform_get_drvdata(pdev); thermal_zone_device_unregister(dove_thermal); - - return 0; } MODULE_DEVICE_TABLE(of, dove_thermal_id_table); static struct platform_driver dove_thermal_driver = { .probe = dove_thermal_probe, - .remove = dove_thermal_exit, + .remove_new = dove_thermal_exit, .driver = { .name = "dove_thermal", .of_match_table = dove_thermal_id_table, From patchwork Wed Sep 27 19:37:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401575 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 BAA44E82CCB for ; Wed, 27 Sep 2023 19:37:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbjI0Th5 (ORCPT ); Wed, 27 Sep 2023 15:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjI0Th5 (ORCPT ); Wed, 27 Sep 2023 15:37:57 -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 CF723CC for ; Wed, 27 Sep 2023 12:37:55 -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 1qlaLu-00027H-Qj; Wed, 27 Sep 2023 21:37:42 +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 1qlaLu-009PZW-Dm; Wed, 27 Sep 2023 21:37:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLu-005Rfm-4b; Wed, 27 Sep 2023 21:37:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/31] thermal: hisi: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:12 +0200 Message-Id: <20230927193736.2236447-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1896; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=QmkKyypbaL25qUAD74DdVSveNBNJDigGxuX69c03uAM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRhdJhjpYZR24BNIW35/To8PLOzEFFmiz3F2 +D1VI4x48WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEYQAKCRCPgPtYfRL+ Tp/JB/wK3cgQw9hHd01JPb1pXOaDv7jLce+nK+2EFd294Lfo8TWbs7HC9gO5mB13YI9F8kGiNMn r8EEiC2/CKjVh43fMEdg4tMpLxHJUWa6utqMfv+t3MX+Nb0LDezyE/7mxcV1nafiMq9a//zaMQb Uqdz2XEboCANOrpmZnrovmnHrXoDk6/IoGJ+W546lRbI4l8q4j4GaJnlRobjng+Q3IGMo+gJcSl FAqd70xhZqeJqVbYSt6pHwquQhyrCrQ1A9okg0/ELCBTSEQXuLSnmvmNY+leGBqsGmHiXB3ealu mScoVkYBeiVmJmfO2+E10+CSnImwzVBQ/Q5p21AO01xcE1/H 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/hisi_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index fb54ed4bf6f0..dd751ae63608 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -597,7 +597,7 @@ static int hisi_thermal_probe(struct platform_device *pdev) return 0; } -static int hisi_thermal_remove(struct platform_device *pdev) +static void hisi_thermal_remove(struct platform_device *pdev) { struct hisi_thermal_data *data = platform_get_drvdata(pdev); int i; @@ -608,8 +608,6 @@ static int hisi_thermal_remove(struct platform_device *pdev) hisi_thermal_toggle_sensor(sensor, false); data->ops->disable_sensor(sensor); } - - return 0; } static int hisi_thermal_suspend(struct device *dev) @@ -644,7 +642,7 @@ static struct platform_driver hisi_thermal_driver = { .of_match_table = of_hisi_thermal_match, }, .probe = hisi_thermal_probe, - .remove = hisi_thermal_remove, + .remove_new = hisi_thermal_remove, }; module_platform_driver(hisi_thermal_driver); From patchwork Wed Sep 27 19:37:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401592 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 12AABE82CCE for ; Wed, 27 Sep 2023 19:38:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbjI0TiF (ORCPT ); Wed, 27 Sep 2023 15:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbjI0TiA (ORCPT ); Wed, 27 Sep 2023 15:38:00 -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 42973139 for ; Wed, 27 Sep 2023 12:37: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 1qlaLv-0002Aw-GC; Wed, 27 Sep 2023 21:37:43 +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 1qlaLu-009PZc-Ux; Wed, 27 Sep 2023 21:37:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLu-005Rfr-LO; Wed, 27 Sep 2023 21:37:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 08/31] thermal: imx8mm: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:13 +0200 Message-Id: <20230927193736.2236447-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1840; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mUVyEMnm1z5iVRPYVpjWfXu3Ft1PVpLLqrBfbq28meA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRimN4YY928mB2BDyqjnqj0MdvP+cByGi+40 MxtR705+bSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEYgAKCRCPgPtYfRL+ TibAB/4kXSqElf3s/rvsJAV/HXqK7GgX1K6Qd9U5yi6HdIbIPw95pKlXIzCXGKI1X5Kd67KqwJe tnHyIfuObiJ9gfUiX28z/XzNQpy2HmyMAYRItl21TEPzsQ0H3pLXpZeRA9RBWVsshSIJUdgH1iT Jym7SQvBOnW7RvUdhLlDxACBMvEkiva+1ai1u8a808Qel7gttnjmD9koDeoBksR1bGRXoJvPlHs pz8mLrj1e3Q7UMqaKPymfWzhborzru/uIf4Yi8RYUsdREXIjfzQ/bOZ83Ge0OwI0SqGKE6Q2Xmg hjlanfriowamc5XmpiW6QJkxp1UZ+gJo3Ic6//rFyGSj7rZE 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/imx8mm_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c index 14111ccf6e4c..c58fc73c0744 100644 --- a/drivers/thermal/imx8mm_thermal.c +++ b/drivers/thermal/imx8mm_thermal.c @@ -363,7 +363,7 @@ static int imx8mm_tmu_probe(struct platform_device *pdev) return ret; } -static int imx8mm_tmu_remove(struct platform_device *pdev) +static void imx8mm_tmu_remove(struct platform_device *pdev) { struct imx8mm_tmu *tmu = platform_get_drvdata(pdev); @@ -372,8 +372,6 @@ static int imx8mm_tmu_remove(struct platform_device *pdev) clk_disable_unprepare(tmu->clk); platform_set_drvdata(pdev, NULL); - - return 0; } static struct thermal_soc_data imx8mm_tmu_data = { @@ -401,7 +399,7 @@ static struct platform_driver imx8mm_tmu = { .of_match_table = imx8mm_tmu_table, }, .probe = imx8mm_tmu_probe, - .remove = imx8mm_tmu_remove, + .remove_new = imx8mm_tmu_remove, }; module_platform_driver(imx8mm_tmu); From patchwork Wed Sep 27 19:37:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401600 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 C19F9E82CCD for ; Wed, 27 Sep 2023 19:38:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbjI0TiI (ORCPT ); Wed, 27 Sep 2023 15:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjI0TiC (ORCPT ); Wed, 27 Sep 2023 15:38:02 -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 4A9E410A for ; Wed, 27 Sep 2023 12:38:01 -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 1qlaLv-0002CW-J0; Wed, 27 Sep 2023 21:37:43 +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 1qlaLv-009PZf-51; Wed, 27 Sep 2023 21:37:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLu-005Rfu-Rv; Wed, 27 Sep 2023 21:37:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 09/31] thermal: imx: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:14 +0200 Message-Id: <20230927193736.2236447-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1882; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=JIWgWjgQcxgcUmIkvSyFyRNOcjLHVmKSuDCyFZytSL8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRj/ojjGoHgLu5uTEzEedFMFbaMLXPjjc+N+ yB48Vp94meJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEYwAKCRCPgPtYfRL+ TseECACK1Dapmfvvg61W64yGE8V/OV71ykkTIYQ4QW3nV4wqwLhS4e47wl++3nX/YXPxJO9VfZt 2ciwZQBLjMgFc+1LZpshvjOdd7ZZxa7lmxXenvegURTs9vrGUFpW95VmsxgUlbMdtA3jEgqKxLn Ek14ocbZuVQZUoS56kYB2H4c6GpjK7iYasLmAmHVsvGI/GYP/qlDQrCVo5fILlxXDygJiuC7DQp JT3zRtU1K5fmH+WSJoXUJhLjLzen44rw5I6w5LPu5S6TwisAMm9Uxv+hXPfR++ypy9CfUFFlxd1 SMzlh+SWhHoAfjY6hxn1FNs3JlvyqXWygmFaN6OdZ6Ksm5m6 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/imx_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 826358cbe810..7019c4fdd549 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -771,7 +771,7 @@ static int imx_thermal_probe(struct platform_device *pdev) return ret; } -static int imx_thermal_remove(struct platform_device *pdev) +static void imx_thermal_remove(struct platform_device *pdev) { struct imx_thermal_data *data = platform_get_drvdata(pdev); @@ -780,8 +780,6 @@ static int imx_thermal_remove(struct platform_device *pdev) thermal_zone_device_unregister(data->tz); imx_thermal_unregister_legacy_cooling(data); - - return 0; } static int __maybe_unused imx_thermal_suspend(struct device *dev) @@ -880,7 +878,7 @@ static struct platform_driver imx_thermal = { .of_match_table = of_imx_thermal_match, }, .probe = imx_thermal_probe, - .remove = imx_thermal_remove, + .remove_new = imx_thermal_remove, }; module_platform_driver(imx_thermal); From patchwork Wed Sep 27 19:37:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401601 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 C9C4DE82CCC for ; Wed, 27 Sep 2023 19:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbjI0TiJ (ORCPT ); Wed, 27 Sep 2023 15:38:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbjI0TiD (ORCPT ); Wed, 27 Sep 2023 15:38:03 -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 14E80CC for ; Wed, 27 Sep 2023 12:38: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 1qlaLw-0002DA-Cg; Wed, 27 Sep 2023 21:37:44 +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 1qlaLv-009PZj-C3; Wed, 27 Sep 2023 21:37:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLv-005Rfy-2g; Wed, 27 Sep 2023 21:37:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Srinivas Pandruvada , Adam Ward , AngeloGioacchino Del Regno , ye xingchen , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 10/31] thermal: int3400: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:15 +0200 Message-Id: <20230927193736.2236447-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2080; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=f0MASzDeVV0lv01QW50AMw5AQhSIzo7HQTfPqf3ZhaY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRkLIyiscMczvVQql5OsuUI5jhaUc5Mo7sSf 9mTlfJo5KOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEZAAKCRCPgPtYfRL+ TopJB/9rnPwJgyr5kvkdz6m9plvhiJMgXla6mxdZ8vA4GFqvu8CTIOLqS1wSOoEey7oqKYrMLq/ 3sW1FzUMW0HG9dzagQdJyTbaSCqnueiZ5hvVG1USnCTHdZ3M5oAhwjwmrmjZ0QG+NfCK339WPOC zd4+AtqPkUEiMvO8fh64Uv17EjYgIjvVMzHCWRxW1R88iry9ewKMVlqi8Czh3O4Yw9Z8hIZjt79 LQIAWJ0KlxXBNVitnQW4FriseVYuhqQdysKdnQ9818/s1+XKN5FJk4ZpAmOck9Aav+m0Dc5E5jz ASPX7Oqs1cUA0y6C8st3EudRfyPNW4/xIhc9KqMHIx3D8gOS 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index ffc2871a021c..427d370648d5 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -674,7 +674,7 @@ static int int3400_thermal_probe(struct platform_device *pdev) return result; } -static int int3400_thermal_remove(struct platform_device *pdev) +static void int3400_thermal_remove(struct platform_device *pdev) { struct int3400_thermal_priv *priv = platform_get_drvdata(pdev); @@ -698,7 +698,6 @@ static int int3400_thermal_remove(struct platform_device *pdev) kfree(priv->trts); kfree(priv->arts); kfree(priv); - return 0; } static const struct acpi_device_id int3400_thermal_match[] = { @@ -714,7 +713,7 @@ MODULE_DEVICE_TABLE(acpi, int3400_thermal_match); static struct platform_driver int3400_thermal_driver = { .probe = int3400_thermal_probe, - .remove = int3400_thermal_remove, + .remove_new = int3400_thermal_remove, .driver = { .name = "int3400 thermal", .acpi_match_table = ACPI_PTR(int3400_thermal_match), From patchwork Wed Sep 27 19:37:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401588 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 E728FE82CD5 for ; Wed, 27 Sep 2023 19:38:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229800AbjI0TiD (ORCPT ); Wed, 27 Sep 2023 15:38:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbjI0TiA (ORCPT ); Wed, 27 Sep 2023 15:38:00 -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 D596111D for ; Wed, 27 Sep 2023 12:37:58 -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 1qlaLw-0002Dh-I1; Wed, 27 Sep 2023 21:37:44 +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 1qlaLv-009PZn-L2; Wed, 27 Sep 2023 21:37:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLv-005Rg2-Ax; Wed, 27 Sep 2023 21:37:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Yang Yingliang , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/31] thermal: int3401: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:16 +0200 Message-Id: <20230927193736.2236447-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1821; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=UeGDT0K7i3XheaJm4DPj9aGXN9/Y6aWaPEkQl4E5+Ls=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRlLtgRHsULkOjfm7hyz+66FcsCRJTZr0TTA mKsnrQe5fKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEZQAKCRCPgPtYfRL+ TvjAB/9X+ytYe+0Bu9f5vo/Tzd+s+nLpGck/vN6SiFoN/QOvxjnLNr8ZXZ1/lC7I4BgyNRRcapL NHkCiEOk8ZnG4/ZGSc3CMbnINNq61R7t2QEIXDzA95BDn2jQ7KuZ+bxVmqhEJd/1H2cH8przbyP UefFdNRNO9UjR5hHRWnK3KZjNLq3B1Hgxw9H8DfHD259C/e9xRP7fTmJcTixHCu8XB8cH5kMn3J XHUvok9wxWLvgSzGSya/8WaAb32uTVN0XFPL9cuFp1hxHkxPHfwwaH8ZMoEHxf8UshgDUtKymP6 yBbnlairffc1VMg90sVg7saZZ8zZlf0IUc5j4IP1S5KwS6Mh 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/intel/int340x_thermal/int3401_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3401_thermal.c b/drivers/thermal/intel/int340x_thermal/int3401_thermal.c index c93a28eec4db..193645a73861 100644 --- a/drivers/thermal/intel/int340x_thermal/int3401_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3401_thermal.c @@ -36,11 +36,9 @@ static int int3401_add(struct platform_device *pdev) return ret; } -static int int3401_remove(struct platform_device *pdev) +static void int3401_remove(struct platform_device *pdev) { proc_thermal_remove(platform_get_drvdata(pdev)); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -62,7 +60,7 @@ static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, int3401_thermal_suspend, static struct platform_driver int3401_driver = { .probe = int3401_add, - .remove = int3401_remove, + .remove_new = int3401_remove, .driver = { .name = "int3401 thermal", .acpi_match_table = int3401_device_ids, From patchwork Wed Sep 27 19:37:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401585 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 5D672E82CD2 for ; Wed, 27 Sep 2023 19:38:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229789AbjI0TiC (ORCPT ); Wed, 27 Sep 2023 15:38:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjI0Th7 (ORCPT ); Wed, 27 Sep 2023 15:37:59 -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 350EB10A for ; Wed, 27 Sep 2023 12:37:58 -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 1qlaLw-0002F8-M5; Wed, 27 Sep 2023 21:37:44 +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 1qlaLw-009PZr-9L; Wed, 27 Sep 2023 21:37:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLw-005Rg7-0D; Wed, 27 Sep 2023 21:37:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/31] thermal: int3402: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:17 +0200 Message-Id: <20230927193736.2236447-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2055; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qoMLAjTRS9n8eyX+9x9h12/oeNtnXaQblOJdaPK8n74=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSRlnSNI3Vu7H6Hb6nHzJxhd8Va/+rHf3evGLAU2r+Tf ph1KMmhk9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJMDGy/3fsWDUjqCPmUsHm nzp61nY+W1xjeJbP0zdJTwntOKFkHu7hW3FUpYmrV8Cup1U6IEbz8+ywrl6LCQdTlW6GiS/609I j1Me8Omla2xz/lDCO+ma3k6bfWRVy2VcbMlvk//xnPCnQ5cXNzZ+3+OqrPGYUcpFpXT9lzrLq68 eWrNxQlvx0jp9z9PS5vi0b+Cws/MMP/jgsyrRII8hB4+0nl63To/IXrb3efOHJvP6n5cm9099x/ XipcmyOehrb7xsyXyLn+4pW1Iny6pTt8a3itO9MDd+fcffA7JnzopU0ZHYsk07KncHap/aoS4yj cNEjAQOnlHO7+e+36ldo7lLLcpq05vqqbPcG/4q0+lUA 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/intel/int340x_thermal/int3402_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3402_thermal.c b/drivers/thermal/intel/int340x_thermal/int3402_thermal.c index 43fa351e2b9e..ab8bfb5a3946 100644 --- a/drivers/thermal/intel/int340x_thermal/int3402_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3402_thermal.c @@ -71,15 +71,13 @@ static int int3402_thermal_probe(struct platform_device *pdev) return 0; } -static int int3402_thermal_remove(struct platform_device *pdev) +static void int3402_thermal_remove(struct platform_device *pdev) { struct int3402_thermal_data *d = platform_get_drvdata(pdev); acpi_remove_notify_handler(d->handle, ACPI_DEVICE_NOTIFY, int3402_notify); int340x_thermal_zone_remove(d->int340x_zone); - - return 0; } static const struct acpi_device_id int3402_thermal_match[] = { @@ -91,7 +89,7 @@ MODULE_DEVICE_TABLE(acpi, int3402_thermal_match); static struct platform_driver int3402_thermal_driver = { .probe = int3402_thermal_probe, - .remove = int3402_thermal_remove, + .remove_new = int3402_thermal_remove, .driver = { .name = "int3402 thermal", .acpi_match_table = int3402_thermal_match, From patchwork Wed Sep 27 19:37:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401579 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 5622EE82CC3 for ; Wed, 27 Sep 2023 19:38:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229718AbjI0Th7 (ORCPT ); Wed, 27 Sep 2023 15:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbjI0Th5 (ORCPT ); Wed, 27 Sep 2023 15:37:57 -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 87AE110E for ; Wed, 27 Sep 2023 12:37: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 1qlaLw-0002FY-U3; Wed, 27 Sep 2023 21:37:44 +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 1qlaLw-009PZw-H0; Wed, 27 Sep 2023 21:37:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLw-005RgA-7r; Wed, 27 Sep 2023 21:37:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 13/31] thermal: int3403: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:18 +0200 Message-Id: <20230927193736.2236447-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-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=0MerhQGmDalitZpdulcdstr9gjkd2p4h+XjoTEa6GN0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRoUOsjQ5pl73YSi1sV0vZM8JZK1SdtZ644i /MVv8RdhFeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEaAAKCRCPgPtYfRL+ TqiGB/9tige5jRnAmDkMWylbI6qJUnAkD6Fe5/+B44s70pI8tvdxtwooZClOjyrBKBcj2vUjdJ+ s2uIaKopgwDplg5Sxu1taTQwvE57B6JHR45O52a0bREUKhq7Njj8gaB4PlXJjq56svYcSlpT3jH vuCwU3gl8K8WWXshB7Beedm0QkueExXNK8HhQSCzcWOr3lM82BL3Bi+71Z/tuWTwyF5yVU0m7n/ CyNl0haQXTH/bpamOVxwRQUaWAMOBiDGceHEiR8wGosdwTJ1gBBGwwiurCP0e+hnOqxwX51D7Q6 usLb7LMX1pbnIJb7Z+ilv12hP4Yhv0ZXBYN37CkuVURJGbj/ 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/intel/int340x_thermal/int3403_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c index e418d270bc76..9b33fd3a66da 100644 --- a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c @@ -262,7 +262,7 @@ static int int3403_add(struct platform_device *pdev) return result; } -static int int3403_remove(struct platform_device *pdev) +static void int3403_remove(struct platform_device *pdev) { struct int3403_priv *priv = platform_get_drvdata(pdev); @@ -277,8 +277,6 @@ static int int3403_remove(struct platform_device *pdev) default: break; } - - return 0; } static const struct acpi_device_id int3403_device_ids[] = { @@ -293,7 +291,7 @@ MODULE_DEVICE_TABLE(acpi, int3403_device_ids); static struct platform_driver int3403_driver = { .probe = int3403_add, - .remove = int3403_remove, + .remove_new = int3403_remove, .driver = { .name = "int3403 thermal", .acpi_match_table = int3403_device_ids, From patchwork Wed Sep 27 19:37:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401573 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 F29C1E82CC3 for ; Wed, 27 Sep 2023 19:37:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbjI0Th4 (ORCPT ); Wed, 27 Sep 2023 15:37:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjI0Thz (ORCPT ); Wed, 27 Sep 2023 15:37:55 -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 5FAF5CC for ; Wed, 27 Sep 2023 12:37: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 1qlaLx-0002Fi-Bc; Wed, 27 Sep 2023 21:37:45 +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 1qlaLw-009Pa1-QR; Wed, 27 Sep 2023 21:37:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLw-005RgE-F9; Wed, 27 Sep 2023 21:37:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/31] thermal: int3406: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:19 +0200 Message-Id: <20230927193736.2236447-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1996; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=38pQq7c1wKdStSvs0CLs7r4P6x0wTD05tIJKtm/oIFw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRplBx8Fvb7CKnsPxN7q8iOHOQGwGYqhpIRu SqVAwAOwUeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEaQAKCRCPgPtYfRL+ Tq3RB/41DFMY7/SVJNrsBUjxV4WP7UpPqPQ4qaDswsAWB3wusNRWigfNFYZwWC0jXWSmXhMiE71 US2J7CUDxxXg9u2Q74CGbMmIiFmAQSR2HCGVMEW+ZTair942U0X+zU/9jJk1xc9+6Plia3HfylT gQ3DnUoUzY0ppREZlU1N83dqSVhcaqckTiysQcYSr9SFKnQKhlmYiPIJ4ZQxPcBnZoTDqbI1P2z swiC6FsQW35+E/UZS+3e4gpIZSroY1QiEe1FpE2IvzukOYQ40oqy/hcFJuLOHnIK8iYtnNKPh+P ta2jbHrSp5nZhN4RYKou8VBnUoHC8X3R5l7r0v/WTOYvjcMd 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/intel/int340x_thermal/int3406_thermal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3406_thermal.c b/drivers/thermal/intel/int340x_thermal/int3406_thermal.c index f5e42fc2acc0..1c266493c1aa 100644 --- a/drivers/thermal/intel/int340x_thermal/int3406_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3406_thermal.c @@ -178,13 +178,12 @@ static int int3406_thermal_probe(struct platform_device *pdev) return -ENODEV; } -static int int3406_thermal_remove(struct platform_device *pdev) +static void int3406_thermal_remove(struct platform_device *pdev) { struct int3406_thermal_data *d = platform_get_drvdata(pdev); thermal_cooling_device_unregister(d->cooling_dev); kfree(d->br); - return 0; } static const struct acpi_device_id int3406_thermal_match[] = { @@ -196,7 +195,7 @@ MODULE_DEVICE_TABLE(acpi, int3406_thermal_match); static struct platform_driver int3406_thermal_driver = { .probe = int3406_thermal_probe, - .remove = int3406_thermal_remove, + .remove_new = int3406_thermal_remove, .driver = { .name = "int3406 thermal", .acpi_match_table = int3406_thermal_match, From patchwork Wed Sep 27 19:37:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401583 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 02EC6E82CCB for ; Wed, 27 Sep 2023 19:38:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbjI0TiB (ORCPT ); Wed, 27 Sep 2023 15:38:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbjI0Th6 (ORCPT ); Wed, 27 Sep 2023 15:37:58 -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 19CBE126 for ; Wed, 27 Sep 2023 12:37:57 -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 1qlaLx-0002Fs-E2; Wed, 27 Sep 2023 21:37:45 +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 1qlaLx-009Pa5-1S; Wed, 27 Sep 2023 21:37:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLw-005RgI-OS; Wed, 27 Sep 2023 21:37:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/31] thermal: k3_bandgap: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:20 +0200 Message-Id: <20230927193736.2236447-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1747; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SyG9lEoEJ5Y7nBQv0324s5IbOFIPmCoox+ucvRaLCC4=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSRliylGx+62XIVaxSYc5cmHBa3ePp/25nd+0psg3ckX Vp5+5JIJ6MxCwMjF4OsmCKLfeOaTKsqucjOtf8uwwxiZQKZwsDFKQAT8X7J/r/Qd2+Uk2F3Lk/v 3xKvtXsNbzmImLLyanIyrfjasNu3MS170y7FyfIzpDQe9m1wOX1csXzdvuLfYY+nf2nLvFyh0nl h42wFcy6liHVa9T2TDbYI57JI6ifGNn3O3nvgz4dVL76XfXUR/LiiM4fj9aV38b92sRsxOEi6LF rWN9NQ98KaGqYli16LqWcdM/O8kqbOkWB19vPbNzz/wyVNX218kiKjIapU8lXI7mHntOkd8kebk 58LxYuwZN5Y4vKzz27hvpxfHK4z/uxUrl2XXKacVlJlraKgxTZ1w6ftvAms1uaJVWzmfPXCXypS V4WuturTjY477LXs8BfTxaknEiJ1i776VIe13N81Zb44AA== 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/k3_bandgap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/k3_bandgap.c b/drivers/thermal/k3_bandgap.c index 4a918c1e92f9..e88192d2afea 100644 --- a/drivers/thermal/k3_bandgap.c +++ b/drivers/thermal/k3_bandgap.c @@ -235,12 +235,10 @@ static int k3_bandgap_probe(struct platform_device *pdev) return ret; } -static int k3_bandgap_remove(struct platform_device *pdev) +static void k3_bandgap_remove(struct platform_device *pdev) { pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id of_k3_bandgap_match[] = { @@ -253,7 +251,7 @@ MODULE_DEVICE_TABLE(of, of_k3_bandgap_match); static struct platform_driver k3_bandgap_sensor_driver = { .probe = k3_bandgap_probe, - .remove = k3_bandgap_remove, + .remove_new = k3_bandgap_remove, .driver = { .name = "k3-soc-thermal", .of_match_table = of_k3_bandgap_match, From patchwork Wed Sep 27 19:37:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401595 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 874EBE82CD8 for ; Wed, 27 Sep 2023 19:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229769AbjI0TiE (ORCPT ); Wed, 27 Sep 2023 15:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229730AbjI0TiA (ORCPT ); Wed, 27 Sep 2023 15:38:00 -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 EC85E11F for ; Wed, 27 Sep 2023 12:37:58 -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 1qlaLx-0002GC-Mi; Wed, 27 Sep 2023 21:37:45 +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 1qlaLx-009Pa8-9z; Wed, 27 Sep 2023 21:37:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLx-005RgM-0q; Wed, 27 Sep 2023 21:37:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 16/31] thermal: k3_j72xx_bandgap: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:21 +0200 Message-Id: <20230927193736.2236447-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-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=Ai3M3oHtDNp/HL9j7aRsJaftufMla/CdkvmDRQgEQQI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRrCWmgKpKJt4xE47KYpPfMzC4xYYQtt8vJ5 wgLNd6WmLyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEawAKCRCPgPtYfRL+ TiZ2B/wKOwtdAizLf3j0MPniA0eUtXEYahRGBmimzR0Xr9SUhI4OxkYuVbZGTRMvou92aVPfhBz pb1/JcvXF+Vm8c91vgsJXcOsOyuiVr5Jr915Ob3W3X9PqQX3zL/P39X+hczYgLAqroes9XAKYjI 5Z/2mQp1J+wmTcetGNsyXGWMQqmj8IQlryVJDoSlMyq7GQQdQeQAF2w338kseCrY4b5jPXvC3mb kmN74dM8IHI8zqI63L3oU2Qdb1nuk1usTNqslBNRXilTmghcKD8s3p9vWCbRma7QDeooQSwfQh5 XMY4FDzfHqx+OMUA+cBppb6o3NFVeeUGNfzoPnVu5/A40Cfu 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/k3_j72xx_bandgap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index 2fc799b07b90..c74094a86982 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -521,12 +521,10 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) return ret; } -static int k3_j72xx_bandgap_remove(struct platform_device *pdev) +static void k3_j72xx_bandgap_remove(struct platform_device *pdev) { pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct k3_j72xx_bandgap_data k3_j72xx_bandgap_j721e_data = { @@ -552,7 +550,7 @@ MODULE_DEVICE_TABLE(of, of_k3_j72xx_bandgap_match); static struct platform_driver k3_j72xx_bandgap_sensor_driver = { .probe = k3_j72xx_bandgap_probe, - .remove = k3_j72xx_bandgap_remove, + .remove_new = k3_j72xx_bandgap_remove, .driver = { .name = "k3-j72xx-soc-thermal", .of_match_table = of_k3_j72xx_bandgap_match, From patchwork Wed Sep 27 19:37:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401581 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 C81CCE82CCE for ; Wed, 27 Sep 2023 19:38:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229748AbjI0Th7 (ORCPT ); Wed, 27 Sep 2023 15:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbjI0Th6 (ORCPT ); Wed, 27 Sep 2023 15:37:58 -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 ABF9D121 for ; Wed, 27 Sep 2023 12:37: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 1qlaLy-0002GP-5C; Wed, 27 Sep 2023 21:37:46 +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 1qlaLx-009PaD-K3; Wed, 27 Sep 2023 21:37:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLx-005RgQ-AS; Wed, 27 Sep 2023 21:37:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/31] thermal: kirkwood: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:22 +0200 Message-Id: <20230927193736.2236447-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1801; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tVq2dAYs4tf1+BIyTEw2zU/ZuuOoCmGqN0zw0lsXsA8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRsgTYHyXBp7i9fQo7xL4uEN2IpHz6sbowTj N8GBeQPU6aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEbAAKCRCPgPtYfRL+ TlpyB/wJ+nm1kpsI/Snx1m9E2l05gXJ4DP+4gtrScvIgmusZ68ErxrnDxss4o7eHvRFVmzX+2nZ 9IyJCu9YqBAG0XhnNtvI+bcogsEqGuqklLepllJtY0AvQ4mB7aHTuMxuVy+/PBmYQ2npUfxWJ6n 7NuHFq9D3/1KWpiq3ZbgHG2Kem7CCY6ph/D3he+TF8q0X5TjyPlwymEwEu7wqPxaO3ruYds8UE8 q3BCeHVMR+XkGmfoDFxoxqFun3eN46l/V9SrovPH08ZkpbFoWzV8qVRm3H5Ux2ZlscgQfGTPs7e mAX638YhkEUFdKqe3YuAlRDoTfc0KfC2GLMKR77VyZOGnPff 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/kirkwood_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c index acb10d24256d..a18158ebe65f 100644 --- a/drivers/thermal/kirkwood_thermal.c +++ b/drivers/thermal/kirkwood_thermal.c @@ -90,21 +90,19 @@ static int kirkwood_thermal_probe(struct platform_device *pdev) return 0; } -static int kirkwood_thermal_exit(struct platform_device *pdev) +static void kirkwood_thermal_exit(struct platform_device *pdev) { struct thermal_zone_device *kirkwood_thermal = platform_get_drvdata(pdev); thermal_zone_device_unregister(kirkwood_thermal); - - return 0; } MODULE_DEVICE_TABLE(of, kirkwood_thermal_id_table); static struct platform_driver kirkwood_thermal_driver = { .probe = kirkwood_thermal_probe, - .remove = kirkwood_thermal_exit, + .remove_new = kirkwood_thermal_exit, .driver = { .name = "kirkwood_thermal", .of_match_table = kirkwood_thermal_id_table, From patchwork Wed Sep 27 19:37:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401598 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 409A2E82CD2 for ; Wed, 27 Sep 2023 19:38:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229805AbjI0TiH (ORCPT ); Wed, 27 Sep 2023 15:38:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbjI0TiC (ORCPT ); Wed, 27 Sep 2023 15:38:02 -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 92A07CC for ; Wed, 27 Sep 2023 12:38:00 -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 1qlaLy-0002IC-LF; Wed, 27 Sep 2023 21:37:46 +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 1qlaLy-009PaH-08; Wed, 27 Sep 2023 21:37:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLx-005RgU-Ms; Wed, 27 Sep 2023 21:37:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Matthias Brugger , AngeloGioacchino Del Regno , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Alexandre Mergnat , Balsam CHIHI , Chen-Yu Tsai , Chen Jiahao , linux-pm@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 18/31] thermal: lvts: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:23 +0200 Message-Id: <20230927193736.2236447-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1889; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oR5Mc+6BIKT6LwKHzQBwyg4UdM19olB1/yKORq6B/vk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRtJH8eowbN+/Tw8iLoWMGStPbPTu8CU5y3q /GX00GKLdqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEbQAKCRCPgPtYfRL+ Thi/B/9IZTlxB0UNlY/bfiqBZonGLrcy9DMARBHHGkAxloo2XAW8G0p9bH0Ti/m6pCo2GwEwtoX +euF/qb30cnTLukjz84TVeRSyJrGMVvKzCez9g84O2XUq58QW1wT7KcJnLQbVzYqHsZxceS5e8g eudbVisgxm/bISn1fopANc2ONNYQnZtIZ9roeIvCCvBC7IZcbH+IvgMb4ETpxkRyzRVgcVilSB3 LVKaJCYi/D4FsiRc4wq1kpUhhlExM+3lKgraZBqd/bOrmulKS6Erp4KljmwSZkhUAu7+wGIBdIn M9GEA6RiMXC4D6CiCTJcYJVnWDNGiSYlbJKpoyHOHGCD2lpG 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno --- drivers/thermal/mediatek/lvts_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index effd9b00a424..877a0e5ac3fd 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -1241,7 +1241,7 @@ static int lvts_probe(struct platform_device *pdev) return 0; } -static int lvts_remove(struct platform_device *pdev) +static void lvts_remove(struct platform_device *pdev) { struct lvts_domain *lvts_td; int i; @@ -1252,8 +1252,6 @@ static int lvts_remove(struct platform_device *pdev) lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false); lvts_debugfs_exit(lvts_td); - - return 0; } static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = { @@ -1354,7 +1352,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match); static struct platform_driver lvts_driver = { .probe = lvts_probe, - .remove = lvts_remove, + .remove_new = lvts_remove, .driver = { .name = "mtk-lvts-thermal", .of_match_table = lvts_of_match, From patchwork Wed Sep 27 19:37:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401599 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 8ACC1E82CC9 for ; Wed, 27 Sep 2023 19:38:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229743AbjI0TiH (ORCPT ); Wed, 27 Sep 2023 15:38:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbjI0TiC (ORCPT ); Wed, 27 Sep 2023 15:38:02 -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 1230411D for ; Wed, 27 Sep 2023 12:38:01 -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 1qlaLz-0002K5-5N; Wed, 27 Sep 2023 21:37:47 +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 1qlaLy-009PaL-8o; Wed, 27 Sep 2023 21:37:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLx-005RgY-Vi; Wed, 27 Sep 2023 21:37:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Thara Gopinath , Andy Gross , Bjorn Andersson , Konrad Dybcio , Zhang Rui , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 19/31] thermal: tsens: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:24 +0200 Message-Id: <20230927193736.2236447-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1705; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wF38ePXpycGwnKKTrEJouU6XGgd+HM2PK8shpxqnqOc=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSRlrznDNfEn1+8ukv8Tr/CPr+nqs5yYktqbUOyZ1o/S +7+0dPZyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBEvGs5GDbHydjNPfJ0yaOs fh+eaYq3tvBPNlL8//tAtmOFqb9W6JmyBT82tfjrBToHW0Vwm91VfTdxlo6A5v7/mZZ/zCL2Bz6 P1t+pK2PZ9PuNo9L9/gLPeRarCiJj46YW8AU+3WR2c4ZsRuljxu+fhO3fLV+3d3ZNzZZ7DwNTxS ZsWDhlY8Xvna33v84014iK/XLk4tFs/Skn0+dF/Gr1Lf3NN42hPUKj1SEyX9qNKUNjhm2hi6xud 4Tdr/uhQgveSht5Cc+xq3itVRXIuqp7Z1ySk2dG7l+3yZ4secebSwXfX1ZPveV5x0zndqXMmdU5 NRt3/NUIl9wbfqLFwFLjg6FaZo5AWXYfb9msp183LzQAAA== 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/qcom/tsens.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 98c356acfe98..6d7c16ccb44d 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -1319,7 +1319,7 @@ static int tsens_probe(struct platform_device *pdev) return ret; } -static int tsens_remove(struct platform_device *pdev) +static void tsens_remove(struct platform_device *pdev) { struct tsens_priv *priv = platform_get_drvdata(pdev); @@ -1327,13 +1327,11 @@ static int tsens_remove(struct platform_device *pdev) tsens_disable_irq(priv); if (priv->ops->disable) priv->ops->disable(priv); - - return 0; } static struct platform_driver tsens_driver = { .probe = tsens_probe, - .remove = tsens_remove, + .remove_new = tsens_remove, .driver = { .name = "qcom-tsens", .pm = &tsens_pm_ops, From patchwork Wed Sep 27 19:37:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401591 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 EFCB8E82CD1 for ; Wed, 27 Sep 2023 19:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbjI0TiF (ORCPT ); Wed, 27 Sep 2023 15:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbjI0TiB (ORCPT ); Wed, 27 Sep 2023 15:38:01 -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 2A153126 for ; Wed, 27 Sep 2023 12:37: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 1qlaLz-0002MJ-BQ; Wed, 27 Sep 2023 21:37:47 +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 1qlaLy-009PaP-HC; Wed, 27 Sep 2023 21:37:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLy-005Rgc-7y; Wed, 27 Sep 2023 21:37:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: =?utf-8?q?Niklas_S=C3=B6derlund?= , Amit Kucheria , Zhang Rui , linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/31] thermal: rcar_gen3: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:25 +0200 Message-Id: <20230927193736.2236447-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1847; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qatukBVh/c3w2r14lUJ7pTSo0ydWjboDctX0r6l8VcE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRvzYqUxWY/OIDvp3CebvAg27UvsKG3b0Rbl aKqnQNm1CSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEbwAKCRCPgPtYfRL+ TgJ9B/9R9bmEHo/fpcmVeRc1BHkP154NHkn0weKtMtK5vD1YbiVl+0uxifWgYr3vWhYTwQkkwbj 4uRj7exkmeP2ax008Dbvo7nPzBxPyukD/NWEvtiKqcgxVCMgiwafjV72MxgWdg+Z7vO1T28qrMC AOlFJ0oduGix3ujkfbJufUgS0xWwEuoK5UOOaZWAo4ql6yP28g46xHhxCaVXCvwA846IbhQvfIY w9tuGE+jxhXCr5WOtB5dsIzNR9akYUPerMbSCOdcqfL3w7I7hr7tFzxOq45HT3p8njVoC+favjM M4UaoJtI3lFz8r9o2uiB5MX4I1/O5kF2/de524hXCa0JSHV/ 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund --- drivers/thermal/rcar_gen3_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index bd2fb8c2e968..cafcb6d6e235 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -432,14 +432,12 @@ static const struct of_device_id rcar_gen3_thermal_dt_ids[] = { }; MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids); -static int rcar_gen3_thermal_remove(struct platform_device *pdev) +static void rcar_gen3_thermal_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; pm_runtime_put(dev); pm_runtime_disable(dev); - - return 0; } static void rcar_gen3_hwmon_action(void *data) @@ -594,7 +592,7 @@ static struct platform_driver rcar_gen3_thermal_driver = { .of_match_table = rcar_gen3_thermal_dt_ids, }, .probe = rcar_gen3_thermal_probe, - .remove = rcar_gen3_thermal_remove, + .remove_new = rcar_gen3_thermal_remove, }; module_platform_driver(rcar_gen3_thermal_driver); From patchwork Wed Sep 27 19:37:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401586 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 7FCD1E82CD4 for ; Wed, 27 Sep 2023 19:38:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbjI0TiC (ORCPT ); Wed, 27 Sep 2023 15:38:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbjI0TiA (ORCPT ); Wed, 27 Sep 2023 15:38:00 -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 CF4B7114 for ; Wed, 27 Sep 2023 12:37:58 -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 1qlaLz-0002OM-LC; Wed, 27 Sep 2023 21:37:47 +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 1qlaLy-009PaS-Os; Wed, 27 Sep 2023 21:37:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLy-005Rgg-Ff; Wed, 27 Sep 2023 21:37:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: =?utf-8?q?Niklas_S=C3=B6derlund?= , Amit Kucheria , Zhang Rui , linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 21/31] thermal: rcar: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:26 +0200 Message-Id: <20230927193736.2236447-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1911; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MHKv/28ZnDSs6uYa+MjbkeIeuh0ZUJZusecVTIYcnKU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRxh9fubDtTFTH4kW0IjUOVF52b9nhLkZxwp FPKptJwZXyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEcQAKCRCPgPtYfRL+ TiE+B/0d6EBbM3BtHYzSj1FyzSyGPA9x5p83905SQWro7lqSh7IitvUCz6RKvvOu4tmPdXn/mK5 rzHlujPUwp8mshSICKdUR+98zADb72CJUztMg7dRh5YzcimrsOtqwadP7RlXMV/QNT/xcLljQYA 64cyPn07r1oJqrdrhzk7YoDoicBbOStCfLGeU4u3rwksSK2i2dQxC/XwRvWVc3SA+gwbJnaiH9U Boqd64XIsvtTN2pLL9rI6ZUICHYYW9thWKIRJvvyNQWP5KAFcJ0s6FhMBa0+NvBC/Tzn/WVi/5T Jdh27dudsnMNWtKQ0LnWkOp+q7GoSQv9X3slEhaq7+5Fzdkq 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund --- drivers/thermal/rcar_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 293f8dd9fe0a..feb848d595fa 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -371,7 +371,7 @@ static irqreturn_t rcar_thermal_irq(int irq, void *data) /* * platform functions */ -static int rcar_thermal_remove(struct platform_device *pdev) +static void rcar_thermal_remove(struct platform_device *pdev) { struct rcar_thermal_common *common = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -388,8 +388,6 @@ static int rcar_thermal_remove(struct platform_device *pdev) pm_runtime_put(dev); pm_runtime_disable(dev); - - return 0; } static int rcar_thermal_probe(struct platform_device *pdev) @@ -581,7 +579,7 @@ static struct platform_driver rcar_thermal_driver = { .of_match_table = rcar_thermal_dt_ids, }, .probe = rcar_thermal_probe, - .remove = rcar_thermal_remove, + .remove_new = rcar_thermal_remove, }; module_platform_driver(rcar_thermal_driver); From patchwork Wed Sep 27 19:37:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401584 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 9D1DDE82CD3 for ; Wed, 27 Sep 2023 19:38:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbjI0TiA (ORCPT ); Wed, 27 Sep 2023 15:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjI0Th6 (ORCPT ); Wed, 27 Sep 2023 15:37:58 -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 16AE2114 for ; Wed, 27 Sep 2023 12:37:57 -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 1qlaM0-0002Qj-7j; Wed, 27 Sep 2023 21:37:48 +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 1qlaLz-009PaW-2j; Wed, 27 Sep 2023 21:37:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLy-005Rgk-Po; Wed, 27 Sep 2023 21:37:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Heiko Stuebner , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 22/31] thermal: rockchip: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:27 +0200 Message-Id: <20230927193736.2236447-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1954; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=e9cswn2yEzGLDC3P0jt87Owou9KyRVBuLfDjfIop/Mc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRy71cHzhX/ZuIEZQHoUBDTG+CGXJ4ufI0VD wDtDvakgvyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEcgAKCRCPgPtYfRL+ TmPRB/9Q/oLKkk1Th1akg27q61GsJsMU10Du/v9EzM16DwZYTHR25fuBljtlcZe+dNxZV+5suKd ZmI09Fse46EVDBcm17gwGY3ohWxM1PCEDsILOWTXz2VS0N5wnPCW1cdhOYAzQn6WX8i+CIQ0Z46 aiItwpBzexEgwAbhbnJDpfNB3G208JnaJWUQgB6ujqcnOYwHUCvxlfMvX1pobLzPivvhS4rllEq QeVFBl497yxtK0BYqTxY+0f+j0xTWjAW2ZIr5dVxBpV2cYuCdaxx58fbVWBFkHfJ8tWcOjjsYC6 e20P2VcjnmmDCnrXPAlUTUR4u2xW9xiOTFVJzAIBQXE03U+R 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Heiko Stuebner --- drivers/thermal/rockchip_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 77231a9d28ff..086ed42dd16c 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -1601,7 +1601,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev) return 0; } -static int rockchip_thermal_remove(struct platform_device *pdev) +static void rockchip_thermal_remove(struct platform_device *pdev) { struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev); int i; @@ -1614,8 +1614,6 @@ static int rockchip_thermal_remove(struct platform_device *pdev) } thermal->chip->control(thermal->regs, false); - - return 0; } static int __maybe_unused rockchip_thermal_suspend(struct device *dev) @@ -1691,7 +1689,7 @@ static struct platform_driver rockchip_thermal_driver = { .of_match_table = of_rockchip_thermal_match, }, .probe = rockchip_thermal_probe, - .remove = rockchip_thermal_remove, + .remove_new = rockchip_thermal_remove, }; module_platform_driver(rockchip_thermal_driver); From patchwork Wed Sep 27 19:37:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13401587 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 E396FE82CCC for ; Wed, 27 Sep 2023 19:38:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbjI0TiC (ORCPT ); Wed, 27 Sep 2023 15:38:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbjI0Th7 (ORCPT ); Wed, 27 Sep 2023 15:37:59 -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 8C9A910E for ; Wed, 27 Sep 2023 12:37:58 -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 1qlaM0-0002T6-Kb; Wed, 27 Sep 2023 21:37:48 +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 1qlaLz-009Paa-D5; Wed, 27 Sep 2023 21:37:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLz-005Rgo-3N; Wed, 27 Sep 2023 21:37:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/31] thermal: rzg2l: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:28 +0200 Message-Id: <20230927193736.2236447-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1880; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Up1lglqpfdf9VLmMWd7Hmz7cVMwrd6pIZicDU3lYJx8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIRzy2F6EAlRnmDM7iCbG+GETqZS/kSe4yYUM /yjH+Pr8UOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEcwAKCRCPgPtYfRL+ TlreB/40HEcyLNwWYoFLiX8jB9eDuzrqb3Fo/LSLd3ysFgl/4H927kth6MY9SDQ1uGYupMa4+ea xlxcswOHhKwNVRhOqaBStcurxXiPdt4lAiebRxj4XvDJlL0UN40L5XOdd9ZeUOqH3prcksjg27g 4JZeESW2ryN8x11Kw5EkkT/CQTKyBJPmvYVDLM82ZUnSuuxvzYYyw3wRIxZeKh9Z2c4FgqlhJkz qRUtDw635aFEhjDxxdjHcqSlr3Im6534CGM/MJKF0OaajEOy+Ts+ZrWVo1ATgUoweYDnpFdoCcD e56zG01Q0FqUPhWFgMdINsBkhxEqfO9kXhPJROTsDgJ/OkKE 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/rzg2l_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rzg2l_thermal.c b/drivers/thermal/rzg2l_thermal.c index 6b2bf3426f52..04efd824ac4c 100644 --- a/drivers/thermal/rzg2l_thermal.c +++ b/drivers/thermal/rzg2l_thermal.c @@ -150,14 +150,12 @@ static void rzg2l_thermal_reset_assert_pm_disable_put(struct platform_device *pd reset_control_assert(priv->rstc); } -static int rzg2l_thermal_remove(struct platform_device *pdev) +static void rzg2l_thermal_remove(struct platform_device *pdev) { struct rzg2l_thermal_priv *priv = dev_get_drvdata(&pdev->dev); thermal_remove_hwmon_sysfs(priv->zone); rzg2l_thermal_reset_assert_pm_disable_put(pdev); - - return 0; } static int rzg2l_thermal_probe(struct platform_device *pdev) @@ -242,7 +240,7 @@ static struct platform_driver rzg2l_thermal_driver = { .of_match_table = rzg2l_thermal_dt_ids, }, .probe = rzg2l_thermal_probe, - .remove = rzg2l_thermal_remove, + .remove_new = rzg2l_thermal_remove, }; module_platform_driver(rzg2l_thermal_driver); From patchwork Wed Sep 27 19:37: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: 13401589 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 27474E82CD7 for ; Wed, 27 Sep 2023 19:38:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229796AbjI0TiD (ORCPT ); Wed, 27 Sep 2023 15:38:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbjI0TiA (ORCPT ); Wed, 27 Sep 2023 15:38:00 -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 2F84E136 for ; Wed, 27 Sep 2023 12:37: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 1qlaM0-0002Ug-SM; Wed, 27 Sep 2023 21:37:48 +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 1qlaLz-009Pae-KJ; Wed, 27 Sep 2023 21:37:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLz-005Rgs-Al; Wed, 27 Sep 2023 21:37:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Amit Kucheria , Zhang Rui , Alim Akhtar , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 24/31] thermal: exynos_tmu: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:29 +0200 Message-Id: <20230927193736.2236447-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1858; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dsnoZztErRYNWr2jU7eLRLQsZSepGY3S0hl8c5LtKzA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIR0TaGGXeMoBxWYJ1msvYfy3UomoULeWg05x o4x+QoASn6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEdAAKCRCPgPtYfRL+ TtvGCACfmjjCslXNoNAEjTNPuJidBY+JAYOn9VRADLcP46dCsssoj6+L1IipPI+RMzpGPG/e0y4 56ncD423YD1HsRiGbXpRFGK8gaz5M1WMrNM8LNq6I2d5k1H73pF3mZqNrv48JgqgPXNluPo6ucv vIVumXOSzZqTAcT8aPnRHD5Gt9iL5ioYrYVqAcmIVHeq5f4jOL1TZzW/7JMZeWzRmUzgqFhJeG0 4FGA0BWU0pobgS75av4ftclcgKJN4QFZT6hsWvoeDAnNp6+YWEUThxGW9MJsSHlPQygpirBW9U/ IOPPHiP4Xlebq1YX2Co52t8yqBgiTCg33fsGe4a+59bt/Eu4 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/samsung/exynos_tmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index e5bc2c82010f..123ec81e1943 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1124,7 +1124,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) return ret; } -static int exynos_tmu_remove(struct platform_device *pdev) +static void exynos_tmu_remove(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); @@ -1137,8 +1137,6 @@ static int exynos_tmu_remove(struct platform_device *pdev) if (!IS_ERR(data->regulator)) regulator_disable(data->regulator); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1173,7 +1171,7 @@ static struct platform_driver exynos_tmu_driver = { .of_match_table = exynos_tmu_match, }, .probe = exynos_tmu_probe, - .remove = exynos_tmu_remove, + .remove_new = exynos_tmu_remove, }; module_platform_driver(exynos_tmu_driver); From patchwork Wed Sep 27 19:37: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: 13401597 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 680E0E82CD0 for ; Wed, 27 Sep 2023 19:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbjI0TiE (ORCPT ); Wed, 27 Sep 2023 15:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjI0TiB (ORCPT ); Wed, 27 Sep 2023 15:38:01 -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 26A37122 for ; Wed, 27 Sep 2023 12:37: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 1qlaM1-0002WQ-9M; Wed, 27 Sep 2023 21:37:49 +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 1qlaLz-009Pai-V0; Wed, 27 Sep 2023 21:37:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLz-005Rgw-Lp; Wed, 27 Sep 2023 21:37:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/31] thermal: spear: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:30 +0200 Message-Id: <20230927193736.2236447-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1979; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7ZfoAOrL7r9Iqg+bNpE99ULlAAl8RUnI2fFr5kxTDXM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIR1xmkUtGtPVyhnz4rI+z9SHbgbqr6VbIgwr jNYErjqhUOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEdQAKCRCPgPtYfRL+ ThvxB/4ttE4R+sKcJloNwdhPqqmZg78M2JldvYv551oJYo/P4NjOUdQf98znrlgguGiZ+cO7Du1 mDygBUZxdAFHvuYWNjujN0j4KlOyJGvpQzuAQnghiuwdFYzkUGmkmhKNB0S7SlQNkjLDW3lxuYA bLK7hPe5pG3uUd+L9Ju0VtN/V/dvf5OKkI3c9Ydr6RDNkMsVJBJCxz8g25AtlUFe+hkOM8SbYun ISSG6cRhDAtCK4luTnIiayaosYSmm3hGaDXY+2FY5uw3lLSuKuwV/+KUJyV0fqAkI2Xx7BfTuyS 2e6ZUNI7r5/lXbUb2mxpod/Bmxz+PD3hYYS6pqTHO1OWkZvT 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/spear_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index 96d99289799a..60a871998b07 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c @@ -150,7 +150,7 @@ static int spear_thermal_probe(struct platform_device *pdev) return ret; } -static int spear_thermal_exit(struct platform_device *pdev) +static void spear_thermal_exit(struct platform_device *pdev) { unsigned int actual_mask = 0; struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); @@ -163,8 +163,6 @@ static int spear_thermal_exit(struct platform_device *pdev) writel_relaxed(actual_mask & ~stdev->flags, stdev->thermal_base); clk_disable(stdev->clk); - - return 0; } static const struct of_device_id spear_thermal_id_table[] = { @@ -175,7 +173,7 @@ MODULE_DEVICE_TABLE(of, spear_thermal_id_table); static struct platform_driver spear_thermal_driver = { .probe = spear_thermal_probe, - .remove = spear_thermal_exit, + .remove_new = spear_thermal_exit, .driver = { .name = "spear_thermal", .pm = &spear_thermal_pm_ops, From patchwork Wed Sep 27 19:37: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: 13401594 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 5E0ACE82CCA for ; Wed, 27 Sep 2023 19:38:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbjI0TiF (ORCPT ); Wed, 27 Sep 2023 15:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbjI0TiA (ORCPT ); Wed, 27 Sep 2023 15:38:00 -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 2220A121 for ; Wed, 27 Sep 2023 12:37: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 1qlaM1-0002XN-BZ; Wed, 27 Sep 2023 21:37:49 +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 1qlaM0-009Pal-5b; Wed, 27 Sep 2023 21:37:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaLz-005Rh0-Sc; Wed, 27 Sep 2023 21:37:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Orson Zhai , Baolin Wang , Chunyan Zhang , linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 26/31] thermal: sprd: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:31 +0200 Message-Id: <20230927193736.2236447-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1841; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FJIeMV+NAgsAAlfJhTgA/L0aMWXEPFUJ+GH6vBCQS0c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIR2yp41cxfM9R8chQgwhQsdcNqG+Zydybtnj BvspXNlYAiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEdgAKCRCPgPtYfRL+ Tt+3B/9RswlpH7IU+7Ig3ar36GBEfnlfhJOkeAD+miKmrcHi9o11xi4PMCZ5Opl09kKjz2qQvbp HrgJhfoqu2fXYf//jSwU37hywICi8B0C+Boq1bqrX83pX1vUZaFjl03K6e2ev7Urwb+On2mjHiX m6StrvUlD255/EWmpPp1g6NEsM0xFXGdCAinXT5Ri/+UUlk+zU11DDtltqpnomA4kHdFtbmG7qh b25GyfoozsXJnxNKj5SLCBM+Z9GOUx5350vb3IwHSigrivbvW7Ry0S1TmoIAIXBoUuSi4ziRgrl 2bn5Fq7N4JfRBnFgCV+6e4XxEhHslK3L504mGiG3iad77U6x 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/sprd_thermal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/sprd_thermal.c b/drivers/thermal/sprd_thermal.c index e27c4bdc8912..874192546548 100644 --- a/drivers/thermal/sprd_thermal.c +++ b/drivers/thermal/sprd_thermal.c @@ -516,7 +516,7 @@ static int sprd_thm_resume(struct device *dev) } #endif -static int sprd_thm_remove(struct platform_device *pdev) +static void sprd_thm_remove(struct platform_device *pdev) { struct sprd_thermal_data *thm = platform_get_drvdata(pdev); int i; @@ -528,7 +528,6 @@ static int sprd_thm_remove(struct platform_device *pdev) } clk_disable_unprepare(thm->clk); - return 0; } static const struct of_device_id sprd_thermal_of_match[] = { @@ -543,7 +542,7 @@ static const struct dev_pm_ops sprd_thermal_pm_ops = { static struct platform_driver sprd_thermal_driver = { .probe = sprd_thm_probe, - .remove = sprd_thm_remove, + .remove_new = sprd_thm_remove, .driver = { .name = "sprd-thermal", .pm = &sprd_thermal_pm_ops, From patchwork Wed Sep 27 19:37: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: 13401603 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 2AB37E82CD4 for ; Wed, 27 Sep 2023 19:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbjI0TiI (ORCPT ); Wed, 27 Sep 2023 15:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229795AbjI0TiC (ORCPT ); Wed, 27 Sep 2023 15:38:02 -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 9F1C910E for ; Wed, 27 Sep 2023 12:38:01 -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 1qlaM1-0002Z8-Qe; Wed, 27 Sep 2023 21:37:49 +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 1qlaM0-009Pap-Lt; Wed, 27 Sep 2023 21:37:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaM0-005Rh4-CR; Wed, 27 Sep 2023 21:37:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Niklas_S=C3=B6de?= =?utf-8?q?rlund?= , Kunihiko Hayashi , Florian Fainelli , Rob Herring , Minghao Chi , linux-pm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 27/31] thermal: stm: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:32 +0200 Message-Id: <20230927193736.2236447-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1809; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wdpMw5JzEvxaXagtk1dsizCUtUbJdxGNcbw4iT5Zf2s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIR3hjV5wMnJA98u7QQq2KRE6NFjbR30iM1Ta LaitesBBjuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEdwAKCRCPgPtYfRL+ Tga3B/489By4Xyjqvz19TcCTf3qVlYoLp1qqBeeSm+U+vlQtQlZ4GcdmT3FP93Dt9cqFDXYkpD5 3DQam1eMaragsy3YpLSolLr7ULjIJbaxiBY1YS3QJoawLArV4j2DVdZKOmy2F4CHxqNDuAmDdCB T177yZYTqsIw8v8ZP8LopiRUpAtGMFiJdMSywzJ/sGM8hM6oGQ0XpUA1Ltrv834pk3OYeTZNDhL SSEgfIDhrn9WiL7xACX7EkWBxX7yuryJ/MFFS4OZfjXmS8+0y03wnRdG1A1jMdSmflegmW+Olv4 oY3u3/aPHlu6xKfmQ7hBkVyXRqPevQlXLpGKdPOyHF3Zfvjp 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/st/stm_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c index 142a7e5d12f4..34785b9276fc 100644 --- a/drivers/thermal/st/stm_thermal.c +++ b/drivers/thermal/st/stm_thermal.c @@ -569,14 +569,12 @@ static int stm_thermal_probe(struct platform_device *pdev) return ret; } -static int stm_thermal_remove(struct platform_device *pdev) +static void stm_thermal_remove(struct platform_device *pdev) { struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev); stm_thermal_sensor_off(sensor); thermal_remove_hwmon_sysfs(sensor->th_dev); - - return 0; } static struct platform_driver stm_thermal_driver = { @@ -586,7 +584,7 @@ static struct platform_driver stm_thermal_driver = { .of_match_table = stm_thermal_of_match, }, .probe = stm_thermal_probe, - .remove = stm_thermal_remove, + .remove_new = stm_thermal_remove, }; module_platform_driver(stm_thermal_driver); From patchwork Wed Sep 27 19:37: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: 13401590 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 37E37E82CD9 for ; Wed, 27 Sep 2023 19:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229754AbjI0TiE (ORCPT ); Wed, 27 Sep 2023 15:38:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbjI0TiA (ORCPT ); Wed, 27 Sep 2023 15:38:00 -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 602CC10A for ; Wed, 27 Sep 2023 12:37: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 1qlaM1-0002a1-Tt; Wed, 27 Sep 2023 21:37:49 +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 1qlaM0-009Pat-VH; Wed, 27 Sep 2023 21:37:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaM0-005Rh8-Lj; Wed, 27 Sep 2023 21:37:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Thierry Reding , Jonathan Hunter , =?utf-8?q?Niklas_S=C3=B6derlund?= , Jernej Skrabec , Johan Hovold , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/31] thermal: soctherm: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:33 +0200 Message-Id: <20230927193736.2236447-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1900; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uHVcHD4muj48wU7dFB0AW5fmvDkHoBh8EbeZlIdklcc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIR4xNQwDwkSqNP7b56y0F7eEi1bDNdpRSghz NJgZg2wpVmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEeAAKCRCPgPtYfRL+ TrFmB/9BVMH7cwlUzWiCs3E/AO0ZbkTeUc/Hba5ZmDaXAk2Gj9mL3vN/R3YTC2VmBxrbvEuNUei kwt8uqP6X20RpF1gt5v1/oZj6xad5EOV/r714xDPOXGWvA6HmUUc+HtAkceK/BfuIlnkV+4aUPw CSiAjZ4rcS9z0l95D6PgMRk5jbkpeWe+cG/e8DlQUOybEqpR6wCbC1URj6tPNaVdCG10A1m/qGb Z3X57BFZKwjfnqnZNBq4UwZPytqYO3X5odTjnuIlYgluIJXiu50i0btXQw34wjWgYj6CJwYP3oq UeOAIgS3ys5F0M/585zfX281+ZdiUBelwLlVZhQFIFpf8p7Z 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/tegra/soctherm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index ea66cba09e56..e7fe8683bfc5 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -2219,15 +2219,13 @@ static int tegra_soctherm_probe(struct platform_device *pdev) return err; } -static int tegra_soctherm_remove(struct platform_device *pdev) +static void tegra_soctherm_remove(struct platform_device *pdev) { struct tegra_soctherm *tegra = platform_get_drvdata(pdev); debugfs_remove_recursive(tegra->debugfs_dir); soctherm_clk_enable(pdev, false); - - return 0; } static int __maybe_unused soctherm_suspend(struct device *dev) @@ -2274,7 +2272,7 @@ static SIMPLE_DEV_PM_OPS(tegra_soctherm_pm, soctherm_suspend, soctherm_resume); static struct platform_driver tegra_soctherm_driver = { .probe = tegra_soctherm_probe, - .remove = tegra_soctherm_remove, + .remove_new = tegra_soctherm_remove, .driver = { .name = "tegra_soctherm", .pm = &tegra_soctherm_pm, From patchwork Wed Sep 27 19:37: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: 13401602 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 2CE7FE82CC3 for ; Wed, 27 Sep 2023 19:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229787AbjI0TiJ (ORCPT ); Wed, 27 Sep 2023 15:38:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229802AbjI0TiD (ORCPT ); Wed, 27 Sep 2023 15:38:03 -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 5E6B911D for ; Wed, 27 Sep 2023 12:38: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 1qlaM2-0002ap-Cm; Wed, 27 Sep 2023 21:37:50 +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 1qlaM1-009Pax-6L; Wed, 27 Sep 2023 21:37:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaM0-005RhC-TP; Wed, 27 Sep 2023 21:37:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Thierry Reding , Jonathan Hunter , Mikko Perttunen , =?utf-8?q?Niklas_S=C3=B6derlund?= , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 29/31] thermal: tegra-bpmp: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:34 +0200 Message-Id: <20230927193736.2236447-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1947; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uEYsqiyECnkROUq/Po2gsxShXIZII6cGT6ve6yNHOlk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIR5jAoz2/2cVtNLE6PxnscgzP4lySOjpuW1V aW7xT1ZueaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEeQAKCRCPgPtYfRL+ TtZ0CAC74IEUoSwVq/Ks3db/0DD2TWq0bgbzKgbw2WqF19YhX9MzBKahBEmgsf3lX/1jM/A75th pwJeUhKrCxYGPckO1lbvvex9Mro5Hj8r0NT4PG1YDVlRw/bDyw3tsuOhJUhZoQFkl9OsPbTjcYi weIlYb7VZlSEwRyuX5mdY8JtJsE8ekxwliKLm3WPLRVtllbKV3d84o8AyMz78qXbfQQNgAy7ekJ O2+xEvnHZMfYJo69u9hZDHaK1udS3DV/vHnMktIvVOW7vdU24W7sQrLF5117fjVUHN0t5iwyIL3 1D9+x+5Q6dariRrlzGvF6swswbUFw8a9dshpcUrb2pWrd8HN 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/tegra/tegra-bpmp-thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/tegra/tegra-bpmp-thermal.c b/drivers/thermal/tegra/tegra-bpmp-thermal.c index 4ffc3bb3bf35..72ce14c980cd 100644 --- a/drivers/thermal/tegra/tegra-bpmp-thermal.c +++ b/drivers/thermal/tegra/tegra-bpmp-thermal.c @@ -300,13 +300,11 @@ static int tegra_bpmp_thermal_probe(struct platform_device *pdev) return 0; } -static int tegra_bpmp_thermal_remove(struct platform_device *pdev) +static void tegra_bpmp_thermal_remove(struct platform_device *pdev) { struct tegra_bpmp_thermal *tegra = platform_get_drvdata(pdev); tegra_bpmp_free_mrq(tegra->bpmp, MRQ_THERMAL, tegra); - - return 0; } static const struct of_device_id tegra_bpmp_thermal_of_match[] = { @@ -317,7 +315,7 @@ MODULE_DEVICE_TABLE(of, tegra_bpmp_thermal_of_match); static struct platform_driver tegra_bpmp_thermal_driver = { .probe = tegra_bpmp_thermal_probe, - .remove = tegra_bpmp_thermal_remove, + .remove_new = tegra_bpmp_thermal_remove, .driver = { .name = "tegra-bpmp-thermal", .of_match_table = tegra_bpmp_thermal_of_match, From patchwork Wed Sep 27 19:37: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: 13401596 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 05E90E82CD3 for ; Wed, 27 Sep 2023 19:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbjI0TiG (ORCPT ); Wed, 27 Sep 2023 15:38:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbjI0TiB (ORCPT ); Wed, 27 Sep 2023 15:38:01 -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 A8CFA10E for ; Wed, 27 Sep 2023 12:37: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 1qlaM2-0002bo-G9; Wed, 27 Sep 2023 21:37:50 +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 1qlaM1-009Pb0-Cg; Wed, 27 Sep 2023 21:37:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaM1-005RhG-3T; Wed, 27 Sep 2023 21:37:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Eduardo Valentin , Keerthy , Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, linux-omap@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 30/31] thermal: ti-bandgap: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:35 +0200 Message-Id: <20230927193736.2236447-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1902; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/Htw7XUwPMUQ5co1pUmLGdKiOOqGevqunQPfT41Kens=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlFIR7qI669EFclFzfw61tYSRCuPOV1lPbGl4mO a/wkHEm9ZaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRSEewAKCRCPgPtYfRL+ TkN3B/9CwK1nVibQ7r++BNbI+nJTbIDsS9qJUYUysGIiRxXsg1MQp5IAmN0y6azESIqDgiRDKPG QcYuYK0Aci7eww628Vty1WOOxN1LYQatfHcGbHb7nsb44ffGitDg/wgLwppeIh8TNxKlChNbkle swDf/f2eGn2l7HlNQRLFUVtWAzkD7qOTnxdAM/aeEuzNV8vE5BDlv2Cyx5kUzT56vyR0Ph7kdxx S+wdAu+mGZQdMnI9Y7BWlwi+G28fpZjA6YvgWBH2Bir/L9saO+2a56I2alGRad3YTQ+MY9FezRj i/x/w19lfbWcgp8vJMUQQx+cU4mkTLNhUPSnssWuG158GzXC 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Dhruva Gole --- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index 0c2eb9c6e58b..caadfc61be93 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c @@ -1069,7 +1069,7 @@ int ti_bandgap_probe(struct platform_device *pdev) } static -int ti_bandgap_remove(struct platform_device *pdev) +void ti_bandgap_remove(struct platform_device *pdev) { struct ti_bandgap *bgp = platform_get_drvdata(pdev); int i; @@ -1098,8 +1098,6 @@ int ti_bandgap_remove(struct platform_device *pdev) if (TI_BANDGAP_HAS(bgp, TSHUT)) free_irq(gpiod_to_irq(bgp->tshut_gpiod), NULL); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1283,7 +1281,7 @@ MODULE_DEVICE_TABLE(of, of_ti_bandgap_match); static struct platform_driver ti_bandgap_sensor_driver = { .probe = ti_bandgap_probe, - .remove = ti_bandgap_remove, + .remove_new = ti_bandgap_remove, .driver = { .name = "ti-soc-thermal", .pm = DEV_PM_OPS, From patchwork Wed Sep 27 19:37: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: 13401593 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 40FA7E82CCB for ; Wed, 27 Sep 2023 19:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbjI0TiG (ORCPT ); Wed, 27 Sep 2023 15:38:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbjI0TiB (ORCPT ); Wed, 27 Sep 2023 15:38:01 -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 85CB213A for ; Wed, 27 Sep 2023 12:37: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 1qlaM2-0002cr-Hw; Wed, 27 Sep 2023 21:37:50 +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 1qlaM1-009Pb5-KP; Wed, 27 Sep 2023 21:37:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlaM1-005RhK-B7; Wed, 27 Sep 2023 21:37:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Amit Kucheria , Zhang Rui , Kunihiko Hayashi , Masami Hiramatsu , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 31/31] thermal: uniphier: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 21:37:36 +0200 Message-Id: <20230927193736.2236447-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de> References: <20230927193736.2236447-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=z/ClpKnPyFge+NWzcPB577xRCQuThx5vjaDx/3YvIhM=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSRlhqecs8PHu6iv8133+Cv3WK+r65HLHnpbNsKJYayq 7zBdnydjMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAExk+3r2/56nzvDnf6l5kTw7 qMTbgcG/pmbHab/pc+eZbOPWmbI8U0X1Wq/yws0vWYIuHopeuff48b4FM/4xMx3Prs+Qyffx+3k rV9VCPozv0mvGWnv/r89uy3717IxxlV/AERYn7H9JKlvXNrnx+aa5wfPznaIf3Jzm7xvfev+pVX Ke5zQ5/T9JM+Vyr7Ub8pZ+vlWzwUnOpXuWF1f+Xp+rotmZ3Bv5rhwUuBWyytt+zaTLl/m0u5e0a D/tKT/FpGzSqnWr781y0YyIltBNPVZ/1r836EoyMQvamPZp0o/6sxmZnp61q0u7VS5K32t44rwt s2Pum3yxKzlyvKLTn1x/qfvFRCXisn/chdlrCnW1tj0EAA== 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() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/thermal/uniphier_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/uniphier_thermal.c b/drivers/thermal/uniphier_thermal.c index 6f32ab61d174..274f36358b21 100644 --- a/drivers/thermal/uniphier_thermal.c +++ b/drivers/thermal/uniphier_thermal.c @@ -317,14 +317,12 @@ static int uniphier_tm_probe(struct platform_device *pdev) return 0; } -static int uniphier_tm_remove(struct platform_device *pdev) +static void uniphier_tm_remove(struct platform_device *pdev) { struct uniphier_tm_dev *tdev = platform_get_drvdata(pdev); /* disable sensor */ uniphier_tm_disable_sensor(tdev); - - return 0; } static const struct uniphier_tm_soc_data uniphier_pxs2_tm_data = { @@ -362,7 +360,7 @@ MODULE_DEVICE_TABLE(of, uniphier_tm_dt_ids); static struct platform_driver uniphier_tm_driver = { .probe = uniphier_tm_probe, - .remove = uniphier_tm_remove, + .remove_new = uniphier_tm_remove, .driver = { .name = "uniphier-thermal", .of_match_table = uniphier_tm_dt_ids,