Received: by 10.223.185.116 with SMTP id b49csp21442wrg; Sat, 10 Feb 2018 01:22:39 -0800 (PST) X-Google-Smtp-Source: AH8x227MBuE2S44gTavjv4WcJy1UdFk1yuBDHL5C9ie+zgJZJYC8Ou46nh03obwJhOr9gT868bsL X-Received: by 2002:a17:902:4383:: with SMTP id j3-v6mr5043835pld.320.1518254559679; Sat, 10 Feb 2018 01:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518254559; cv=none; d=google.com; s=arc-20160816; b=v9dX2RQ6yK+R/qgcFftUYghdy3OAVLSTT3IhUbR9XB2JdIEf8YCXcTv6p+zEoE170C gNvtZjAZmzjZvGHqzqTyMODSvAobNH1rh0WkXg3+XlcQve5G81xMY6KXQ41oVuUwle4h 3Cdg1OVqy5DEC/WpyhHLsS3S9wO8DzFWZKAm2wqSOHARLJ476UTK20CccMprJinQjWQa D0pVIi1U0naFCpx/y5cYzzG6AJiUZhfkGTuwhmMErI8S2SLy3l94lMQyOTcFmnj8R0S9 V/zMDceXUsKAvceDXt/FscUT6pO2hUjOZFVFPEDW3b1A3M1tPxdTLgaeoXIFxizMKjJH fAOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=8YcBHPSO6OHE3zPi/Lolt6I4qqC5i6SjQDa3lBvJSJo=; b=NTnAP7LC5Y56ANKYishVG8Giucz65EiaukEycq2zWIqXVCtrTEU1n95MmHVR4/Cibk aGna+VpiIrA6ha0QWo1SCvsmbWHM+tTJ7abiE7MbkxO6gmg4L/29zVpda1YHDeivuuHt ditsjA/HmqBQBvoV2R9VgcJsOe5aD1lJIt6aLIu5sjEPFJIbBo2fNLj4onaS3AXe6ntc Z/0KiQSN/kVIjppVQGbbQjcVXKG6ObonuFqwbgfZISBXM6AxZSJHwUEJDoVMVV+I3cHU 7vM/FUlgN218v4UkMHjTTzqPIqVuxDDbQtCnpGnKMHuRx1RHlT78mF9itWuYMU97eisE f7bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HeDMO9Z0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si2494285pgq.785.2018.02.10.01.22.25; Sat, 10 Feb 2018 01:22:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HeDMO9Z0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752384AbeBJJUx (ORCPT + 99 others); Sat, 10 Feb 2018 04:20:53 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:44650 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750909AbeBJJTe (ORCPT ); Sat, 10 Feb 2018 04:19:34 -0500 Received: by mail-lf0-f68.google.com with SMTP id r143so2087273lfr.11; Sat, 10 Feb 2018 01:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8YcBHPSO6OHE3zPi/Lolt6I4qqC5i6SjQDa3lBvJSJo=; b=HeDMO9Z0bNlTCCfLfkhE2gODToljlbB4Am8Xtss9M3w58w/+h3EtDki53xSTQHkJ+4 8esPGC+stZ/kWHnZx9uNKQfiUW0elOrm+IxirLrGeea+HwegHVOS3mo7E1aj9QZSC6Ls zWfAkgKLQYEisvX1hdLX4EXcQo45OReQIvXAtlcyY3n8IFuOH2+o+6gRQpnHtKK5ViZ3 vrdkWE4lkhQDfyUwXXVXw6LZcKt82j5QuAgu1KEIcJho/mc8FWtE/11zHXf/RZW7Pweh IY+rAcu77CX6wVG754KcxQWMvaydxxIuj2ytq5bf332RcyQG1yIHcKcaQVkt0ne3l+Mi e0hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8YcBHPSO6OHE3zPi/Lolt6I4qqC5i6SjQDa3lBvJSJo=; b=gapv3vIzKDN2zZoVBLB0nMMSa9M2F55udQzDChaMZs5cYQGrDnKgYGyMGTTgAK7OCs 991kG6VGKNlU78dYxCsrVQFFmO4L5wlT6DxmN+jp2Wqrf5qiAk/Sa20A7A6oxVF49a56 nTCC8RijWMyHQYzeres4038/D5x1bkZ5ZCbEniOPuC1hEP+Z6gyPv6X3/KU7za9E2DcG 5ehlfVEHO//OUW0I+d76NQ8f6aqvwBr01RYuWzaxnL2mxvPJKmok3ClLCwfDS4zCv2Hw kQiJfq1X1OAADoxemfDQLKKvlDlNtL27OYWfLCuhfWkk3qIu1VB8dAX8aY/0PuOu1+ge 0KMQ== X-Gm-Message-State: APf1xPBA3NWxebanYWw1ujznEPE98GBCf76bRTZidmYyPhivDNxIlzdy UV/JS6Y9cPpHUKnpoSMpaqU= X-Received: by 10.46.99.135 with SMTP id s7mr1354282lje.17.1518254372670; Sat, 10 Feb 2018 01:19:32 -0800 (PST) Received: from localhost.localdomain ([46.194.112.145]) by smtp.gmail.com with ESMTPSA id s9sm794551lfe.48.2018.02.10.01.19.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 01:19:31 -0800 (PST) From: Marcus Folkesson To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Mark Rutland , Carlo Caione , Kevin Hilman , Matthias Brugger , Barry Song , Maxime Ripard , Chen-Yu Tsai , Linus Walleij , Vladimir Zapolskiy , Sylvain Lemieux , Nicolas Ferre , Alexandre Belloni Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Marcus Folkesson Subject: [PATCH v2 3/7] watchdog: sirfsoc: allow setting timeout in devicetree Date: Sat, 10 Feb 2018 10:19:07 +0100 Message-Id: <20180210091911.3644-3-marcus.folkesson@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180210091911.3644-1-marcus.folkesson@gmail.com> References: <20180210091911.3644-1-marcus.folkesson@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org watchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout. By following best practice described in Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree. Signed-off-by: Marcus Folkesson Reviewed-by: Guenter Roeck --- Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt | 4 ++++ drivers/watchdog/sirfsoc_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt index 9cbc76c89b2b..0dce5e3100b4 100644 --- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt @@ -5,10 +5,14 @@ Required properties: - reg: Address range of tick timer/WDT register set - interrupts: interrupt number to the cpu +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: timer@b0020000 { compatible = "sirf,prima2-tick"; reg = <0xb0020000 0x1000>; interrupts = <0>; + timeout-sec = <30>; }; diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c index 4eea351e09b0..ac0c9d2c4aee 100644 --- a/drivers/watchdog/sirfsoc_wdt.c +++ b/drivers/watchdog/sirfsoc_wdt.c @@ -29,7 +29,7 @@ #define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60) /* 10 mins */ #define SIRFSOC_WDT_DEFAULT_TIMEOUT 30 /* 30 secs */ -static unsigned int timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT; +static unsigned int timeout; static bool nowayout = WATCHDOG_NOWAYOUT; module_param(timeout, uint, 0); -- 2.15.1