clk: shmobile: check for failure
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Tue, 23 Feb 2016 09:30:03 +0000 (15:00 +0530)
committerStephen Boyd <sboyd@codeaurora.org>
Wed, 24 Feb 2016 23:01:42 +0000 (15:01 -0800)
We were not checking the return from devm_add_action() which can fail.
Start using the helper devm_add_action_or_reset() and return directly
as we know that the cleanup has been done by this helper.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/shmobile/renesas-cpg-mssr.c

index 9a4d888164bb3082870ea535aaf783675ae9df23..925b6007e531cd5afacc7b68dec1afa7444f7b0d 100644 (file)
@@ -568,7 +568,11 @@ static int __init cpg_mssr_probe(struct platform_device *pdev)
        if (error)
                return error;
 
-       devm_add_action(dev, cpg_mssr_del_clk_provider, np);
+       error = devm_add_action_or_reset(dev,
+                                        cpg_mssr_del_clk_provider,
+                                        np);
+       if (error)
+               return error;
 
        error = cpg_mssr_add_clk_domain(dev, info->core_pm_clks,
                                        info->num_core_pm_clks);