aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 13:48:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 13:48:32 -0400
commitd6fb1db02e02aea98f2d7e121fd30e24c84639d6 (patch)
tree865546f0388c40d52cf98febe2c6d21039915ea2 /include/linux/device.h
parentb4e6b09738fde057ce885703705f71cc953d0512 (diff)
parenta1b3f594dc5faab91d3a218c7019e9b5edd9fe1a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (38 commits) net: Expose all network devices in a namespaces in sysfs hotplug: netns aware uevent_helper kobj: Send hotplug events in the proper namespace. netlink: Implment netlink_broadcast_filtered net/sysfs: Fix the bitrot in network device kobject namespace support netns: Teach network device kobjects which namespace they are in. kobject: Send hotplug events in all network namespaces driver-core: fix Typo in drivers/base/core.c for CONFIG_MODULE pci: check caps from sysfs file open to read device dependent config space sysfs: add struct file* to bin_attr callbacks sysfs: Remove usage of S_BIAS to avoid merge conflict with the vfs tree sysfs: Don't use enums in inline function declaration. sysfs-namespaces: add a high-level Documentation file sysfs: Comment sysfs directory tagging logic driver core: Implement ns directory support for device classes. sysfs: Implement sysfs_delete_link sysfs: Add support for tagged directories with untagged members. sysfs: Implement sysfs tagged directory support. kobj: Add basic infrastructure for dealing with namespaces. sysfs: Remove double free sysfs_get_sb ...
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 241b96bcd7ad..7bb9f426f3e6 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -22,7 +22,6 @@
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/pm.h> 24#include <linux/pm.h>
25#include <linux/semaphore.h>
26#include <asm/atomic.h> 25#include <asm/atomic.h>
27#include <asm/device.h> 26#include <asm/device.h>
28 27
@@ -203,6 +202,9 @@ struct class {
203 int (*suspend)(struct device *dev, pm_message_t state); 202 int (*suspend)(struct device *dev, pm_message_t state);
204 int (*resume)(struct device *dev); 203 int (*resume)(struct device *dev);
205 204
205 const struct kobj_ns_type_operations *ns_type;
206 const void *(*namespace)(struct device *dev);
207
206 const struct dev_pm_ops *pm; 208 const struct dev_pm_ops *pm;
207 209
208 struct class_private *p; 210 struct class_private *p;
@@ -404,7 +406,7 @@ struct device {
404 const char *init_name; /* initial name of the device */ 406 const char *init_name; /* initial name of the device */
405 struct device_type *type; 407 struct device_type *type;
406 408
407 struct semaphore sem; /* semaphore to synchronize calls to 409 struct mutex mutex; /* mutex to synchronize calls to
408 * its driver. 410 * its driver.
409 */ 411 */
410 412
@@ -514,17 +516,17 @@ static inline bool device_async_suspend_enabled(struct device *dev)
514 516
515static inline void device_lock(struct device *dev) 517static inline void device_lock(struct device *dev)
516{ 518{
517 down(&dev->sem); 519 mutex_lock(&dev->mutex);
518} 520}
519 521
520static inline int device_trylock(struct device *dev) 522static inline int device_trylock(struct device *dev)
521{ 523{
522 return down_trylock(&dev->sem); 524 return mutex_trylock(&dev->mutex);
523} 525}
524 526
525static inline void device_unlock(struct device *dev) 527static inline void device_unlock(struct device *dev)
526{ 528{
527 up(&dev->sem); 529 mutex_unlock(&dev->mutex);
528} 530}
529 531
530void driver_init(void); 532void driver_init(void);