Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Tero Kristo <t-kristo@ti.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Tero Kristo and committed by
Guenter Roeck
9b386574 807f0b2d

+5 -1
+5 -1
drivers/watchdog/davinci_wdt.c
··· 166 166 return -ENOMEM; 167 167 168 168 davinci_wdt->clk = devm_clk_get(dev, NULL); 169 - if (WARN_ON(IS_ERR(davinci_wdt->clk))) 169 + 170 + if (IS_ERR(davinci_wdt->clk)) { 171 + if (PTR_ERR(davinci_wdt->clk) != -EPROBE_DEFER) 172 + dev_err(&pdev->dev, "failed to get clock node\n"); 170 173 return PTR_ERR(davinci_wdt->clk); 174 + } 171 175 172 176 clk_prepare_enable(davinci_wdt->clk); 173 177