aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
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 182192892d45..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
@@ -451,6 +453,10 @@ struct device {
451 453
452static inline const char *dev_name(const struct device *dev) 454static inline const char *dev_name(const struct device *dev)
453{ 455{
456 /* Use the init name until the kobject becomes available */
457 if (dev->init_name)
458 return dev->init_name;
459
454 return kobject_name(&dev->kobj); 460 return kobject_name(&dev->kobj);
455} 461}
456 462
@@ -510,17 +516,17 @@ static inline bool device_async_suspend_enabled(struct device *dev)
510 516
511static inline void device_lock(struct device *dev) 517static inline void device_lock(struct device *dev)
512{ 518{
513 down(&dev->sem); 519 mutex_lock(&dev->mutex);
514} 520}
515 521
516static inline int device_trylock(struct device *dev) 522static inline int device_trylock(struct device *dev)
517{ 523{
518 return down_trylock(&dev->sem); 524 return mutex_trylock(&dev->mutex);
519} 525}
520 526
521static inline void device_unlock(struct device *dev) 527static inline void device_unlock(struct device *dev)
522{ 528{
523 up(&dev->sem); 529 mutex_unlock(&dev->mutex);
524} 530}
525 531
526void driver_init(void); 532void driver_init(void);