numa: add generic percpu var numa_node_id() implementation
[pandora-kernel.git] / include / linux / device.h
index 241b96b..0713e10 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/pm.h>
-#include <linux/semaphore.h>
 #include <asm/atomic.h>
 #include <asm/device.h>
 
@@ -34,6 +33,7 @@ struct class;
 struct class_private;
 struct bus_type;
 struct bus_type_private;
+struct device_node;
 
 struct bus_attribute {
        struct attribute        attr;
@@ -128,6 +128,10 @@ struct device_driver {
 
        bool suppress_bind_attrs;       /* disables bind/unbind via sysfs */
 
+#if defined(CONFIG_OF)
+       const struct of_device_id       *of_match_table;
+#endif
+
        int (*probe) (struct device *dev);
        int (*remove) (struct device *dev);
        void (*shutdown) (struct device *dev);
@@ -203,6 +207,9 @@ struct class {
        int (*suspend)(struct device *dev, pm_message_t state);
        int (*resume)(struct device *dev);
 
+       const struct kobj_ns_type_operations *ns_type;
+       const void *(*namespace)(struct device *dev);
+
        const struct dev_pm_ops *pm;
 
        struct class_private *p;
@@ -404,7 +411,7 @@ struct device {
        const char              *init_name; /* initial name of the device */
        struct device_type      *type;
 
-       struct semaphore        sem;    /* semaphore to synchronize calls to
+       struct mutex            mutex;  /* mutex to synchronize calls to
                                         * its driver.
                                         */
 
@@ -433,6 +440,9 @@ struct device {
                                             override */
        /* arch specific additions */
        struct dev_archdata     archdata;
+#ifdef CONFIG_OF
+       struct device_node      *of_node;
+#endif
 
        dev_t                   devt;   /* dev_t, creates the sysfs "dev" */
 
@@ -514,17 +524,17 @@ static inline bool device_async_suspend_enabled(struct device *dev)
 
 static inline void device_lock(struct device *dev)
 {
-       down(&dev->sem);
+       mutex_lock(&dev->mutex);
 }
 
 static inline int device_trylock(struct device *dev)
 {
-       return down_trylock(&dev->sem);
+       return mutex_trylock(&dev->mutex);
 }
 
 static inline void device_unlock(struct device *dev)
 {
-       up(&dev->sem);
+       mutex_unlock(&dev->mutex);
 }
 
 void driver_init(void);