Re: [DRIVER][RFC] SC1200 Watchdog driver

From: Christer Weinigel (wingel@nano-system.com)
Date: Thu Feb 21 2002 - 06:19:10 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:31 EST