diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-10-16 01:28:28 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-10-16 01:28:28 -0700 |
| commit | ba809e8ac59030f8b8c1822f0ce6b3161cabc60b (patch) | |
| tree | ea990539a2d0a4ed789b460314e81eca949342ac /include/linux | |
| parent | 1067efac8c64c2608ececdca87e1329ba3ffa073 (diff) | |
driver model: replace rwlock in struct bus_type with a rwsem.
Synchronize all walks of the device and driver lists of a bus with an rwsem wrapped
around the entire iterator, instead of using device_lock and dropping it after we
grabbed each node.
Note this also prevents deadlock when walking the list of drivers and calling
get_driver(), since get_driver() tries to take device_lock while we already have it
held.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/device.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 112fca2dd2d8..c0f8d6c5e4bf 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -54,7 +54,7 @@ struct device_class; struct bus_type { char * name; - rwlock_t lock; + struct rw_semaphore rwsem; atomic_t refcount; u32 present; |
