aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
commitcf9b59e9d3e008591d1f54830f570982bb307a0d (patch)
tree113478ce8fd8c832ba726ffdf59b82cb46356476 /include/linux/device.h
parent44504b2bebf8b5823c59484e73096a7d6574471d (diff)
parentf4b87dee923342505e1ddba8d34ce9de33e75050 (diff)
Merge remote branch 'origin' into secretlab/next-devicetree
Merging in current state of Linus' tree to deal with merge conflicts and build failures in vio.c after merge. Conflicts: drivers/i2c/busses/i2c-cpm.c drivers/i2c/busses/i2c-mpc.c drivers/net/gianfar.c Also fixed up one line in arch/powerpc/kernel/vio.c to use the correct node pointer. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index cd7534cc42ab..0713e10571dd 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
@@ -208,6 +207,9 @@ struct class {
208 int (*suspend)(struct device *dev, pm_message_t state); 207 int (*suspend)(struct device *dev, pm_message_t state);
209 int (*resume)(struct device *dev); 208 int (*resume)(struct device *dev);
210 209
210 const struct kobj_ns_type_operations *ns_type;
211 const void *(*namespace)(struct device *dev);
212
211 const struct dev_pm_ops *pm; 213 const struct dev_pm_ops *pm;
212 214
213 struct class_private *p; 215 struct class_private *p;
@@ -409,7 +411,7 @@ struct device {
409 const char *init_name; /* initial name of the device */ 411 const char *init_name; /* initial name of the device */
410 struct device_type *type; 412 struct device_type *type;
411 413
412 struct semaphore sem; /* semaphore to synchronize calls to 414 struct mutex mutex; /* mutex to synchronize calls to
413 * its driver. 415 * its driver.
414 */ 416 */
415 417
@@ -459,6 +461,10 @@ struct device {
459 461
460static inline const char *dev_name(const struct device *dev) 462static inline const char *dev_name(const struct device *dev)
461{ 463{
464 /* Use the init name until the kobject becomes available */
465 if (dev->init_name)
466 return dev->init_name;
467
462 return kobject_name(&dev->kobj); 468 return kobject_name(&dev->kobj);
463} 469}
464 470
@@ -518,17 +524,17 @@ static inline bool device_async_suspend_enabled(struct device *dev)
518 524
519static inline void device_lock(struct device *dev) 525static inline void device_lock(struct device *dev)
520{ 526{
521 down(&dev->sem); 527 mutex_lock(&dev->mutex);
522} 528}
523 529
524static inline int device_trylock(struct device *dev) 530static inline int device_trylock(struct device *dev)
525{ 531{
526 return down_trylock(&dev->sem); 532 return mutex_trylock(&dev->mutex);
527} 533}
528 534
529static inline void device_unlock(struct device *dev) 535static inline void device_unlock(struct device *dev)
530{ 536{
531 up(&dev->sem); 537 mutex_unlock(&dev->mutex);
532} 538}
533 539
534void driver_init(void); 540void driver_init(void);