lkml.org 
[lkml]   [2013]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/8] watchdog: add the function watchdog_is_open
Hi Wenyou,

> Add the function watchdog_is_open to check whether or not
> the /dev/watchdog? is opened
>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> Cc: wim@iguana.be
> Cc: linux-watchdog@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
> 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)
> {

NAK, this is not good. You should use watchdog_active instead.
Reason: your device could have been opened as for instance /dev/watchdog0.

Kind regards,
Wim.


\
 
 \ /
  Last update: 2013-02-14 00:22    [W:0.026 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site