[libata] trim trailing whitespace
[linux-drm-fsl-dcu.git] / include / linux / device.h
index 583a341e016cea229ad8b04d4213d59974e3cbd3..5ca1cdba563a43b4bc05cbe99b313203822add6b 100644 (file)
@@ -126,6 +126,7 @@ struct device_driver {
        struct klist_node       knode_bus;
 
        struct module           * owner;
+       const char              * mod_name;     /* used for built-in modules */
 
        int     (*probe)        (struct device * dev);
        int     (*remove)       (struct device * dev);
@@ -327,6 +328,13 @@ extern struct class_device *class_device_create(struct class *cls,
                                        __attribute__((format(printf,5,6)));
 extern void class_device_destroy(struct class *cls, dev_t devt);
 
+struct device_type {
+       struct device_attribute *attrs;
+       int (*uevent)(struct device *dev, char **envp, int num_envp,
+                     char *buffer, int buffer_size);
+       void (*release)(struct device *dev);
+};
+
 /* interface for exporting device attributes */
 struct device_attribute {
        struct attribute        attr;
@@ -355,6 +363,7 @@ struct device {
 
        struct kobject kobj;
        char    bus_id[BUS_ID_SIZE];    /* position on parent bus */
+       struct device_type      *type;
        unsigned                is_registered:1;
        struct device_attribute uevent_attr;
        struct device_attribute *devt_attr;
@@ -371,6 +380,9 @@ struct device {
                                           core doesn't touch it */
        struct dev_pm_info      power;
 
+#ifdef CONFIG_NUMA
+       int             numa_node;      /* NUMA node this device is close to */
+#endif
        u64             *dma_mask;      /* dma mask (if dma'able device) */
        u64             coherent_dma_mask;/* Like dma_mask, but for
                                             alloc_coherent mappings as
@@ -387,13 +399,33 @@ struct device {
 
        /* class_device migration path */
        struct list_head        node;
-       struct class            *class;         /* optional*/
+       struct class            *class;
        dev_t                   devt;           /* dev_t, creates the sysfs "dev" */
        struct attribute_group  **groups;       /* optional groups */
+       int                     uevent_suppress;
 
        void    (*release)(struct device * dev);
 };
 
+#ifdef CONFIG_NUMA
+static inline int dev_to_node(struct device *dev)
+{
+       return dev->numa_node;
+}
+static inline void set_dev_node(struct device *dev, int node)
+{
+       dev->numa_node = node;
+}
+#else
+static inline int dev_to_node(struct device *dev)
+{
+       return -1;
+}
+static inline void set_dev_node(struct device *dev, int node)
+{
+}
+#endif
+
 static inline void *
 dev_get_drvdata (struct device *dev)
 {
@@ -411,6 +443,8 @@ static inline int device_is_registered(struct device *dev)
        return dev->is_registered;
 }
 
+void driver_init(void);
+
 /*
  * High level routines for use by the bus drivers
  */