[parisc-linux] Unregister driver patch

Matthieu Delahaye delahaym@esiee.fr
Sat, 24 Feb 2001 16:56:08 +0100


Hi all!

Here is a patch which implements the unregister_driver() function.

I had to change a field in struct hp_device:
The field "manage" (bool) become "driver" (pointer on a pa_iodc_driver),

since unregister_driver has to know by which driver a device was managed
to make unregister proper.
unregister_driver() first remove the driver from the list. Then, it
looks for devices managed by this driver and changed their "driver"
field to NULL.


More over, some drivers call register_driver at least two times, e.g.
the gsc parallel port driver. When it append, BUG() is called and a
warning is send to give the name of the driver.

NOTE: Since the structure pa_iodc_driver is used to maintain the list of
the registered drivers, I think this do not have to be put in data.init
section.


Regards,

Matthieu Delahaye
ESIEE Team
http://www.esiee.fr/~puffin