• Patrick Mochel's avatar
    driver model: power management/shutdown cleanup. · 6b1febf7
    Patrick Mochel authored
    - take device_sem around all global list walks.
    - don't modify refcount, as get_device()/put_device() also take device_sem
    - But, make sure we check device_present() to make sure device is still around.
    
    (Note device removal will block until device_sem is dropped, so list will remain
    intact.)
    
    - Separate out device_shutdown() walk from device_suspend() walk. Even though the
      code is nearly identical, it's a lot clearer as to what is going on when they 
      are autonomous. It was my bad for originally putting that FIXME in there, encouraging
      the consolidation. 
    
    - Add debugging hooks for my convenience. :)
    
    - Call ->shutdown() when shutting down device, instead of ->remove(). (See ChangeSet 
      1.799 for description and semantics).
    6b1febf7
power.c 2.56 KB