summaryrefslogtreecommitdiff
path: root/drivers/clk/clk-wm831x.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2012-09-24 13:38:05 -0700
committerMike Turquette <mturquette@linaro.org>2012-10-29 11:12:55 -0700
commit9be9d482bcf5a0a3e0ae131a98573b9e2d358915 (patch)
tree7bacf94da9d214eadd0b74d19c558428e2e4f8c6 /drivers/clk/clk-wm831x.c
parent46c8773a58010d31f228e148b8b774d94cc9810d (diff)
clk: wm831x: Use devm_clk_register() to simplify code
Move this driver to use devm_clk_register() to simplify some error paths and reduce lines of code. Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/clk-wm831x.c')
-rw-r--r--drivers/clk/clk-wm831x.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/clk/clk-wm831x.c b/drivers/clk/clk-wm831x.c
index eb1afafca037..db4fbf20ffd7 100644
--- a/drivers/clk/clk-wm831x.c
+++ b/drivers/clk/clk-wm831x.c
@@ -370,43 +370,27 @@ static __devinit int wm831x_clk_probe(struct platform_device *pdev)
clkdata->xtal_ena = ret & WM831X_XTAL_ENA;
clkdata->xtal_hw.init = &wm831x_xtal_init;
- clkdata->xtal = clk_register(&pdev->dev, &clkdata->xtal_hw);
+ clkdata->xtal = devm_clk_register(&pdev->dev, &clkdata->xtal_hw);
if (IS_ERR(clkdata->xtal))
return PTR_ERR(clkdata->xtal);
clkdata->fll_hw.init = &wm831x_fll_init;
- clkdata->fll = clk_register(&pdev->dev, &clkdata->fll_hw);
- if (IS_ERR(clkdata->fll)) {
- ret = PTR_ERR(clkdata->fll);
- goto err_xtal;
- }
+ clkdata->fll = devm_clk_register(&pdev->dev, &clkdata->fll_hw);
+ if (IS_ERR(clkdata->fll))
+ return PTR_ERR(clkdata->fll);
clkdata->clkout_hw.init = &wm831x_clkout_init;
- clkdata->clkout = clk_register(&pdev->dev, &clkdata->clkout_hw);
- if (IS_ERR(clkdata->clkout)) {
- ret = PTR_ERR(clkdata->clkout);
- goto err_fll;
- }
+ clkdata->clkout = devm_clk_register(&pdev->dev, &clkdata->clkout_hw);
+ if (IS_ERR(clkdata->clkout))
+ return PTR_ERR(clkdata->clkout);
dev_set_drvdata(&pdev->dev, clkdata);
return 0;
-
-err_fll:
- clk_unregister(clkdata->fll);
-err_xtal:
- clk_unregister(clkdata->xtal);
- return ret;
}
static int __devexit wm831x_clk_remove(struct platform_device *pdev)
{
- struct wm831x_clk *clkdata = dev_get_drvdata(&pdev->dev);
-
- clk_unregister(clkdata->clkout);
- clk_unregister(clkdata->fll);
- clk_unregister(clkdata->xtal);
-
return 0;
}