From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758706AbbJHVfh (ORCPT ); Thu, 8 Oct 2015 17:35:37 -0400 Received: from mx-guillaumet.finsecur.com ([91.217.234.131]:57531 "EHLO guillaumet.finsecur.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758640AbbJHVeo (ORCPT ); Thu, 8 Oct 2015 17:34:44 -0400 From: Sylvain Rochet To: Guenter Roeck , Boris BREZILLON , linux-kernel@vger.kernel.org, Nicolas Ferre , Ludovic Desroches , linux-arm-kernel@lists.infradead.org, Alexandre Belloni , Wenyou Yang , Wim Van Sebroeck Cc: Sylvain Rochet Date: Thu, 8 Oct 2015 23:34:34 +0200 Message-Id: <1444340074-15437-7-git-send-email-sylvain.rochet@finsecur.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1444340074-15437-1-git-send-email-sylvain.rochet@finsecur.com> References: <1444340074-15437-1-git-send-email-sylvain.rochet@finsecur.com> X-SA-Exim-Connect-IP: 172.16.8.13 X-SA-Exim-Mail-From: sylvain.rochet@finsecur.com Subject: [PATCH 6/6] watchdog: sama5d4: try to set timeout from device tree first X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on guillaumet.finsecur.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org watchdog_init_timeout function doesn't try to get the "timeout-sec" DT property if timeout_parm is not zero. This change makes this DT property working for the sama5d4 watchdog driver. Signed-off-by: Sylvain Rochet --- drivers/watchdog/sama5d4_wdt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/sama5d4_wdt.c b/drivers/watchdog/sama5d4_wdt.c index a49634c..2e2049b 100644 --- a/drivers/watchdog/sama5d4_wdt.c +++ b/drivers/watchdog/sama5d4_wdt.c @@ -222,7 +222,10 @@ static int sama5d4_wdt_probe(struct platform_device *pdev) } } - ret = watchdog_init_timeout(wdd, wdt_timeout, &pdev->dev); + /* Try to set timeout from device tree first */ + ret = watchdog_init_timeout(wdd, 0, &pdev->dev); + if (ret) + ret = watchdog_init_timeout(wdd, wdt_timeout, &pdev->dev); if (ret) { dev_err(&pdev->dev, "unable to set timeout value\n"); return ret; @@ -243,7 +246,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev) platform_set_drvdata(pdev, wdt); dev_info(&pdev->dev, "initialized (timeout = %d sec, nowayout = %d)\n", - wdt_timeout, nowayout); + wdd->timeout, nowayout); return 0; } -- 2.5.1