diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-08-13 00:01:43 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-08-13 00:01:43 -0700 |
| commit | 789e39b03171d02308ba0f2f86711a1721595639 (patch) | |
| tree | fe3c3d5f596c6061ac9e4e85394cd99612852660 /include/linux | |
| parent | 266c24ad83baf7d2c9873d5c289fe0126fb90c68 (diff) | |
Update device model locking
Change all iterators of devices to:
- use list_for_each
- check return of get_device_locked
- don't break until we hold the lock if we get an error
When a device's reference count hits 0, remove it from all lists, including
bus and driver lists.
Between the iterator algorithm and the guaranteed removal from the lists,
there should never be a device in a list with a reference count of 0.
So, whenever we're iterating over the lists, we'll always have a valid
device. We don't decrement the refcount until the next iteration of the
loop, so we're also guaranteed to get the correct next item in the list.
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
