Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b386574 authored by Tero Kristo's avatar Tero Kristo Committed by Guenter Roeck
Browse files

watchdog: davinci: add support for deferred probing



devm_clk_get can fail with EPROBE_DEFER in case the clock provider is
not ready yet. Handle this case gracefully, rather than dumping out
a huge warning.

Signed-off-by: default avatarTero Kristo <t-kristo@ti.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 807f0b2d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -166,8 +166,12 @@ static int davinci_wdt_probe(struct platform_device *pdev)
		return -ENOMEM;

	davinci_wdt->clk = devm_clk_get(dev, NULL);
	if (WARN_ON(IS_ERR(davinci_wdt->clk)))

	if (IS_ERR(davinci_wdt->clk)) {
		if (PTR_ERR(davinci_wdt->clk) != -EPROBE_DEFER)
			dev_err(&pdev->dev, "failed to get clock node\n");
		return PTR_ERR(davinci_wdt->clk);
	}

	clk_prepare_enable(davinci_wdt->clk);