summaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-04-23 10:06:58 +0200
committerSuzuki K Poulose <suzuki.poulose@arm.com>2024-04-25 11:07:16 +0200
commitc01cb419104c4187f2a148f72a7dcc67e77801a5 (patch)
treec8f69300e4f308325f29cbfaeb891558455ee2a9 /drivers/hwtracing
parentcoresight: Remove duplicate linux/amba/bus.h header (diff)
downloadlinux-c01cb419104c4187f2a148f72a7dcc67e77801a5.tar.xz
linux-c01cb419104c4187f2a148f72a7dcc67e77801a5.zip
coresight: catu: Convert to platform remove callback returning void
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. Fixes: 23567323857d ("coresight: catu: Move ACPI support from AMBA driver to platform driver") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/16a7123efa7d97ae62a02ccbf9b39d146b066860.1713858615.git.u.kleine-koenig@pengutronix.de
Diffstat (limited to 'drivers/hwtracing')
-rw-r--r--drivers/hwtracing/coresight/coresight-catu.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c
index 9712be6acd26..02d9daf265d6 100644
--- a/drivers/hwtracing/coresight/coresight-catu.c
+++ b/drivers/hwtracing/coresight/coresight-catu.c
@@ -642,18 +642,17 @@ static int catu_platform_probe(struct platform_device *pdev)
return ret;
}
-static int catu_platform_remove(struct platform_device *pdev)
+static void catu_platform_remove(struct platform_device *pdev)
{
struct catu_drvdata *drvdata = dev_get_drvdata(&pdev->dev);
if (WARN_ON(!drvdata))
- return -ENODEV;
+ return;
__catu_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
if (!IS_ERR_OR_NULL(drvdata->pclk))
clk_put(drvdata->pclk);
- return 0;
}
#ifdef CONFIG_PM
@@ -691,7 +690,7 @@ MODULE_DEVICE_TABLE(acpi, catu_acpi_ids);
static struct platform_driver catu_platform_driver = {
.probe = catu_platform_probe,
- .remove = catu_platform_remove,
+ .remove_new = catu_platform_remove,
.driver = {
.name = "coresight-catu-platform",
.acpi_match_table = ACPI_PTR(catu_acpi_ids),