Skip to content

Commit ce1c5f8

Browse files
Uwe Kleine-Königbebarino
authored andcommitted
clk: xilinx: 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-31-u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 4690d24 commit ce1c5f8

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

drivers/clk/xilinx/clk-xlnx-clock-wizard.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ static int clk_wzrd_probe(struct platform_device *pdev)
593593
return ret;
594594
}
595595

596-
static int clk_wzrd_remove(struct platform_device *pdev)
596+
static void clk_wzrd_remove(struct platform_device *pdev)
597597
{
598598
int i;
599599
struct clk_wzrd *clk_wzrd = platform_get_drvdata(pdev);
@@ -611,8 +611,6 @@ static int clk_wzrd_remove(struct platform_device *pdev)
611611
}
612612

613613
clk_disable_unprepare(clk_wzrd->axi_clk);
614-
615-
return 0;
616614
}
617615

618616
static const struct of_device_id clk_wzrd_ids[] = {
@@ -630,7 +628,7 @@ static struct platform_driver clk_wzrd_driver = {
630628
.pm = &clk_wzrd_dev_pm_ops,
631629
},
632630
.probe = clk_wzrd_probe,
633-
.remove = clk_wzrd_remove,
631+
.remove_new = clk_wzrd_remove,
634632
};
635633
module_platform_driver(clk_wzrd_driver);
636634

drivers/clk/xilinx/xlnx_vcu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ static int xvcu_probe(struct platform_device *pdev)
702702
* Return: Returns 0 on success
703703
* Negative error code otherwise
704704
*/
705-
static int xvcu_remove(struct platform_device *pdev)
705+
static void xvcu_remove(struct platform_device *pdev)
706706
{
707707
struct xvcu_device *xvcu;
708708

@@ -714,8 +714,6 @@ static int xvcu_remove(struct platform_device *pdev)
714714
regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, 0);
715715

716716
clk_disable_unprepare(xvcu->aclk);
717-
718-
return 0;
719717
}
720718

721719
static const struct of_device_id xvcu_of_id_table[] = {
@@ -731,7 +729,7 @@ static struct platform_driver xvcu_driver = {
731729
.of_match_table = xvcu_of_id_table,
732730
},
733731
.probe = xvcu_probe,
734-
.remove = xvcu_remove,
732+
.remove_new = xvcu_remove,
735733
};
736734

737735
module_platform_driver(xvcu_driver);

0 commit comments

Comments
 (0)