From patchwork Thu Nov 24 12:58:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 83894 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp106564qgi; Thu, 24 Nov 2016 04:59:59 -0800 (PST) X-Received: by 10.84.195.1 with SMTP id i1mr5115430pld.84.1479992399112; Thu, 24 Nov 2016 04:59:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si21635233pgz.138.2016.11.24.04.59.58 for ; Thu, 24 Nov 2016 04:59:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938589AbcKXM76 (ORCPT ); Thu, 24 Nov 2016 07:59:58 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:47082 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938576AbcKXM76 (ORCPT ); Thu, 24 Nov 2016 07:59:58 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id uAOCwUZw012885; Thu, 24 Nov 2016 06:58:30 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id uAOCwUmA029743; Thu, 24 Nov 2016 06:58:30 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Thu, 24 Nov 2016 06:58:29 -0600 Received: from gomoku.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id uAOCwR6R022361; Thu, 24 Nov 2016 06:58:28 -0600 From: Tero Kristo To: CC: , Subject: [PATCH] watchdog: davinci: add support for deferred probing Date: Thu, 24 Nov 2016 14:58:28 +0200 Message-ID: <1479992308-27473-1-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org 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 --- drivers/watchdog/davinci_wdt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Guenter Roeck diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index 17454ca..0e731d7 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c @@ -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);