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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

Kind regards,
Wim.

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux