From patchwork Sat Jan 5 02:38:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenyou Yang X-Patchwork-Id: 1935631 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 910BDDFABD for ; Sat, 5 Jan 2013 02:49:16 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TrJkv-0001Cn-9B; Sat, 05 Jan 2013 02:45:05 +0000 Received: from newsmtp5.atmel.com ([204.2.163.5] helo=sjogate2.atmel.com) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TrJke-00019S-TK for linux-arm-kernel@lists.infradead.org; Sat, 05 Jan 2013 02:44:50 +0000 Received: from penbh01.corp.atmel.com ([10.168.5.31]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id r052d8nK015596; Fri, 4 Jan 2013 18:39:17 -0800 (PST) Received: from penmb01.corp.atmel.com ([10.168.5.33]) by penbh01.corp.atmel.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 5 Jan 2013 10:44:27 +0800 Received: from shaarm01.corp.atmel.com ([10.217.6.34]) by penmb01.corp.atmel.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 5 Jan 2013 10:44:26 +0800 From: Wenyou Yang To: linux-arm-kernel@lists.infradead.org Subject: [v3 PATCH 1/9] watchdog: add the function watchdog_is_open Date: Sat, 5 Jan 2013 10:38:41 +0800 Message-Id: <1357353529-20901-2-git-send-email-wenyou.yang@atmel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357353529-20901-1-git-send-email-wenyou.yang@atmel.com> References: <1357353529-20901-1-git-send-email-wenyou.yang@atmel.com> X-OriginalArrivalTime: 05 Jan 2013 02:44:26.0957 (UTC) FILETIME=[93FD27D0:01CDEAEE] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130104_214449_315662_389C0BEB X-CRM114-Status: GOOD ( 10.52 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: plagnioj@jcrosoft.com, JM.Lin@atmel.com, nicolas.ferre@atmel.com, wenyou.yang@atmel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add the function watchdog_is_open to check whether or not the /dev/watchdog? is opened Signed-off-by: Wenyou Yang --- include/linux/watchdog.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index e40cc2b..7ea4465 100644 --- a/include/linux/watchdog.h +++ b/include/linux/watchdog.h @@ -111,6 +111,14 @@ static inline bool watchdog_active(struct watchdog_device *wdd) return test_bit(WDOG_ACTIVE, &wdd->status); } +/* Use the following function to check whether or not + * the /dev/watchdog? is opened + */ +static inline bool watchdog_is_open(struct watchdog_device *wddev) +{ + return test_bit(WDOG_DEV_OPEN, &wddev->status); +} + /* Use the following function to set the nowayout feature */ static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool nowayout) {