Re: [DRIVER][RFC] SC1200 Watchdog driver

Christer Weinigel
2002-02-21T11:19:37Z

Jeff Garzik <jgarzik@mandrakesoft.com> wrote:

> I just looked at their watchdog driver -- yours might be better... They
> don't use semaphores in _open, they don't use request_region, etc.

I do use request region, it's all done in another source file though.

What use would the semaphore be? To disallow multiple opens?

I'm not too sure about the locking requirements on release, do I need
to add lock_kernel to the release function, or is that automatically
handled by "owner: THIS_MODULE"?

static int scx200_watchdog_release(struct inode *inode, struct file *file)
{
lock_kernel();
if (!expect_close) {
printk(KERN_WARNING "%s: watchdog device closed unexpectedly, will not disable the watchdog timer\n", name);
} else if (!nowayout) {
scx200_watchdog_disable();
}
clear_bit(0, &in_use);
unlock_kernel();

return 0;
}

Is there anything else that I ought to change in the driver? (Except
to get rid of all the magic constants, I'm planning to do this, I
promise).

/Christer