Commit 980f58a4 authored by Stephen Boyd's avatar Stephen Boyd Committed by Mike Turquette

clk: wm831x: Fix clk_register() error code checking

clk_register() returns an ERR_PTR upon failure, not NULL. Fix
these error paths.
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
parent bcd6f569
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment