From: Vojtech P. <vo...@su...> - 2001-06-22 12:54:42
|
On Tue, Jun 19, 2001 at 10:42:27PM +0200, Johann Deneux wrote: > On Tue, 19 Jun 2001, James Simmons wrote: > > > > > > Now the question is: What is the role of input_dev::close/open ? > > > Are they meant as "init/deinit the device" or "establish/break connection > > > with processes" (or a mix of both) ? > > > > If you look at input.c connect and disconnect are used by input_register > > and input_unregister which are called when you insmod the device or at > > boot time. So they are used to setup the hardware and the data structs for > > the device. Now open and close are called input_open_device and > > input_close_device. Now if look at what calls input_[opne/close]_device > > they are all some kind of userland interface i.e evdev, mousedev, joydev.c > > etc. > > There are parts of evdev functions called by userland, and other parts > called by other modules. Namely, evdev_disconnect can be called by serio, > for example. No, evdev_disconnect will always be called by input.c, which will always be called by some input device driver calling the unregister() function. It can be triggered by serio/usb/rmmod/whatever else, though. > The problem is still there: I would expect > input_open_device/input_close_devise to be called at least the same > number of times (perhaps we should even take care of the order). We can't take care of the order - that is not possible. But they indeed should be called the same number of times. If they are not, it's a bug. -- Vojtech Pavlik SuSE Labs |