From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 05/15] intel_th: Convert to platform remove callback returning void
Date: Mon, 29 Apr 2024 16:01:09 +0300 [thread overview]
Message-ID: <20240429130119.1518073-6-alexander.shishkin@linux.intel.com> (raw)
In-Reply-To: <20240429130119.1518073-1-alexander.shishkin@linux.intel.com>
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
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 <u.kleine-koenig@pengutronix.de>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/hwtracing/intel_th/acpi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/hwtracing/intel_th/acpi.c b/drivers/hwtracing/intel_th/acpi.c
index 87f9024e4bbb..503620e9fd10 100644
--- a/drivers/hwtracing/intel_th/acpi.c
+++ b/drivers/hwtracing/intel_th/acpi.c
@@ -60,18 +60,16 @@ static int intel_th_acpi_probe(struct platform_device *pdev)
return 0;
}
-static int intel_th_acpi_remove(struct platform_device *pdev)
+static void intel_th_acpi_remove(struct platform_device *pdev)
{
struct intel_th *th = platform_get_drvdata(pdev);
intel_th_free(th);
-
- return 0;
}
static struct platform_driver intel_th_acpi_driver = {
.probe = intel_th_acpi_probe,
- .remove = intel_th_acpi_remove,
+ .remove_new = intel_th_acpi_remove,
.driver = {
.name = DRIVER_NAME,
.acpi_match_table = intel_th_acpi_ids,
--
2.43.0
next prev parent reply other threads:[~2024-04-29 13:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 13:01 [PATCH v1 00/15] stm class/intel_th: Updates for v6.10 Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 01/15] stm class: Fix a double free in stm_register_device() Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 02/15] stm class: Add source type Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 03/15] stm class: Propagate source type to protocols Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 04/15] stm class: sys-t: Improve ftrace source handling Alexander Shishkin
2024-04-29 13:01 ` Alexander Shishkin [this message]
2024-04-29 13:01 ` [PATCH v1 06/15] intel_th: Constify the struct device_type usage Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 07/15] intel_th: Convert sprintf/snprintf to sysfs_emit Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 08/15] intel_th: Remove redundant initialization of pointer outp Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 09/15] intel_th: msu: Fix kernel-doc warnings Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 10/15] intel_th: pci: Add Granite Rapids support Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 11/15] intel_th: pci: Add Granite Rapids SOC support Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 12/15] intel_th: pci: Add Sapphire " Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 13/15] intel_th: pci: Add Meteor Lake-S support Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 14/15] intel_th: pci: Add Meteor Lake-S CPU support Alexander Shishkin
2024-04-29 13:01 ` [PATCH v1 15/15] intel_th: pci: Add Lunar Lake support Alexander Shishkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240429130119.1518073-6-alexander.shishkin@linux.intel.com \
--to=alexander.shishkin@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®