diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-27 15:58:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-27 15:58:54 -0400 |
commit | d868772fff6c4b881d66af8640251714e1aefa98 (patch) | |
tree | c95a68d358d5c875d25763ffe9a44fe9f2081f34 /drivers/base/attribute_container.c | |
parent | a205752d1ad2d37d6597aaae5a56fc396a770868 (diff) | |
parent | 404d5b185b4eb56d6fa2f7bd27833f8df1c38ce4 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (46 commits)
dev_dbg: check dev_dbg() arguments
drivers/base/attribute_container.c: use mutex instead of binary semaphore
mod_sysfs_setup() doesn't return errno when kobject_add_dir() failure occurs
s2ram: add arch irq disable/enable hooks
define platform wakeup hook, use in pci_enable_wake()
security: prevent permission checking of file removal via sysfs_remove_group()
device_schedule_callback() needs a module reference
s390: cio: Delay uevents for subchannels
sysfs: bin.c printk fix
Driver core: use mutex instead of semaphore in DMA pool handler
driver core: bus_add_driver should return an error if no bus
debugfs: Add debugfs_create_u64()
the overdue removal of the mount/umount uevents
kobject: Comment and warning fixes to kobject.c
Driver core: warn when userspace writes to the uevent file in a non-supported way
Driver core: make uevent-environment available in uevent-file
kobject core: remove rwsem from struct subsystem
qeth: Remove usage of subsys.rwsem
PHY: remove rwsem use from phy core
IEEE1394: remove rwsem use from ieee1394 core
...
Diffstat (limited to 'drivers/base/attribute_container.c')
-rw-r--r-- | drivers/base/attribute_container.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c index 22220733f76f..1ec0654665cf 100644 --- a/drivers/base/attribute_container.c +++ b/drivers/base/attribute_container.c | |||
@@ -62,7 +62,7 @@ EXPORT_SYMBOL_GPL(attribute_container_classdev_to_container); | |||
62 | 62 | ||
63 | static struct list_head attribute_container_list; | 63 | static struct list_head attribute_container_list; |
64 | 64 | ||
65 | static DECLARE_MUTEX(attribute_container_mutex); | 65 | static DEFINE_MUTEX(attribute_container_mutex); |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * attribute_container_register - register an attribute container | 68 | * attribute_container_register - register an attribute container |
@@ -77,9 +77,9 @@ attribute_container_register(struct attribute_container *cont) | |||
77 | klist_init(&cont->containers,internal_container_klist_get, | 77 | klist_init(&cont->containers,internal_container_klist_get, |
78 | internal_container_klist_put); | 78 | internal_container_klist_put); |
79 | 79 | ||
80 | down(&attribute_container_mutex); | 80 | mutex_lock(&attribute_container_mutex); |
81 | list_add_tail(&cont->node, &attribute_container_list); | 81 | list_add_tail(&cont->node, &attribute_container_list); |
82 | up(&attribute_container_mutex); | 82 | mutex_unlock(&attribute_container_mutex); |
83 | 83 | ||
84 | return 0; | 84 | return 0; |
85 | } | 85 | } |
@@ -94,7 +94,7 @@ int | |||
94 | attribute_container_unregister(struct attribute_container *cont) | 94 | attribute_container_unregister(struct attribute_container *cont) |
95 | { | 95 | { |
96 | int retval = -EBUSY; | 96 | int retval = -EBUSY; |
97 | down(&attribute_container_mutex); | 97 | mutex_lock(&attribute_container_mutex); |
98 | spin_lock(&cont->containers.k_lock); | 98 | spin_lock(&cont->containers.k_lock); |
99 | if (!list_empty(&cont->containers.k_list)) | 99 | if (!list_empty(&cont->containers.k_list)) |
100 | goto out; | 100 | goto out; |
@@ -102,7 +102,7 @@ attribute_container_unregister(struct attribute_container *cont) | |||
102 | list_del(&cont->node); | 102 | list_del(&cont->node); |
103 | out: | 103 | out: |
104 | spin_unlock(&cont->containers.k_lock); | 104 | spin_unlock(&cont->containers.k_lock); |
105 | up(&attribute_container_mutex); | 105 | mutex_unlock(&attribute_container_mutex); |
106 | return retval; | 106 | return retval; |
107 | 107 | ||
108 | } | 108 | } |
@@ -145,7 +145,7 @@ attribute_container_add_device(struct device *dev, | |||
145 | { | 145 | { |
146 | struct attribute_container *cont; | 146 | struct attribute_container *cont; |
147 | 147 | ||
148 | down(&attribute_container_mutex); | 148 | mutex_lock(&attribute_container_mutex); |
149 | list_for_each_entry(cont, &attribute_container_list, node) { | 149 | list_for_each_entry(cont, &attribute_container_list, node) { |
150 | struct internal_container *ic; | 150 | struct internal_container *ic; |
151 | 151 | ||
@@ -173,7 +173,7 @@ attribute_container_add_device(struct device *dev, | |||
173 | attribute_container_add_class_device(&ic->classdev); | 173 | attribute_container_add_class_device(&ic->classdev); |
174 | klist_add_tail(&ic->node, &cont->containers); | 174 | klist_add_tail(&ic->node, &cont->containers); |
175 | } | 175 | } |
176 | up(&attribute_container_mutex); | 176 | mutex_unlock(&attribute_container_mutex); |
177 | } | 177 | } |
178 | 178 | ||
179 | /* FIXME: can't break out of this unless klist_iter_exit is also | 179 | /* FIXME: can't break out of this unless klist_iter_exit is also |
@@ -211,7 +211,7 @@ attribute_container_remove_device(struct device *dev, | |||
211 | { | 211 | { |
212 | struct attribute_container *cont; | 212 | struct attribute_container *cont; |
213 | 213 | ||
214 | down(&attribute_container_mutex); | 214 | mutex_lock(&attribute_container_mutex); |
215 | list_for_each_entry(cont, &attribute_container_list, node) { | 215 | list_for_each_entry(cont, &attribute_container_list, node) { |
216 | struct internal_container *ic; | 216 | struct internal_container *ic; |
217 | struct klist_iter iter; | 217 | struct klist_iter iter; |
@@ -234,7 +234,7 @@ attribute_container_remove_device(struct device *dev, | |||
234 | } | 234 | } |
235 | } | 235 | } |
236 | } | 236 | } |
237 | up(&attribute_container_mutex); | 237 | mutex_unlock(&attribute_container_mutex); |
238 | } | 238 | } |
239 | 239 | ||
240 | /** | 240 | /** |
@@ -255,7 +255,7 @@ attribute_container_device_trigger(struct device *dev, | |||
255 | { | 255 | { |
256 | struct attribute_container *cont; | 256 | struct attribute_container *cont; |
257 | 257 | ||
258 | down(&attribute_container_mutex); | 258 | mutex_lock(&attribute_container_mutex); |
259 | list_for_each_entry(cont, &attribute_container_list, node) { | 259 | list_for_each_entry(cont, &attribute_container_list, node) { |
260 | struct internal_container *ic; | 260 | struct internal_container *ic; |
261 | struct klist_iter iter; | 261 | struct klist_iter iter; |
@@ -273,7 +273,7 @@ attribute_container_device_trigger(struct device *dev, | |||
273 | fn(cont, dev, &ic->classdev); | 273 | fn(cont, dev, &ic->classdev); |
274 | } | 274 | } |
275 | } | 275 | } |
276 | up(&attribute_container_mutex); | 276 | mutex_unlock(&attribute_container_mutex); |
277 | } | 277 | } |
278 | 278 | ||
279 | /** | 279 | /** |
@@ -295,12 +295,12 @@ attribute_container_trigger(struct device *dev, | |||
295 | { | 295 | { |
296 | struct attribute_container *cont; | 296 | struct attribute_container *cont; |
297 | 297 | ||
298 | down(&attribute_container_mutex); | 298 | mutex_lock(&attribute_container_mutex); |
299 | list_for_each_entry(cont, &attribute_container_list, node) { | 299 | list_for_each_entry(cont, &attribute_container_list, node) { |
300 | if (cont->match(cont, dev)) | 300 | if (cont->match(cont, dev)) |
301 | fn(cont, dev); | 301 | fn(cont, dev); |
302 | } | 302 | } |
303 | up(&attribute_container_mutex); | 303 | mutex_unlock(&attribute_container_mutex); |
304 | } | 304 | } |
305 | 305 | ||
306 | /** | 306 | /** |