• Patrick Mochel's avatar
    [driver model] Allow per-device shutdown or suspend on driver detach. · 47149728
    Patrick Mochel authored
    - Add struct device::detach_state, which tells the core what state to put
      the device in when it's detached from its driver (on module removal).
    
      This is a value in the range of 0-4, with 0 being On and meaning 'Do 
      Nothing', 4 being Off, meaing calling ->shutdown() for the device, and 
      1-3 being low-power states, meaning call ->suspend() for the device. 
    
    - Add per-device sysfs file 'detach_state' to control the value of the 
      field. 
    
    - Add device_device_shutdown() function, and call it from bus.c::
      device_detach_driver().
    47149728
core.c 9.06 KB