Skip to content

Commit

Permalink
clk: wm831x: Fix clk_register() error code checking
Browse files Browse the repository at this point in the history
clk_register() returns an ERR_PTR upon failure, not NULL. Fix
these error paths.

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
  • Loading branch information
Stephen Boyd authored and Mike Turquette committed Oct 29, 2012
1 parent bcd6f56 commit 980f58a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/clk/clk-wm831x.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,20 +371,20 @@ static __devinit int wm831x_clk_probe(struct platform_device *pdev)

clkdata->xtal_hw.init = &wm831x_xtal_init;
clkdata->xtal = clk_register(&pdev->dev, &clkdata->xtal_hw);
if (!clkdata->xtal)
return -EINVAL;
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 (!clkdata->fll) {
ret = -EINVAL;
if (IS_ERR(clkdata->fll)) {
ret = PTR_ERR(clkdata->fll);
goto err_xtal;
}

clkdata->clkout_hw.init = &wm831x_clkout_init;
clkdata->clkout = clk_register(&pdev->dev, &clkdata->clkout_hw);
if (!clkdata->clkout) {
ret = -EINVAL;
if (IS_ERR(clkdata->clkout)) {
ret = PTR_ERR(clkdata->clkout);
goto err_fll;
}

Expand Down

0 comments on commit 980f58a

Please sign in to comment.