• Patrick Mochel's avatar
    driver model: make driver refcounting similar to devices'. · 2884fae0
    Patrick Mochel authored
    In the spirit of devices and buses, change driver refcounting model to 
    match the way that devices and buses are done.
    
    struct device_driver gets a ->present field, which is set on registration 
    and cleared in driver_unregister(). get_device() checks the state of this
    flag and returns NULL if cleared. 
    
    Note that the horribly wrong remove_driver() is deprecated and simply BUG()s
    when called. Please convert callers to use driver_unregister(). Updates to 
    callers will be coming soon.
    
    Note also that this still doesn't fix the race in which a driver module can
    be removed while the refcount on a driver > 1. Near future work should help
    to remedy it, but no solutions are guaranteed..
    2884fae0
driver.c 2.48 KB