aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/clk/hisilicon/crg-hi3798cv200.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-12 17:14:59 +0100
committerStephen Boyd <sboyd@kernel.org>2023-03-28 19:23:38 -0700
commitbfa8370b283d5791e3667c0f8041a4b4f8af6c82 (patch)
tree6b8ebb2ebe8ab2979af7e952127610380aa1a8ba /drivers/clk/hisilicon/crg-hi3798cv200.c
parentclk: stm32mp1: Convert to platform remove callback returning void (diff)
downloadwireguard-linux-bfa8370b283d5791e3667c0f8041a4b4f8af6c82.tar.xz
wireguard-linux-bfa8370b283d5791e3667c0f8041a4b4f8af6c82.zip
clk: hisilicon: 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 (mostly) ignored 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. 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> Link: https://lore.kernel.org/r/20230312161512.2715500-18-u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/hisilicon/crg-hi3798cv200.c')
-rw-r--r--drivers/clk/hisilicon/crg-hi3798cv200.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/clk/hisilicon/crg-hi3798cv200.c b/drivers/clk/hisilicon/crg-hi3798cv200.c
index 08a19ba776e6..a0b16be1e25d 100644
--- a/drivers/clk/hisilicon/crg-hi3798cv200.c
+++ b/drivers/clk/hisilicon/crg-hi3798cv200.c
@@ -367,18 +367,17 @@ static int hi3798cv200_crg_probe(struct platform_device *pdev)
return 0;
}
-static int hi3798cv200_crg_remove(struct platform_device *pdev)
+static void hi3798cv200_crg_remove(struct platform_device *pdev)
{
struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
hisi_reset_exit(crg->rstc);
crg->funcs->unregister_clks(pdev);
- return 0;
}
static struct platform_driver hi3798cv200_crg_driver = {
.probe = hi3798cv200_crg_probe,
- .remove = hi3798cv200_crg_remove,
+ .remove_new = hi3798cv200_crg_remove,
.driver = {
.name = "hi3798cv200-crg",
.of_match_table = hi3798cv200_crg_match_table,