Skip to content

Commit c954cd7

Browse files
committed
soc/tegra: pmc: Use devm_clk_notifier_register()
Move to the device-managed version of clk_notifier_register() to remove the need for manual cleanup. This fixes a potential issue where the clock notifier would stick around after the driver fails to probe at a later point. Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent bae9fb2 commit c954cd7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/soc/tegra/pmc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2992,7 +2992,8 @@ static int tegra_pmc_probe(struct platform_device *pdev)
29922992
*/
29932993
if (pmc->clk) {
29942994
pmc->clk_nb.notifier_call = tegra_pmc_clk_notify_cb;
2995-
err = clk_notifier_register(pmc->clk, &pmc->clk_nb);
2995+
err = devm_clk_notifier_register(&pdev->dev, pmc->clk,
2996+
&pmc->clk_nb);
29962997
if (err) {
29972998
dev_err(&pdev->dev,
29982999
"failed to register clk notifier\n");
@@ -3052,7 +3053,6 @@ static int tegra_pmc_probe(struct platform_device *pdev)
30523053
cleanup_sysfs:
30533054
device_remove_file(&pdev->dev, &dev_attr_reset_reason);
30543055
device_remove_file(&pdev->dev, &dev_attr_reset_level);
3055-
clk_notifier_unregister(pmc->clk, &pmc->clk_nb);
30563056

30573057
return err;
30583058
}

0 commit comments

Comments
 (0)