[cpia] USB anyone?
Jochen Scharrlach
Jochen.Scharrlach@schwaben.de
Wed, 19 Jan 2000 21:36:41 +0100 (CET)
sbertin@mindspring.com writes:
> I hadn't looked at what v4l does. The video_unregister_device call in
> cpia_unregister_camera definately should not happen if the camera is
> open. Just put an if(cam->open_count == 0) in front of it.
That's still not enough - the driver must not unregister an open
video_device, even if the module should be unloaded. I'm not familiar
with the module system, but isn't it possible to reject an
rmmod-request? I'd propose the following: whenever an open device
needs to be unregistered (e.g. because of a physical disconnect), the
vectors of the corresponding video_device are overwritten: a special
close() cares about the cleanup, while all other calls simply return
-ENODEV. In addition to this the cam_data-struct will be added to a
cleanup-list - the module won't unload before this list is empty,
i.e. all devices are closed.
Bye,
Jochen
--
new signature coming RSN (tm)