On Montag, 12. Juli 2004 10:23, viro@parcelfarce.linux.theplanet.co.uk wrote: > On Mon, Jul 12, 2004 at 10:19:39AM +0200, Wim Van Sebroeck wrote: > > > - You need to get the module reference count before calling any > > >   watchdog operation, the best place for this is probably the > > >   open() fop. > > Huh?  Just set ->owner in file_operations and be done with that. > Yes, that would work. However, I don't feel comfortable with setting fops->owner to anything else than THIS_MODULE. In particular, this causes problems when multiple watchdog drivers register with the watchdog base module. The sequence I had in mind was: chrdev_open() try_module_get(fops->owner) watchdog_open() try_module_get(wdops->owner) wdops->start() vfs_write watchdog_write() wdops->keepalive() ... fput() watchdog_release() wdops->stop() module_put(wdops->owner) module_put(fops->owner) This would practically do the same for the watchdog layer that we already do for inside vfs for the file_operations. Arnd <><