From patchwork Thu Feb 22 18:52:33 2024 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: 13567955 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3657A12D208 for ; Thu, 22 Feb 2024 18:52:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627973; cv=none; b=Q1j8IQTA2kPLySWl2aWDceacH/WPLVCwjc8KqhKhQ8w6PN0ViiON/NUaR/IYvzcitpnrzsdjtpEPBd70DuKgjGilZ0QapSYCKm2B49vlYNnsjW20Tn0J8kwFRA+PcxxbPvz0wPNhs97i5lSdeGQanJa15XrpOhijxnpDwi5E0Hs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627973; c=relaxed/simple; bh=fAlGPZxX+yovfBFVUw/Aze9TIZyyaeDy+h6cvTvOjjU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ttTXWgC13o1k/aZG1Vo4j+j7SxXcYWGEC1FCYW08Gh1rjtUYuiiRRkaHPu7I1kZyIuQKwTSI/a7GzncqDtEC1BIlyZLDA/JMKJI4EkTkXrel771yBvkn2GbgXwYEGWf5te5DvLnN9VsL5igB/UvY8CbwibXuICCQQ5LrRpwXFKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rdEBa-0003OL-FH; Thu, 22 Feb 2024 19:52:46 +0100 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 1rdEBa-002HYh-2T; Thu, 22 Feb 2024 19:52:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdEBZ-009dAJ-3D; Thu, 22 Feb 2024 19:52:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" Cc: Len Brown , linux-acpi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/7] ACPI: TAD: Convert to platform remove callback returning void Date: Thu, 22 Feb 2024 19:52:33 +0100 Message-ID: <15600c270b1684c1a24cdd6da5e110d8eac42266.1708627599.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1910; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=fAlGPZxX+yovfBFVUw/Aze9TIZyyaeDy+h6cvTvOjjU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl15fzr6RJWKCtJhntx9ZX55g3mVwX+MmNmQZAW yNo3VSqLUWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdeX8wAKCRCPgPtYfRL+ TtUzB/91pzcvfCZMPnvqG7OfRX4IRXk77i/LG0clQlJhcaX8u52zifqaEPE7m/rA+itKOtX1esV e4U0aXAMbC9ObrYDnFWbHRsrGL37XCp7WO/AV1YioUgQowhvGuY1xq2DS0r55SaOv4bEJjUxdJ6 k5TdQ06l7/9u9w4tglLEFFdPvOZkyVzNtUi6K4wbxfMCzN2STzRvzMfHYaVxnbMe+zfX2NxVbwf Zr4+muTkH/sLZEPT3GQeCJOGnPiJk7hHDrNMKnWoYCEblAg4ZARG7z1Q6Tjfmo7F1sQuh7bObT2 GoQPUJRWf43bNkh7JfVS2WpvlYWJ5gY55SYq1kRKCEoMldw9 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-acpi@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/acpi/acpi_tad.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpi_tad.c b/drivers/acpi/acpi_tad.c index 33c3b16af556..1d670dbe4d1d 100644 --- a/drivers/acpi/acpi_tad.c +++ b/drivers/acpi/acpi_tad.c @@ -554,7 +554,7 @@ static int acpi_tad_disable_timer(struct device *dev, u32 timer_id) return acpi_tad_wake_set(dev, "_STV", timer_id, ACPI_TAD_WAKE_DISABLED); } -static int acpi_tad_remove(struct platform_device *pdev) +static void acpi_tad_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; acpi_handle handle = ACPI_HANDLE(dev); @@ -579,7 +579,6 @@ static int acpi_tad_remove(struct platform_device *pdev) pm_runtime_put_sync(dev); pm_runtime_disable(dev); acpi_remove_cmos_rtc_space_handler(handle); - return 0; } static int acpi_tad_probe(struct platform_device *pdev) @@ -684,7 +683,7 @@ static struct platform_driver acpi_tad_driver = { .acpi_match_table = acpi_tad_ids, }, .probe = acpi_tad_probe, - .remove = acpi_tad_remove, + .remove_new = acpi_tad_remove, }; MODULE_DEVICE_TABLE(acpi, acpi_tad_ids); From patchwork Thu Feb 22 18:52:34 2024 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: 13567961 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B92314B815 for ; Thu, 22 Feb 2024 18:52:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627980; cv=none; b=SGRRtfiUqBRa44v4+72YNV5YGw8ju8p9xiaNawZOhc3x4GkrxC2nTtS/0DtiuQtX4v3Y0DKocVc9Kd1CR1v7/XeLhzdf8BPZC969f1l3Gafe6kCWOjvIpGN9L7IBUWA2muzT2odhkvjNrt9nmXEPmHtfmgT6YtzV+d7Bt4QR8eA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627980; c=relaxed/simple; bh=vIi5PB6mBSI3DnBlsSRa3+P9radJLrcOBAJNG7A7HK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jAjv7VIA7mx+ACKQMRv9y4GmCXk8JyXiVFzp5ufiVpG4DBTSEJNA+KMxCHLvjeeVV36lpuQCTaxNF0M92HCgL0zEWp/6XA7o7zFUzMNpSam2mla1rkcv7EiYzu5GjL3DbuuHdocaJvQCc1GniswiArk6/dBONvS99en3XSWxTuo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rdEBc-0003OS-P6; Thu, 22 Feb 2024 19:52:48 +0100 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 1rdEBa-002HYk-9g; Thu, 22 Feb 2024 19:52:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdEBa-009dAN-0g; Thu, 22 Feb 2024 19:52:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" Cc: Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Len Brown , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 2/7] ACPI: AGDI: Convert to platform remove callback returning void Date: Thu, 22 Feb 2024 19:52:34 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2074; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=vIi5PB6mBSI3DnBlsSRa3+P9radJLrcOBAJNG7A7HK4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl15f0xqptdAC5hEDdn2wh5R231nJb0dnMsCV/x 7U3KRN60tiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdeX9AAKCRCPgPtYfRL+ TqWCB/9l6oenxy72Kf0YfqU3sH9aj3b0y64880Oa0pka6LqJLF6E49dhvrc75HVPQPX7KXE7m+t 3Mun9/JJ9GOYHfHIvs17Y97ScydbCr9YUUMQR1N02r+Sa13SU2+kOtW72uJ6MKTuu1azYpJLTb/ L5YRI6eaHqsGLzyLHC391frafw6ZDEVnfc6qTHvrDddcFYNe6YYSIG6ZNlhNf11fg7+a0ekptdP SnVbt6IcfX7R0aA4BowRlR75HHM1xvqtlKR5/xnx5Jg/n+djv9yvp7+Wed3dqwH8lS1eJGfnetb GrWb1mNrKxWWJXOU8YBObh+d7IHOfpfmmHSZlL9YaFjpQbqc 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-acpi@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 Acked-by: Hanjun Guo --- drivers/acpi/arm64/agdi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/arm64/agdi.c b/drivers/acpi/arm64/agdi.c index 8b3c7d42b41b..f5f21dd0d277 100644 --- a/drivers/acpi/arm64/agdi.c +++ b/drivers/acpi/arm64/agdi.c @@ -58,7 +58,7 @@ static int agdi_probe(struct platform_device *pdev) return agdi_sdei_probe(pdev, adata); } -static int agdi_remove(struct platform_device *pdev) +static void agdi_remove(struct platform_device *pdev) { struct agdi_data *adata = dev_get_platdata(&pdev->dev); int err, i; @@ -67,7 +67,7 @@ static int agdi_remove(struct platform_device *pdev) if (err) { dev_err(&pdev->dev, "Failed to disable sdei-event #%d (%pe)\n", adata->sdei_event, ERR_PTR(err)); - return 0; + return; } for (i = 0; i < 3; i++) { @@ -81,8 +81,6 @@ static int agdi_remove(struct platform_device *pdev) if (err) dev_err(&pdev->dev, "Failed to unregister sdei-event #%d (%pe)\n", adata->sdei_event, ERR_PTR(err)); - - return 0; } static struct platform_driver agdi_driver = { @@ -90,7 +88,7 @@ static struct platform_driver agdi_driver = { .name = "agdi", }, .probe = agdi_probe, - .remove = agdi_remove, + .remove_new = agdi_remove, }; void __init acpi_agdi_init(void) From patchwork Thu Feb 22 18:52:35 2024 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: 13567958 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E055E137939 for ; Thu, 22 Feb 2024 18:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627975; cv=none; b=YZ2rJibJVXT5/1kl484uOeaNzwEN9mGOUuoM6p4acEIasDo7yfFJhHdSiPaq5VO6hASqcRo3g2wVt5sQVreeYogsXwjQXBipqkMzBRYy6e7jTTcJE5Ar6bMDzxOHpCFQKWww3YkFiRML/SSUKR6OO/RmbEssuTK6pBIfnwZGu+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627975; c=relaxed/simple; bh=iAty85YzmBCgpuoI4cy8fKArgv5cR+MKTyWvQ6yRLE4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=I9IlzXgsKYIuJx+p215GpIvoyLlK5VLr4Rrx37P29fMvkheXXOtmCpRslutthqs3JXz1xMugtr9OK0OiUQlcNG87pHSs6svkFdGJuhKNcI1sb7e2yanZpKhEZgO5bd+s2vhNwpsHWCXNl16yJRgiMFIM1iobOaP2D7u8CEtHvBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rdEBa-0003OW-Ti; Thu, 22 Feb 2024 19:52:46 +0100 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 1rdEBa-002HYn-H0; Thu, 22 Feb 2024 19:52:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdEBa-009dAR-1R; Thu, 22 Feb 2024 19:52:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" Cc: Len Brown , linux-acpi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 3/7] ACPI: DPTF: Convert to platform remove callback returning void Date: Thu, 22 Feb 2024 19:52:35 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2904; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=iAty85YzmBCgpuoI4cy8fKArgv5cR+MKTyWvQ6yRLE4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl15f1101qH7LGpki/dgEN/6L4ozhp3WL0xuGf5 kpU+i/KrW6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdeX9QAKCRCPgPtYfRL+ TqjFB/9R5hPf4si3ygdPou2rbo+9XvhLG5fBtjj0fpA5/x8Y/Yq5f1wiWxMJpDLecKjeJQ5IJRf 1Of1IWofLu8o29tZzjO873qBD5KR40Q21cikh4wWPpwb7lR7QcsRdihBJsnmRPOzrC3T7gySLaZ iP9T53Axz3aXi9dkJb7fnGy2gRKNVD2li0r4lP8g/eYkmYRAbAm7fj9JwyFPlsn6647wGUaLTU6 vILdnBwj48pmuUrNG3BgXZQFT1Y9A2jkicT/CYKMCp3PZzBGmCddVhpZJbPHYvuwZXyaW9tRPEs c2Fqe9SbRP/QcApnJ3ExF6ALnSLaJlUCySFkukerV1Tx3E9g 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-acpi@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 these two drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/acpi/dptf/dptf_pch_fivr.c | 6 ++---- drivers/acpi/dptf/dptf_power.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/dptf/dptf_pch_fivr.c b/drivers/acpi/dptf/dptf_pch_fivr.c index 4919e7abe93f..654aaa53c67f 100644 --- a/drivers/acpi/dptf/dptf_pch_fivr.c +++ b/drivers/acpi/dptf/dptf_pch_fivr.c @@ -141,11 +141,9 @@ static int pch_fivr_add(struct platform_device *pdev) return 0; } -static int pch_fivr_remove(struct platform_device *pdev) +static void pch_fivr_remove(struct platform_device *pdev) { sysfs_remove_group(&pdev->dev.kobj, &pch_fivr_attribute_group); - - return 0; } static const struct acpi_device_id pch_fivr_device_ids[] = { @@ -159,7 +157,7 @@ MODULE_DEVICE_TABLE(acpi, pch_fivr_device_ids); static struct platform_driver pch_fivr_driver = { .probe = pch_fivr_add, - .remove = pch_fivr_remove, + .remove_new = pch_fivr_remove, .driver = { .name = "dptf_pch_fivr", .acpi_match_table = pch_fivr_device_ids, diff --git a/drivers/acpi/dptf/dptf_power.c b/drivers/acpi/dptf/dptf_power.c index 86561eda939f..b8187babbbbb 100644 --- a/drivers/acpi/dptf/dptf_power.c +++ b/drivers/acpi/dptf/dptf_power.c @@ -209,7 +209,7 @@ static int dptf_power_add(struct platform_device *pdev) return 0; } -static int dptf_power_remove(struct platform_device *pdev) +static void dptf_power_remove(struct platform_device *pdev) { struct acpi_device *acpi_dev = platform_get_drvdata(pdev); @@ -221,8 +221,6 @@ static int dptf_power_remove(struct platform_device *pdev) sysfs_remove_group(&pdev->dev.kobj, &dptf_battery_attribute_group); else sysfs_remove_group(&pdev->dev.kobj, &dptf_power_attribute_group); - - return 0; } static const struct acpi_device_id int3407_device_ids[] = { @@ -242,7 +240,7 @@ MODULE_DEVICE_TABLE(acpi, int3407_device_ids); static struct platform_driver dptf_power_driver = { .probe = dptf_power_add, - .remove = dptf_power_remove, + .remove_new = dptf_power_remove, .driver = { .name = "dptf_power", .acpi_match_table = int3407_device_ids, From patchwork Thu Feb 22 18:52:36 2024 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: 13567956 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C05E14B808 for ; Thu, 22 Feb 2024 18:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627974; cv=none; b=rgBwLXo/yq8eTkD7jJbO3k8sgbIY0CP2taZwVsrKnrrQvkXYWbayvKMqfavH+6TyOvFhArlb68/YgCBF1Im4ZoR/TdMho1c33TAR4qso3vkittHL/kR/Ch4dLV1S6xA2i/JgbsIBolxb4tT/31SL7JLYR1tOSCEp3EViJqDJxys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627974; c=relaxed/simple; bh=tC6LGyOBG9pBQHYV+OieRt5sFVsUVitpWNTNIBsS0m8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Tgn8HtTxTf82S6HR7uJKMXuSg8UV7A1VYaHfA9OER7fJ8zY1/nRb4v1mCijJ18nCtZHgDX1ozEAfkggseI+YcECuLlDeFt8KY7b+YAh4Q8NHca1Tv8/iFIGbdr3LbRDh6OmWzoEiuJzwSqZdYVvbbfzdT4Ku2nRZEl6bfMa7WsA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rdEBb-0003OY-3d; Thu, 22 Feb 2024 19:52:47 +0100 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 1rdEBa-002HYr-N9; Thu, 22 Feb 2024 19:52:46 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdEBa-009dAV-22; Thu, 22 Feb 2024 19:52:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" Cc: Len Brown , linux-acpi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 4/7] ACPI: GED: Convert to platform remove callback returning void Date: Thu, 22 Feb 2024 19:52:36 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1576; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=tC6LGyOBG9pBQHYV+OieRt5sFVsUVitpWNTNIBsS0m8=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtTr078/8923sUzX+/cOxSCWuKvdHDWpf+TSv16ZftTSn 8u36NOtTkZjFgZGLgZZMUUW+8Y1mVZVcpGda/9dhhnEygQyhYGLUwAmkubJ/k9VSPDPPrt4xYja MJbqnQrmd7ZEbjjDyxnUspJV53V/q3DK4+JMNSOb2KVcnLV7vnPF8Fdc0OP2M7fr3NfpfIlz6tk q0R/9JQvEWh8bFc3/zSOf4XOl5sOFii6vJUdkndKKd05/sepa1xk56fCZj9zOHFi5PEJyqs7yym /pLMU/+o9LJ10q22Id9ylQ76tnpx1z+vrkD5cKZ2jLz/MTPZzqX8dZVh4fmlt9IoRHtttkS0ter 4b4g6WttfmPuJlDIqb1q7/eNXP2Potb594drJSw0LggVdBYLJz4gOX9beHQ9KBdGwxEZtWI2G7l aG//s+vNbc5753sa5VkMfu/8PddFcZNN38az8guWGdoCAA== 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-acpi@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/acpi/evged.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/evged.c b/drivers/acpi/evged.c index fe6b6792c8bb..11778c93254b 100644 --- a/drivers/acpi/evged.c +++ b/drivers/acpi/evged.c @@ -173,10 +173,9 @@ static void ged_shutdown(struct platform_device *pdev) } } -static int ged_remove(struct platform_device *pdev) +static void ged_remove(struct platform_device *pdev) { ged_shutdown(pdev); - return 0; } static const struct acpi_device_id ged_acpi_ids[] = { @@ -186,7 +185,7 @@ static const struct acpi_device_id ged_acpi_ids[] = { static struct platform_driver ged_driver = { .probe = ged_probe, - .remove = ged_remove, + .remove_new = ged_remove, .shutdown = ged_shutdown, .driver = { .name = MODULE_NAME, From patchwork Thu Feb 22 18:52:37 2024 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: 13567960 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FC49137935 for ; Thu, 22 Feb 2024 18:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627976; cv=none; b=Vd0RG9TmsP/SKQkPHTIlWPWpC7XKq5XsMNU51i/F+p5MkD8+h5zE+A9X65KriE91ZZH08wmxCcaLPDZhb2RP2kya2UPRBGaySaw5ue77CxD3AxqmFXONqGTpLThjCjmDnG2NBqdrg+n05A+iCBEFYaokpI2GIKlV2r6ileV/4z0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627976; c=relaxed/simple; bh=kbRu6kiuAFSJGLp4ReWSVVO3wGX4hp7Hs+F7Mr1LU+4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QIXjIhj41N75Fzl8VclxH9mFShZNkcnDpglc3uI3IT+fQ19cp3RUzwb6+nViL/ORYNRVcDk5i/1ZIwxG+2Tc5XBtfnekQN6Y91OcCNSAUuki8u3vNxewxgjC95rkW1tQ7NaxVI9sLprkReXk4QVzZLF+dDI09shyBHgAFuUk+YU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rdEBb-0003Oq-Dp; Thu, 22 Feb 2024 19:52:47 +0100 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 1rdEBb-002HYv-0u; Thu, 22 Feb 2024 19:52:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdEBa-009dAZ-33; Thu, 22 Feb 2024 19:52:46 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" Cc: Len Brown , linux-acpi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 5/7] ACPI: fan: Convert to platform remove callback returning void Date: Thu, 22 Feb 2024 19:52:37 +0100 Message-ID: <6d0f053791a30817a5c41d561f955abbed1a3ea5.1708627599.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1886; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=kbRu6kiuAFSJGLp4ReWSVVO3wGX4hp7Hs+F7Mr1LU+4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl15f4DsGFYqS3bMZwts/ySguVFfF8mAqMPCbfT 9silfL+YD2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdeX+AAKCRCPgPtYfRL+ TqpZB/4qLFWL4idjGu0OqWvBO5D92KW0TQr5ME2blUaahUFyii2MwsJKXlsbpk8HPH0Lzs9T7Te X2Eboam5Eac7nz0G1AwWoIpQmjM+YF4KO++YbGSl6oO0KbksUh/JnrbeoK7jtw8bbzBxDoyI4PW 46REin5DSu3eERVx3R2MMV5O5QmQToypZoXc8bsgT2MAoJuHbiIRDM7B5tFjhdTf8dUEiw3BIhF JTMkzirBhfkxCvqnZW/HtT92A1NGv5/CGg2VwZ3BfiCeE8N6xw2gDoJfS7g2nVTAkHWIisQq8jS p2QdKG5hEz8U9gPwqphqZDiInRTeWhbB+Hv7Rw9cBgThlqmI 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-acpi@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/acpi/fan_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c index 9dccbae9e8ea..ff72e4ef8738 100644 --- a/drivers/acpi/fan_core.c +++ b/drivers/acpi/fan_core.c @@ -387,7 +387,7 @@ static int acpi_fan_probe(struct platform_device *pdev) return result; } -static int acpi_fan_remove(struct platform_device *pdev) +static void acpi_fan_remove(struct platform_device *pdev) { struct acpi_fan *fan = platform_get_drvdata(pdev); @@ -399,8 +399,6 @@ static int acpi_fan_remove(struct platform_device *pdev) sysfs_remove_link(&pdev->dev.kobj, "thermal_cooling"); sysfs_remove_link(&fan->cdev->device.kobj, "device"); thermal_cooling_device_unregister(fan->cdev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -446,7 +444,7 @@ static const struct dev_pm_ops acpi_fan_pm = { static struct platform_driver acpi_fan_driver = { .probe = acpi_fan_probe, - .remove = acpi_fan_remove, + .remove_new = acpi_fan_remove, .driver = { .name = "acpi-fan", .acpi_match_table = fan_device_ids, From patchwork Thu Feb 22 18:52:38 2024 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: 13567957 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A13D6137936 for ; Thu, 22 Feb 2024 18:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627975; cv=none; b=jx1iQf2tlvDElbH2QdidKLxvCSJzQ4sQNMEn6ndA7GyGDraTIYynT0dcsMid7nBVX4j6UIgBDqgYpvGuvgzmq4sTE1w0DTq6pruWWwl4ey9IwMBN1ZccAle6rJFR9gN5pTRGxQwCVSjCM4qErBA0Sc3uQsAUiFLcyJNJC1yN+/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627975; c=relaxed/simple; bh=zkXscEoH0Q82iZztdZMS8EwIjD1KMwTzAjbBuxTWu1U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=J1VaVcuovniHPLr9//ELqrBsb3DM/URs+onXNTVoo8iDxvJGGXstXCOWTzlIqcOPZ9PCLPGf4QgIpd5SC8it0GQghZJGuDIGW3cVzVsHX2Xf2RTjuWBZLp0N9xZkutpuEkrZ21RcLkTlykVQXHILULigbY7VBwlrKcKrbcEh6rU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rdEBb-0003Os-Kz; Thu, 22 Feb 2024 19:52:47 +0100 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 1rdEBb-002HYz-7A; Thu, 22 Feb 2024 19:52:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdEBb-009dAd-0P; Thu, 22 Feb 2024 19:52:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" Cc: Len Brown , linux-acpi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 6/7] ACPI: pfr_telemetry: Convert to platform remove callback returning void Date: Thu, 22 Feb 2024 19:52:38 +0100 Message-ID: <50355bb24c6a5f9c6cc3b0be0182926813795726.1708627599.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1766; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=zkXscEoH0Q82iZztdZMS8EwIjD1KMwTzAjbBuxTWu1U=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl15f5D3JIAaLxZE1xUlOoOINlgYkh5retjxv2q MbVWDUBVC+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdeX+QAKCRCPgPtYfRL+ TsZZB/4gukvJHRUninNjy43DAbXJwRGZ2iH9N/kzfp7+kdOv0zr6LFDEq+OQgRAj0lpz5GeG7MI qC8bTILyOqbcrpYow0LMMS88cKwOC9rmH9noj99jLacFSkKkMhiMjFVdNH4XQeLuFXX3XW5EJGU /5/sdiqlpsnknC8InYnm+cPoZttZXXB6/FsZ8QCzi6GoZfs2DXVYNofWckjpqTseoKTx+gskJnt LEGsLkmO26NAkmOQNM8PSk/g8ZeuKUbhJ/WOFU7pv5yfj26PmU52O3dAxdDTAiysaRNycyWEi2i Ae/lbDZ3grKl8skemXhedu2cyfy7v4V2u7dCzbXNmw2LT1fE 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-acpi@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/acpi/pfr_telemetry.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/pfr_telemetry.c b/drivers/acpi/pfr_telemetry.c index 843f678ade0c..998264a7333d 100644 --- a/drivers/acpi/pfr_telemetry.c +++ b/drivers/acpi/pfr_telemetry.c @@ -347,13 +347,11 @@ static const struct file_operations acpi_pfrt_log_fops = { .llseek = noop_llseek, }; -static int acpi_pfrt_log_remove(struct platform_device *pdev) +static void acpi_pfrt_log_remove(struct platform_device *pdev) { struct pfrt_log_device *pfrt_log_dev = platform_get_drvdata(pdev); misc_deregister(&pfrt_log_dev->miscdev); - - return 0; } static void pfrt_log_put_idx(void *data) @@ -427,7 +425,7 @@ static struct platform_driver acpi_pfrt_log_driver = { .acpi_match_table = acpi_pfrt_log_ids, }, .probe = acpi_pfrt_log_probe, - .remove = acpi_pfrt_log_remove, + .remove_new = acpi_pfrt_log_remove, }; module_platform_driver(acpi_pfrt_log_driver); From patchwork Thu Feb 22 18:52:39 2024 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: 13567959 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B509E13793D for ; Thu, 22 Feb 2024 18:52:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627976; cv=none; b=mf0v0zYd9dHvEIVhwK5x2AIO+LmZphkx2MkTjeOJpw+CZPEiLgCe+/c8GLal/nqXCTBsmgLfo0l/U9o66ImGvEkzI1B60ve1m2fW62g30uksxQpfbYkQ6VQkATH3QPsVxEKYOAD3+Vf+epW+fgTzu5zZPVRgshvYAM6JR5Kz5/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627976; c=relaxed/simple; bh=e/BnsPbUNcAHFTR9McwzEhuDJgjW1zHEVsVkDj6jMYI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DyO/JbSnFPAfOTjER6h1xoPQT6S6iMJBqHgCfuHHpV0wKRMmpBbYr66HHW9ITwjCLIg8enkbKxlTLN6j82Z04qXIythncXI0FeKYllnBN2ZsZCdqyFedvyE2oVi0Ze5Z1ZJb5fBGZUNm9Huu3DqRpBs5jjpNxcBhvRLXPqv0ddg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rdEBb-0003P7-Ua; Thu, 22 Feb 2024 19:52:47 +0100 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 1rdEBb-002HZ3-HU; Thu, 22 Feb 2024 19:52:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdEBb-009dAh-1U; Thu, 22 Feb 2024 19:52:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" Cc: Len Brown , linux-acpi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 7/7] ACPI: pfr_update: Convert to platform remove callback returning void Date: Thu, 22 Feb 2024 19:52:39 +0100 Message-ID: <322bdb682c4bbcdbe14fef0689851466b631f752.1708627599.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1699; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=e/BnsPbUNcAHFTR9McwzEhuDJgjW1zHEVsVkDj6jMYI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl15f6FB00xcRSZGODhMUaoDneUf2wvkgDfVI72 ai7+yYZn5eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdeX+gAKCRCPgPtYfRL+ ThXuB/wP/WK+2qGfjwoyQWpHBO5KHg5iICW2S1ODbHBI8TJs8ooyS+4GdJy6K5Y2v2S/WMiUSc7 N3hsBlFJpOzmmpqD+sybf0OcrTYn+u8lczfJnH+FaM4pb2vxv/zAgoHM60624WMefeM1Sag6713 04B7uUEGEliFGs9JNNJWVTsDTgMjdM8Pkf90UpPX/pQQl0ph2x/wt1pwEw2Cg+CETTky5V6IJB8 UprPPncSAoS3AOMD5J2QtBs7JrAAfA0xoFhLeMvyWIsVbbIqMAuKQd35areCNt+iyJGbrKs77Uo eaqJmq/WAUEarxXSwna7sp1yH7x5mBJDsptvLA4+uQKh2DQF 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-acpi@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/acpi/pfr_update.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/pfr_update.c b/drivers/acpi/pfr_update.c index 98267f163e2b..8b2910995fc1 100644 --- a/drivers/acpi/pfr_update.c +++ b/drivers/acpi/pfr_update.c @@ -489,13 +489,11 @@ static const struct file_operations acpi_pfru_fops = { .llseek = noop_llseek, }; -static int acpi_pfru_remove(struct platform_device *pdev) +static void acpi_pfru_remove(struct platform_device *pdev) { struct pfru_device *pfru_dev = platform_get_drvdata(pdev); misc_deregister(&pfru_dev->miscdev); - - return 0; } static void pfru_put_idx(void *data) @@ -567,7 +565,7 @@ static struct platform_driver acpi_pfru_driver = { .acpi_match_table = acpi_pfru_ids, }, .probe = acpi_pfru_probe, - .remove = acpi_pfru_remove, + .remove_new = acpi_pfru_remove, }; module_platform_driver(acpi_pfru_driver);