linux-mips
[Top] [All Lists]

Re: [PATCH V6] MIPS: lantiq: add watchdog support

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH V6] MIPS: lantiq: add watchdog support
From: Wim Van Sebroeck <wim@iguana.be>
Date: Tue, 26 Apr 2011 14:42:12 +0200
Cc: Ralf Baechle <ralf@linux-mips.org>, Ralph Hempel <ralph.hempel@lantiq.com>, linux-mips@linux-mips.org, linux-watchdog@vger.kernel.org
In-reply-to: <1303817863-19526-1-git-send-email-blogic@openwrt.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1303817863-19526-1-git-send-email-blogic@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.18 (2008-05-17)
Hi John,

> +static int
> +ltq_wdt_open(struct inode *inode, struct file *file)
> +{
> +     if (ltq_wdt_in_use)
> +             return -EBUSY;
> +     ltq_wdt_in_use = 1;
> +     ltq_wdt_enable();
> +
> +     return nonseekable_open(inode, file);
> +}

I prefer to see a test_and_set_bit(ltq_wdt_in_use) and a ...

> +static int
> +ltq_wdt_release(struct inode *inode, struct file *file)
> +{
> +     if (ltq_wdt_ok_to_close)
> +             ltq_wdt_disable();
> +     else
> +             pr_err("ltq_wdt: watchdog closed without warning\n");
> +     ltq_wdt_ok_to_close = 0;
> +     ltq_wdt_in_use = 0;
> +
> +     return 0;
> +}

... clear_bit(ltq_wdt_in_use);

For the rest is looks ok for me. So Signed-off-by: Wim Van Sebroeck 
<wim@iguana.be>

Kind regards,
Wim.


<Prev in Thread] Current Thread [Next in Thread>