watchdog: davinci: Handle return value of clk_prepare_enable

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
This commit is contained in:
Arvind Yadav 2017-06-06 15:47:53 +05:30 • committed by Wim Van Sebroeck
commit 8f11eb58ad

View file

@ -173,7 +173,11 @@ static int davinci_wdt_probe(struct platform_device *pdev)
return PTR_ERR(davinci_wdt->clk);
}
clk_prepare_enable(davinci_wdt->clk);
ret = clk_prepare_enable(davinci_wdt->clk);
if (ret) {
dev_err(&pdev->dev, "failed to prepare clock\n");
return ret;
}
platform_set_drvdata(pdev, davinci_wdt);