Skip to content

Commit bfa8370

Browse files
Uwe Kleine-Königbebarino
authored andcommitted
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>
1 parent 8ad00c1 commit bfa8370

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

drivers/clk/hisilicon/clk-hi3519.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,12 @@ static int hi3519_clk_probe(struct platform_device *pdev)
162162
return 0;
163163
}
164164

165-
static int hi3519_clk_remove(struct platform_device *pdev)
165+
static void hi3519_clk_remove(struct platform_device *pdev)
166166
{
167167
struct hi3519_crg_data *crg = platform_get_drvdata(pdev);
168168

169169
hisi_reset_exit(crg->rstc);
170170
hi3519_clk_unregister(pdev);
171-
return 0;
172171
}
173172

174173

@@ -180,7 +179,7 @@ MODULE_DEVICE_TABLE(of, hi3519_clk_match_table);
180179

181180
static struct platform_driver hi3519_clk_driver = {
182181
.probe = hi3519_clk_probe,
183-
.remove = hi3519_clk_remove,
182+
.remove_new = hi3519_clk_remove,
184183
.driver = {
185184
.name = "hi3519-clk",
186185
.of_match_table = hi3519_clk_match_table,

drivers/clk/hisilicon/clk-hi3559a.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -810,18 +810,17 @@ static int hi3559av100_crg_probe(struct platform_device *pdev)
810810
return 0;
811811
}
812812

813-
static int hi3559av100_crg_remove(struct platform_device *pdev)
813+
static void hi3559av100_crg_remove(struct platform_device *pdev)
814814
{
815815
struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
816816

817817
hisi_reset_exit(crg->rstc);
818818
crg->funcs->unregister_clks(pdev);
819-
return 0;
820819
}
821820

822821
static struct platform_driver hi3559av100_crg_driver = {
823822
.probe = hi3559av100_crg_probe,
824-
.remove = hi3559av100_crg_remove,
823+
.remove_new = hi3559av100_crg_remove,
825824
.driver = {
826825
.name = "hi3559av100-clock",
827826
.of_match_table = hi3559av100_crg_match_table,

drivers/clk/hisilicon/crg-hi3516cv300.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,18 +284,17 @@ static int hi3516cv300_crg_probe(struct platform_device *pdev)
284284
return 0;
285285
}
286286

287-
static int hi3516cv300_crg_remove(struct platform_device *pdev)
287+
static void hi3516cv300_crg_remove(struct platform_device *pdev)
288288
{
289289
struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
290290

291291
hisi_reset_exit(crg->rstc);
292292
crg->funcs->unregister_clks(pdev);
293-
return 0;
294293
}
295294

296295
static struct platform_driver hi3516cv300_crg_driver = {
297296
.probe = hi3516cv300_crg_probe,
298-
.remove = hi3516cv300_crg_remove,
297+
.remove_new = hi3516cv300_crg_remove,
299298
.driver = {
300299
.name = "hi3516cv300-crg",
301300
.of_match_table = hi3516cv300_crg_match_table,

drivers/clk/hisilicon/crg-hi3798cv200.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,18 +367,17 @@ static int hi3798cv200_crg_probe(struct platform_device *pdev)
367367
return 0;
368368
}
369369

370-
static int hi3798cv200_crg_remove(struct platform_device *pdev)
370+
static void hi3798cv200_crg_remove(struct platform_device *pdev)
371371
{
372372
struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
373373

374374
hisi_reset_exit(crg->rstc);
375375
crg->funcs->unregister_clks(pdev);
376-
return 0;
377376
}
378377

379378
static struct platform_driver hi3798cv200_crg_driver = {
380379
.probe = hi3798cv200_crg_probe,
381-
.remove = hi3798cv200_crg_remove,
380+
.remove_new = hi3798cv200_crg_remove,
382381
.driver = {
383382
.name = "hi3798cv200-crg",
384383
.of_match_table = hi3798cv200_crg_match_table,

0 commit comments

Comments
 (0)