OSDN Git Service

KVM: Use a shared page for kernel/user communication when runing a vcpu
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / include / linux / device.h
index 9d54fe1..a0cd2ce 100644 (file)
@@ -80,6 +80,7 @@ struct bus_type {
        int (*resume)(struct device * dev);
 
        unsigned int drivers_autoprobe:1;
+       unsigned int multithread_probe:1;
 };
 
 extern int __must_check bus_register(struct bus_type * bus);
@@ -125,7 +126,6 @@ struct device_driver {
        const char              * name;
        struct bus_type         * bus;
 
-       struct completion       unloaded;
        struct kobject          kobj;
        struct klist            klist_devices;
        struct klist_node       knode_bus;
@@ -139,8 +139,6 @@ struct device_driver {
        void    (*shutdown)     (struct device * dev);
        int     (*suspend)      (struct device * dev, pm_message_t state);
        int     (*resume)       (struct device * dev);
-
-       unsigned int multithread_probe:1;
 };
 
 
@@ -331,11 +329,23 @@ 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);
 
+/*
+ * The type of device, "struct device" is embedded in. A class
+ * or bus can contain devices of different types
+ * like "partitions" and "disks", "mouse" and "event".
+ * This identifies the device type and carries type-specific
+ * information, equivalent to the kobj_type of a kobject.
+ * If "name" is specified, the uevent will contain it in
+ * the DEVTYPE variable.
+ */
 struct device_type {
-       struct device_attribute *attrs;
+       const char *name;
+       struct attribute_group **groups;
        int (*uevent)(struct device *dev, char **envp, int num_envp,
                      char *buffer, int buffer_size);
        void (*release)(struct device *dev);
+       int (*suspend)(struct device * dev, pm_message_t state);
+       int (*resume)(struct device * dev);
 };
 
 /* interface for exporting device attributes */
@@ -357,8 +367,12 @@ extern int __must_check device_create_bin_file(struct device *dev,
                                               struct bin_attribute *attr);
 extern void device_remove_bin_file(struct device *dev,
                                   struct bin_attribute *attr);
-extern int device_schedule_callback(struct device *dev,
-               void (*func)(struct device *));
+extern int device_schedule_callback_owner(struct device *dev,
+               void (*func)(struct device *), struct module *owner);
+
+/* This is a macro to avoid include problems with THIS_MODULE */
+#define device_schedule_callback(dev, func)                    \
+       device_schedule_callback_owner(dev, func, THIS_MODULE)
 
 /* device resource management */
 typedef void (*dr_release_t)(struct device *dev, void *res);
@@ -557,7 +571,11 @@ extern const char *dev_driver_string(struct device *dev);
 #define dev_dbg(dev, format, arg...)           \
        dev_printk(KERN_DEBUG , dev , format , ## arg)
 #else
-#define dev_dbg(dev, format, arg...) do { (void)(dev); } while (0)
+static inline int __attribute__ ((format (printf, 2, 3)))
+dev_dbg(struct device * dev, const char * fmt, ...)
+{
+       return 0;
+}
 #endif
 
 #define dev_err(dev, format, arg...)           \