diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/device.h | 360 | ||||
| -rw-r--r-- | include/linux/dmaengine.h | 3 | ||||
| -rw-r--r-- | include/linux/fs.h | 2 | ||||
| -rw-r--r-- | include/linux/genhd.h | 37 | ||||
| -rw-r--r-- | include/linux/kobject.h | 184 | ||||
| -rw-r--r-- | include/linux/kref.h | 1 | ||||
| -rw-r--r-- | include/linux/module.h | 19 | ||||
| -rw-r--r-- | include/linux/pci_hotplug.h | 2 | ||||
| -rw-r--r-- | include/linux/pktcdvd.h | 2 | ||||
| -rw-r--r-- | include/linux/platform_device.h | 2 | ||||
| -rw-r--r-- | include/linux/sched.h | 9 | ||||
| -rw-r--r-- | include/linux/sysdev.h | 1 | ||||
| -rw-r--r-- | include/linux/tifm.h | 2 | ||||
| -rw-r--r-- | include/linux/uio_driver.h | 6 |
14 files changed, 305 insertions, 325 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 2e15822fe409..1880208964d6 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -25,75 +25,69 @@ | |||
| 25 | #include <asm/device.h> | 25 | #include <asm/device.h> |
| 26 | 26 | ||
| 27 | #define DEVICE_NAME_SIZE 50 | 27 | #define DEVICE_NAME_SIZE 50 |
| 28 | #define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */ | 28 | /* DEVICE_NAME_HALF is really less than half to accommodate slop */ |
| 29 | #define DEVICE_NAME_HALF __stringify(20) | ||
| 29 | #define DEVICE_ID_SIZE 32 | 30 | #define DEVICE_ID_SIZE 32 |
| 30 | #define BUS_ID_SIZE KOBJ_NAME_LEN | 31 | #define BUS_ID_SIZE KOBJ_NAME_LEN |
| 31 | 32 | ||
| 32 | 33 | ||
| 33 | struct device; | 34 | struct device; |
| 34 | struct device_driver; | 35 | struct device_driver; |
| 36 | struct driver_private; | ||
| 35 | struct class; | 37 | struct class; |
| 36 | struct class_device; | 38 | struct class_device; |
| 37 | struct bus_type; | 39 | struct bus_type; |
| 40 | struct bus_type_private; | ||
| 38 | 41 | ||
| 39 | struct bus_attribute { | 42 | struct bus_attribute { |
| 40 | struct attribute attr; | 43 | struct attribute attr; |
| 41 | ssize_t (*show)(struct bus_type *, char * buf); | 44 | ssize_t (*show)(struct bus_type *bus, char *buf); |
| 42 | ssize_t (*store)(struct bus_type *, const char * buf, size_t count); | 45 | ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count); |
| 43 | }; | 46 | }; |
| 44 | 47 | ||
| 45 | #define BUS_ATTR(_name,_mode,_show,_store) \ | 48 | #define BUS_ATTR(_name, _mode, _show, _store) \ |
| 46 | struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store) | 49 | struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store) |
| 47 | 50 | ||
| 48 | extern int __must_check bus_create_file(struct bus_type *, | 51 | extern int __must_check bus_create_file(struct bus_type *, |
| 49 | struct bus_attribute *); | 52 | struct bus_attribute *); |
| 50 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | 53 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); |
| 51 | 54 | ||
| 52 | struct bus_type { | 55 | struct bus_type { |
| 53 | const char * name; | 56 | const char *name; |
| 54 | struct module * owner; | 57 | struct bus_attribute *bus_attrs; |
| 58 | struct device_attribute *dev_attrs; | ||
| 59 | struct driver_attribute *drv_attrs; | ||
| 55 | 60 | ||
| 56 | struct kset subsys; | 61 | int (*match)(struct device *dev, struct device_driver *drv); |
| 57 | struct kset drivers; | 62 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
| 58 | struct kset devices; | 63 | int (*probe)(struct device *dev); |
| 59 | struct klist klist_devices; | 64 | int (*remove)(struct device *dev); |
| 60 | struct klist klist_drivers; | 65 | void (*shutdown)(struct device *dev); |
| 61 | |||
| 62 | struct blocking_notifier_head bus_notifier; | ||
| 63 | |||
| 64 | struct bus_attribute * bus_attrs; | ||
| 65 | struct device_attribute * dev_attrs; | ||
| 66 | struct driver_attribute * drv_attrs; | ||
| 67 | |||
| 68 | int (*match)(struct device * dev, struct device_driver * drv); | ||
| 69 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); | ||
| 70 | int (*probe)(struct device * dev); | ||
| 71 | int (*remove)(struct device * dev); | ||
| 72 | void (*shutdown)(struct device * dev); | ||
| 73 | 66 | ||
| 74 | int (*suspend)(struct device * dev, pm_message_t state); | 67 | int (*suspend)(struct device *dev, pm_message_t state); |
| 75 | int (*suspend_late)(struct device * dev, pm_message_t state); | 68 | int (*suspend_late)(struct device *dev, pm_message_t state); |
| 76 | int (*resume_early)(struct device * dev); | 69 | int (*resume_early)(struct device *dev); |
| 77 | int (*resume)(struct device * dev); | 70 | int (*resume)(struct device *dev); |
| 78 | 71 | ||
| 79 | unsigned int drivers_autoprobe:1; | 72 | struct bus_type_private *p; |
| 80 | }; | 73 | }; |
| 81 | 74 | ||
| 82 | extern int __must_check bus_register(struct bus_type * bus); | 75 | extern int __must_check bus_register(struct bus_type *bus); |
| 83 | extern void bus_unregister(struct bus_type * bus); | 76 | extern void bus_unregister(struct bus_type *bus); |
| 84 | 77 | ||
| 85 | extern int __must_check bus_rescan_devices(struct bus_type * bus); | 78 | extern int __must_check bus_rescan_devices(struct bus_type *bus); |
| 86 | 79 | ||
| 87 | /* iterator helpers for buses */ | 80 | /* iterator helpers for buses */ |
| 88 | 81 | ||
| 89 | int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, | 82 | int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, |
| 90 | int (*fn)(struct device *, void *)); | 83 | int (*fn)(struct device *dev, void *data)); |
| 91 | struct device * bus_find_device(struct bus_type *bus, struct device *start, | 84 | struct device *bus_find_device(struct bus_type *bus, struct device *start, |
| 92 | void *data, int (*match)(struct device *, void *)); | 85 | void *data, |
| 86 | int (*match)(struct device *dev, void *data)); | ||
| 93 | 87 | ||
| 94 | int __must_check bus_for_each_drv(struct bus_type *bus, | 88 | int __must_check bus_for_each_drv(struct bus_type *bus, |
| 95 | struct device_driver *start, void *data, | 89 | struct device_driver *start, void *data, |
| 96 | int (*fn)(struct device_driver *, void *)); | 90 | int (*fn)(struct device_driver *, void *)); |
| 97 | 91 | ||
| 98 | /* | 92 | /* |
| 99 | * Bus notifiers: Get notified of addition/removal of devices | 93 | * Bus notifiers: Get notified of addition/removal of devices |
| @@ -118,111 +112,128 @@ extern int bus_unregister_notifier(struct bus_type *bus, | |||
| 118 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be | 112 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be |
| 119 | unbound */ | 113 | unbound */ |
| 120 | 114 | ||
| 115 | extern struct kset *bus_get_kset(struct bus_type *bus); | ||
| 116 | extern struct klist *bus_get_device_klist(struct bus_type *bus); | ||
| 117 | |||
| 121 | struct device_driver { | 118 | struct device_driver { |
| 122 | const char * name; | 119 | const char *name; |
| 123 | struct bus_type * bus; | 120 | struct bus_type *bus; |
| 124 | 121 | ||
| 125 | struct kobject kobj; | 122 | struct module *owner; |
| 126 | struct klist klist_devices; | 123 | const char *mod_name; /* used for built-in modules */ |
| 127 | struct klist_node knode_bus; | ||
| 128 | 124 | ||
| 129 | struct module * owner; | 125 | int (*probe) (struct device *dev); |
| 130 | const char * mod_name; /* used for built-in modules */ | 126 | int (*remove) (struct device *dev); |
| 131 | struct module_kobject * mkobj; | 127 | void (*shutdown) (struct device *dev); |
| 128 | int (*suspend) (struct device *dev, pm_message_t state); | ||
| 129 | int (*resume) (struct device *dev); | ||
| 130 | struct attribute_group **groups; | ||
| 132 | 131 | ||
| 133 | int (*probe) (struct device * dev); | 132 | struct driver_private *p; |
| 134 | int (*remove) (struct device * dev); | ||
| 135 | void (*shutdown) (struct device * dev); | ||
| 136 | int (*suspend) (struct device * dev, pm_message_t state); | ||
| 137 | int (*resume) (struct device * dev); | ||
| 138 | }; | 133 | }; |
| 139 | 134 | ||
| 140 | 135 | ||
| 141 | extern int __must_check driver_register(struct device_driver * drv); | 136 | extern int __must_check driver_register(struct device_driver *drv); |
| 142 | extern void driver_unregister(struct device_driver * drv); | 137 | extern void driver_unregister(struct device_driver *drv); |
| 143 | 138 | ||
| 144 | extern struct device_driver * get_driver(struct device_driver * drv); | 139 | extern struct device_driver *get_driver(struct device_driver *drv); |
| 145 | extern void put_driver(struct device_driver * drv); | 140 | extern void put_driver(struct device_driver *drv); |
| 146 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); | 141 | extern struct device_driver *driver_find(const char *name, |
| 142 | struct bus_type *bus); | ||
| 147 | extern int driver_probe_done(void); | 143 | extern int driver_probe_done(void); |
| 148 | 144 | ||
| 149 | /* sysfs interface for exporting driver attributes */ | 145 | /* sysfs interface for exporting driver attributes */ |
| 150 | 146 | ||
| 151 | struct driver_attribute { | 147 | struct driver_attribute { |
| 152 | struct attribute attr; | 148 | struct attribute attr; |
| 153 | ssize_t (*show)(struct device_driver *, char * buf); | 149 | ssize_t (*show)(struct device_driver *driver, char *buf); |
| 154 | ssize_t (*store)(struct device_driver *, const char * buf, size_t count); | 150 | ssize_t (*store)(struct device_driver *driver, const char *buf, |
| 151 | size_t count); | ||
| 155 | }; | 152 | }; |
| 156 | 153 | ||
| 157 | #define DRIVER_ATTR(_name,_mode,_show,_store) \ | 154 | #define DRIVER_ATTR(_name, _mode, _show, _store) \ |
| 158 | struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store) | 155 | struct driver_attribute driver_attr_##_name = \ |
| 156 | __ATTR(_name, _mode, _show, _store) | ||
| 159 | 157 | ||
| 160 | extern int __must_check driver_create_file(struct device_driver *, | 158 | extern int __must_check driver_create_file(struct device_driver *driver, |
| 161 | struct driver_attribute *); | 159 | struct driver_attribute *attr); |
| 162 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); | 160 | extern void driver_remove_file(struct device_driver *driver, |
| 161 | struct driver_attribute *attr); | ||
| 163 | 162 | ||
| 164 | extern int __must_check driver_for_each_device(struct device_driver * drv, | 163 | extern int __must_check driver_add_kobj(struct device_driver *drv, |
| 165 | struct device *start, void *data, | 164 | struct kobject *kobj, |
| 166 | int (*fn)(struct device *, void *)); | 165 | const char *fmt, ...); |
| 167 | struct device * driver_find_device(struct device_driver *drv, | 166 | |
| 168 | struct device *start, void *data, | 167 | extern int __must_check driver_for_each_device(struct device_driver *drv, |
| 169 | int (*match)(struct device *, void *)); | 168 | struct device *start, |
| 169 | void *data, | ||
| 170 | int (*fn)(struct device *dev, | ||
| 171 | void *)); | ||
| 172 | struct device *driver_find_device(struct device_driver *drv, | ||
| 173 | struct device *start, void *data, | ||
| 174 | int (*match)(struct device *dev, void *data)); | ||
| 170 | 175 | ||
| 171 | /* | 176 | /* |
| 172 | * device classes | 177 | * device classes |
| 173 | */ | 178 | */ |
| 174 | struct class { | 179 | struct class { |
| 175 | const char * name; | 180 | const char *name; |
| 176 | struct module * owner; | 181 | struct module *owner; |
| 177 | 182 | ||
| 178 | struct kset subsys; | 183 | struct kset subsys; |
| 179 | struct list_head children; | 184 | struct list_head children; |
| 180 | struct list_head devices; | 185 | struct list_head devices; |
| 181 | struct list_head interfaces; | 186 | struct list_head interfaces; |
| 182 | struct kset class_dirs; | 187 | struct kset class_dirs; |
| 183 | struct semaphore sem; /* locks both the children and interfaces lists */ | 188 | struct semaphore sem; /* locks children, devices, interfaces */ |
| 184 | 189 | struct class_attribute *class_attrs; | |
| 185 | struct class_attribute * class_attrs; | 190 | struct class_device_attribute *class_dev_attrs; |
| 186 | struct class_device_attribute * class_dev_attrs; | 191 | struct device_attribute *dev_attrs; |
| 187 | struct device_attribute * dev_attrs; | ||
| 188 | 192 | ||
| 189 | int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env); | 193 | int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env); |
| 190 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); | 194 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); |
| 191 | 195 | ||
| 192 | void (*release)(struct class_device *dev); | 196 | void (*release)(struct class_device *dev); |
| 193 | void (*class_release)(struct class *class); | 197 | void (*class_release)(struct class *class); |
| 194 | void (*dev_release)(struct device *dev); | 198 | void (*dev_release)(struct device *dev); |
| 195 | 199 | ||
| 196 | int (*suspend)(struct device *, pm_message_t state); | 200 | int (*suspend)(struct device *dev, pm_message_t state); |
| 197 | int (*resume)(struct device *); | 201 | int (*resume)(struct device *dev); |
| 198 | }; | 202 | }; |
| 199 | 203 | ||
| 200 | extern int __must_check class_register(struct class *); | 204 | extern int __must_check class_register(struct class *class); |
| 201 | extern void class_unregister(struct class *); | 205 | extern void class_unregister(struct class *class); |
| 206 | extern int class_for_each_device(struct class *class, void *data, | ||
| 207 | int (*fn)(struct device *dev, void *data)); | ||
| 208 | extern struct device *class_find_device(struct class *class, void *data, | ||
| 209 | int (*match)(struct device *, void *)); | ||
| 210 | extern struct class_device *class_find_child(struct class *class, void *data, | ||
| 211 | int (*match)(struct class_device *, void *)); | ||
| 202 | 212 | ||
| 203 | 213 | ||
| 204 | struct class_attribute { | 214 | struct class_attribute { |
| 205 | struct attribute attr; | 215 | struct attribute attr; |
| 206 | ssize_t (*show)(struct class *, char * buf); | 216 | ssize_t (*show)(struct class *class, char *buf); |
| 207 | ssize_t (*store)(struct class *, const char * buf, size_t count); | 217 | ssize_t (*store)(struct class *class, const char *buf, size_t count); |
| 208 | }; | 218 | }; |
| 209 | 219 | ||
| 210 | #define CLASS_ATTR(_name,_mode,_show,_store) \ | 220 | #define CLASS_ATTR(_name, _mode, _show, _store) \ |
| 211 | struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store) | 221 | struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store) |
| 212 | 222 | ||
| 213 | extern int __must_check class_create_file(struct class *, | 223 | extern int __must_check class_create_file(struct class *class, |
| 214 | const struct class_attribute *); | 224 | const struct class_attribute *attr); |
| 215 | extern void class_remove_file(struct class *, const struct class_attribute *); | 225 | extern void class_remove_file(struct class *class, |
| 226 | const struct class_attribute *attr); | ||
| 216 | 227 | ||
| 217 | struct class_device_attribute { | 228 | struct class_device_attribute { |
| 218 | struct attribute attr; | 229 | struct attribute attr; |
| 219 | ssize_t (*show)(struct class_device *, char * buf); | 230 | ssize_t (*show)(struct class_device *, char *buf); |
| 220 | ssize_t (*store)(struct class_device *, const char * buf, size_t count); | 231 | ssize_t (*store)(struct class_device *, const char *buf, size_t count); |
| 221 | }; | 232 | }; |
| 222 | 233 | ||
| 223 | #define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \ | 234 | #define CLASS_DEVICE_ATTR(_name, _mode, _show, _store) \ |
| 224 | struct class_device_attribute class_device_attr_##_name = \ | 235 | struct class_device_attribute class_device_attr_##_name = \ |
| 225 | __ATTR(_name,_mode,_show,_store) | 236 | __ATTR(_name, _mode, _show, _store) |
| 226 | 237 | ||
| 227 | extern int __must_check class_device_create_file(struct class_device *, | 238 | extern int __must_check class_device_create_file(struct class_device *, |
| 228 | const struct class_device_attribute *); | 239 | const struct class_device_attribute *); |
| @@ -255,26 +266,24 @@ struct class_device { | |||
| 255 | struct list_head node; | 266 | struct list_head node; |
| 256 | 267 | ||
| 257 | struct kobject kobj; | 268 | struct kobject kobj; |
| 258 | struct class * class; /* required */ | 269 | struct class *class; |
| 259 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 270 | dev_t devt; |
| 260 | struct device * dev; /* not necessary, but nice to have */ | 271 | struct device *dev; |
| 261 | void * class_data; /* class-specific data */ | 272 | void *class_data; |
| 262 | struct class_device *parent; /* parent of this child device, if there is one */ | 273 | struct class_device *parent; |
| 263 | struct attribute_group ** groups; /* optional groups */ | 274 | struct attribute_group **groups; |
| 264 | 275 | ||
| 265 | void (*release)(struct class_device *dev); | 276 | void (*release)(struct class_device *dev); |
| 266 | int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env); | 277 | int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env); |
| 267 | char class_id[BUS_ID_SIZE]; /* unique to this class */ | 278 | char class_id[BUS_ID_SIZE]; |
| 268 | }; | 279 | }; |
| 269 | 280 | ||
| 270 | static inline void * | 281 | static inline void *class_get_devdata(struct class_device *dev) |
| 271 | class_get_devdata (struct class_device *dev) | ||
| 272 | { | 282 | { |
| 273 | return dev->class_data; | 283 | return dev->class_data; |
| 274 | } | 284 | } |
| 275 | 285 | ||
| 276 | static inline void | 286 | static inline void class_set_devdata(struct class_device *dev, void *data) |
| 277 | class_set_devdata (struct class_device *dev, void *data) | ||
| 278 | { | 287 | { |
| 279 | dev->class_data = data; | 288 | dev->class_data = data; |
| 280 | } | 289 | } |
| @@ -286,10 +295,10 @@ extern void class_device_initialize(struct class_device *); | |||
| 286 | extern int __must_check class_device_add(struct class_device *); | 295 | extern int __must_check class_device_add(struct class_device *); |
| 287 | extern void class_device_del(struct class_device *); | 296 | extern void class_device_del(struct class_device *); |
| 288 | 297 | ||
| 289 | extern struct class_device * class_device_get(struct class_device *); | 298 | extern struct class_device *class_device_get(struct class_device *); |
| 290 | extern void class_device_put(struct class_device *); | 299 | extern void class_device_put(struct class_device *); |
| 291 | 300 | ||
| 292 | extern void class_device_remove_file(struct class_device *, | 301 | extern void class_device_remove_file(struct class_device *, |
| 293 | const struct class_device_attribute *); | 302 | const struct class_device_attribute *); |
| 294 | extern int __must_check class_device_create_bin_file(struct class_device *, | 303 | extern int __must_check class_device_create_bin_file(struct class_device *, |
| 295 | struct bin_attribute *); | 304 | struct bin_attribute *); |
| @@ -316,7 +325,7 @@ extern struct class_device *class_device_create(struct class *cls, | |||
| 316 | dev_t devt, | 325 | dev_t devt, |
| 317 | struct device *device, | 326 | struct device *device, |
| 318 | const char *fmt, ...) | 327 | const char *fmt, ...) |
| 319 | __attribute__((format(printf,5,6))); | 328 | __attribute__((format(printf, 5, 6))); |
| 320 | extern void class_device_destroy(struct class *cls, dev_t devt); | 329 | extern void class_device_destroy(struct class *cls, dev_t devt); |
| 321 | 330 | ||
| 322 | /* | 331 | /* |
| @@ -333,8 +342,8 @@ struct device_type { | |||
| 333 | struct attribute_group **groups; | 342 | struct attribute_group **groups; |
| 334 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); | 343 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
| 335 | void (*release)(struct device *dev); | 344 | void (*release)(struct device *dev); |
| 336 | int (*suspend)(struct device * dev, pm_message_t state); | 345 | int (*suspend)(struct device *dev, pm_message_t state); |
| 337 | int (*resume)(struct device * dev); | 346 | int (*resume)(struct device *dev); |
| 338 | }; | 347 | }; |
| 339 | 348 | ||
| 340 | /* interface for exporting device attributes */ | 349 | /* interface for exporting device attributes */ |
| @@ -346,18 +355,19 @@ struct device_attribute { | |||
| 346 | const char *buf, size_t count); | 355 | const char *buf, size_t count); |
| 347 | }; | 356 | }; |
| 348 | 357 | ||
| 349 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | 358 | #define DEVICE_ATTR(_name, _mode, _show, _store) \ |
| 350 | struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store) | 359 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) |
| 351 | 360 | ||
| 352 | extern int __must_check device_create_file(struct device *device, | 361 | extern int __must_check device_create_file(struct device *device, |
| 353 | struct device_attribute * entry); | 362 | struct device_attribute *entry); |
| 354 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); | 363 | extern void device_remove_file(struct device *dev, |
| 364 | struct device_attribute *attr); | ||
| 355 | extern int __must_check device_create_bin_file(struct device *dev, | 365 | extern int __must_check device_create_bin_file(struct device *dev, |
| 356 | struct bin_attribute *attr); | 366 | struct bin_attribute *attr); |
| 357 | extern void device_remove_bin_file(struct device *dev, | 367 | extern void device_remove_bin_file(struct device *dev, |
| 358 | struct bin_attribute *attr); | 368 | struct bin_attribute *attr); |
| 359 | extern int device_schedule_callback_owner(struct device *dev, | 369 | extern int device_schedule_callback_owner(struct device *dev, |
| 360 | void (*func)(struct device *), struct module *owner); | 370 | void (*func)(struct device *dev), struct module *owner); |
| 361 | 371 | ||
| 362 | /* This is a macro to avoid include problems with THIS_MODULE */ | 372 | /* This is a macro to avoid include problems with THIS_MODULE */ |
| 363 | #define device_schedule_callback(dev, func) \ | 373 | #define device_schedule_callback(dev, func) \ |
| @@ -368,21 +378,21 @@ typedef void (*dr_release_t)(struct device *dev, void *res); | |||
| 368 | typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data); | 378 | typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data); |
| 369 | 379 | ||
| 370 | #ifdef CONFIG_DEBUG_DEVRES | 380 | #ifdef CONFIG_DEBUG_DEVRES |
| 371 | extern void * __devres_alloc(dr_release_t release, size_t size, gfp_t gfp, | 381 | extern void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp, |
| 372 | const char *name); | 382 | const char *name); |
| 373 | #define devres_alloc(release, size, gfp) \ | 383 | #define devres_alloc(release, size, gfp) \ |
| 374 | __devres_alloc(release, size, gfp, #release) | 384 | __devres_alloc(release, size, gfp, #release) |
| 375 | #else | 385 | #else |
| 376 | extern void * devres_alloc(dr_release_t release, size_t size, gfp_t gfp); | 386 | extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp); |
| 377 | #endif | 387 | #endif |
| 378 | extern void devres_free(void *res); | 388 | extern void devres_free(void *res); |
| 379 | extern void devres_add(struct device *dev, void *res); | 389 | extern void devres_add(struct device *dev, void *res); |
| 380 | extern void * devres_find(struct device *dev, dr_release_t release, | 390 | extern void *devres_find(struct device *dev, dr_release_t release, |
| 381 | dr_match_t match, void *match_data); | ||
| 382 | extern void * devres_get(struct device *dev, void *new_res, | ||
| 383 | dr_match_t match, void *match_data); | 391 | dr_match_t match, void *match_data); |
| 384 | extern void * devres_remove(struct device *dev, dr_release_t release, | 392 | extern void *devres_get(struct device *dev, void *new_res, |
| 385 | dr_match_t match, void *match_data); | 393 | dr_match_t match, void *match_data); |
| 394 | extern void *devres_remove(struct device *dev, dr_release_t release, | ||
| 395 | dr_match_t match, void *match_data); | ||
| 386 | extern int devres_destroy(struct device *dev, dr_release_t release, | 396 | extern int devres_destroy(struct device *dev, dr_release_t release, |
| 387 | dr_match_t match, void *match_data); | 397 | dr_match_t match, void *match_data); |
| 388 | 398 | ||
| @@ -399,7 +409,7 @@ extern void devm_kfree(struct device *dev, void *p); | |||
| 399 | 409 | ||
| 400 | struct device { | 410 | struct device { |
| 401 | struct klist klist_children; | 411 | struct klist klist_children; |
| 402 | struct klist_node knode_parent; /* node in sibling list */ | 412 | struct klist_node knode_parent; /* node in sibling list */ |
| 403 | struct klist_node knode_driver; | 413 | struct klist_node knode_driver; |
| 404 | struct klist_node knode_bus; | 414 | struct klist_node knode_bus; |
| 405 | struct device *parent; | 415 | struct device *parent; |
| @@ -414,7 +424,7 @@ struct device { | |||
| 414 | * its driver. | 424 | * its driver. |
| 415 | */ | 425 | */ |
| 416 | 426 | ||
| 417 | struct bus_type * bus; /* type of bus device is on */ | 427 | struct bus_type *bus; /* type of bus device is on */ |
| 418 | struct device_driver *driver; /* which driver has allocated this | 428 | struct device_driver *driver; /* which driver has allocated this |
| 419 | device */ | 429 | device */ |
| 420 | void *driver_data; /* data private to the driver */ | 430 | void *driver_data; /* data private to the driver */ |
| @@ -445,10 +455,10 @@ struct device { | |||
| 445 | /* class_device migration path */ | 455 | /* class_device migration path */ |
| 446 | struct list_head node; | 456 | struct list_head node; |
| 447 | struct class *class; | 457 | struct class *class; |
| 448 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 458 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
| 449 | struct attribute_group **groups; /* optional groups */ | 459 | struct attribute_group **groups; /* optional groups */ |
| 450 | 460 | ||
| 451 | void (*release)(struct device * dev); | 461 | void (*release)(struct device *dev); |
| 452 | }; | 462 | }; |
| 453 | 463 | ||
| 454 | #ifdef CONFIG_NUMA | 464 | #ifdef CONFIG_NUMA |
| @@ -470,14 +480,12 @@ static inline void set_dev_node(struct device *dev, int node) | |||
| 470 | } | 480 | } |
| 471 | #endif | 481 | #endif |
| 472 | 482 | ||
| 473 | static inline void * | 483 | static inline void *dev_get_drvdata(struct device *dev) |
| 474 | dev_get_drvdata (struct device *dev) | ||
| 475 | { | 484 | { |
| 476 | return dev->driver_data; | 485 | return dev->driver_data; |
| 477 | } | 486 | } |
| 478 | 487 | ||
| 479 | static inline void | 488 | static inline void dev_set_drvdata(struct device *dev, void *data) |
| 480 | dev_set_drvdata (struct device *dev, void *data) | ||
| 481 | { | 489 | { |
| 482 | dev->driver_data = data; | 490 | dev->driver_data = data; |
| 483 | } | 491 | } |
| @@ -492,15 +500,15 @@ void driver_init(void); | |||
| 492 | /* | 500 | /* |
| 493 | * High level routines for use by the bus drivers | 501 | * High level routines for use by the bus drivers |
| 494 | */ | 502 | */ |
| 495 | extern int __must_check device_register(struct device * dev); | 503 | extern int __must_check device_register(struct device *dev); |
| 496 | extern void device_unregister(struct device * dev); | 504 | extern void device_unregister(struct device *dev); |
| 497 | extern void device_initialize(struct device * dev); | 505 | extern void device_initialize(struct device *dev); |
| 498 | extern int __must_check device_add(struct device * dev); | 506 | extern int __must_check device_add(struct device *dev); |
| 499 | extern void device_del(struct device * dev); | 507 | extern void device_del(struct device *dev); |
| 500 | extern int device_for_each_child(struct device *, void *, | 508 | extern int device_for_each_child(struct device *dev, void *data, |
| 501 | int (*fn)(struct device *, void *)); | 509 | int (*fn)(struct device *dev, void *data)); |
| 502 | extern struct device *device_find_child(struct device *, void *data, | 510 | extern struct device *device_find_child(struct device *dev, void *data, |
| 503 | int (*match)(struct device *, void *)); | 511 | int (*match)(struct device *dev, void *data)); |
| 504 | extern int device_rename(struct device *dev, char *new_name); | 512 | extern int device_rename(struct device *dev, char *new_name); |
| 505 | extern int device_move(struct device *dev, struct device *new_parent); | 513 | extern int device_move(struct device *dev, struct device *new_parent); |
| 506 | 514 | ||
| @@ -509,8 +517,8 @@ extern int device_move(struct device *dev, struct device *new_parent); | |||
| 509 | * for information on use. | 517 | * for information on use. |
| 510 | */ | 518 | */ |
| 511 | extern int __must_check device_bind_driver(struct device *dev); | 519 | extern int __must_check device_bind_driver(struct device *dev); |
| 512 | extern void device_release_driver(struct device * dev); | 520 | extern void device_release_driver(struct device *dev); |
| 513 | extern int __must_check device_attach(struct device * dev); | 521 | extern int __must_check device_attach(struct device *dev); |
| 514 | extern int __must_check driver_attach(struct device_driver *drv); | 522 | extern int __must_check driver_attach(struct device_driver *drv); |
| 515 | extern int __must_check device_reprobe(struct device *dev); | 523 | extern int __must_check device_reprobe(struct device *dev); |
| 516 | 524 | ||
| @@ -519,8 +527,16 @@ extern int __must_check device_reprobe(struct device *dev); | |||
| 519 | */ | 527 | */ |
| 520 | extern struct device *device_create(struct class *cls, struct device *parent, | 528 | extern struct device *device_create(struct class *cls, struct device *parent, |
| 521 | dev_t devt, const char *fmt, ...) | 529 | dev_t devt, const char *fmt, ...) |
| 522 | __attribute__((format(printf,4,5))); | 530 | __attribute__((format(printf, 4, 5))); |
| 523 | extern void device_destroy(struct class *cls, dev_t devt); | 531 | extern void device_destroy(struct class *cls, dev_t devt); |
| 532 | #ifdef CONFIG_PM_SLEEP | ||
| 533 | extern void destroy_suspended_device(struct class *cls, dev_t devt); | ||
| 534 | #else /* !CONFIG_PM_SLEEP */ | ||
| 535 | static inline void destroy_suspended_device(struct class *cls, dev_t devt) | ||
| 536 | { | ||
| 537 | device_destroy(cls, devt); | ||
| 538 | } | ||
| 539 | #endif /* !CONFIG_PM_SLEEP */ | ||
| 524 | 540 | ||
| 525 | /* | 541 | /* |
| 526 | * Platform "fixup" functions - allow the platform to have their say | 542 | * Platform "fixup" functions - allow the platform to have their say |
| @@ -528,17 +544,17 @@ extern void device_destroy(struct class *cls, dev_t devt); | |||
| 528 | * know about. | 544 | * know about. |
| 529 | */ | 545 | */ |
| 530 | /* Notify platform of device discovery */ | 546 | /* Notify platform of device discovery */ |
| 531 | extern int (*platform_notify)(struct device * dev); | 547 | extern int (*platform_notify)(struct device *dev); |
| 532 | 548 | ||
| 533 | extern int (*platform_notify_remove)(struct device * dev); | 549 | extern int (*platform_notify_remove)(struct device *dev); |
| 534 | 550 | ||
| 535 | 551 | ||
| 536 | /** | 552 | /** |
| 537 | * get_device - atomically increment the reference count for the device. | 553 | * get_device - atomically increment the reference count for the device. |
| 538 | * | 554 | * |
| 539 | */ | 555 | */ |
| 540 | extern struct device * get_device(struct device * dev); | 556 | extern struct device *get_device(struct device *dev); |
| 541 | extern void put_device(struct device * dev); | 557 | extern void put_device(struct device *dev); |
| 542 | 558 | ||
| 543 | 559 | ||
| 544 | /* drivers/base/power/shutdown.c */ | 560 | /* drivers/base/power/shutdown.c */ |
| @@ -547,22 +563,33 @@ extern void device_shutdown(void); | |||
| 547 | /* drivers/base/sys.c */ | 563 | /* drivers/base/sys.c */ |
| 548 | extern void sysdev_shutdown(void); | 564 | extern void sysdev_shutdown(void); |
| 549 | 565 | ||
| 550 | |||
| 551 | /* drivers/base/firmware.c */ | ||
| 552 | extern int __must_check firmware_register(struct kset *); | ||
| 553 | extern void firmware_unregister(struct kset *); | ||
| 554 | |||
| 555 | /* debugging and troubleshooting/diagnostic helpers. */ | 566 | /* debugging and troubleshooting/diagnostic helpers. */ |
| 556 | extern const char *dev_driver_string(struct device *dev); | 567 | extern const char *dev_driver_string(struct device *dev); |
| 557 | #define dev_printk(level, dev, format, arg...) \ | 568 | #define dev_printk(level, dev, format, arg...) \ |
| 558 | printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg) | 569 | printk(level "%s %s: " format , dev_driver_string(dev) , \ |
| 570 | (dev)->bus_id , ## arg) | ||
| 571 | |||
| 572 | #define dev_emerg(dev, format, arg...) \ | ||
| 573 | dev_printk(KERN_EMERG , dev , format , ## arg) | ||
| 574 | #define dev_alert(dev, format, arg...) \ | ||
| 575 | dev_printk(KERN_ALERT , dev , format , ## arg) | ||
| 576 | #define dev_crit(dev, format, arg...) \ | ||
| 577 | dev_printk(KERN_CRIT , dev , format , ## arg) | ||
| 578 | #define dev_err(dev, format, arg...) \ | ||
| 579 | dev_printk(KERN_ERR , dev , format , ## arg) | ||
| 580 | #define dev_warn(dev, format, arg...) \ | ||
| 581 | dev_printk(KERN_WARNING , dev , format , ## arg) | ||
| 582 | #define dev_notice(dev, format, arg...) \ | ||
| 583 | dev_printk(KERN_NOTICE , dev , format , ## arg) | ||
| 584 | #define dev_info(dev, format, arg...) \ | ||
| 585 | dev_printk(KERN_INFO , dev , format , ## arg) | ||
| 559 | 586 | ||
| 560 | #ifdef DEBUG | 587 | #ifdef DEBUG |
| 561 | #define dev_dbg(dev, format, arg...) \ | 588 | #define dev_dbg(dev, format, arg...) \ |
| 562 | dev_printk(KERN_DEBUG , dev , format , ## arg) | 589 | dev_printk(KERN_DEBUG , dev , format , ## arg) |
| 563 | #else | 590 | #else |
| 564 | static inline int __attribute__ ((format (printf, 2, 3))) | 591 | static inline int __attribute__ ((format (printf, 2, 3))) |
| 565 | dev_dbg(struct device * dev, const char * fmt, ...) | 592 | dev_dbg(struct device *dev, const char *fmt, ...) |
| 566 | { | 593 | { |
| 567 | return 0; | 594 | return 0; |
| 568 | } | 595 | } |
| @@ -572,21 +599,12 @@ dev_dbg(struct device * dev, const char * fmt, ...) | |||
| 572 | #define dev_vdbg dev_dbg | 599 | #define dev_vdbg dev_dbg |
| 573 | #else | 600 | #else |
| 574 | static inline int __attribute__ ((format (printf, 2, 3))) | 601 | static inline int __attribute__ ((format (printf, 2, 3))) |
| 575 | dev_vdbg(struct device * dev, const char * fmt, ...) | 602 | dev_vdbg(struct device *dev, const char *fmt, ...) |
| 576 | { | 603 | { |
| 577 | return 0; | 604 | return 0; |
| 578 | } | 605 | } |
| 579 | #endif | 606 | #endif |
| 580 | 607 | ||
| 581 | #define dev_err(dev, format, arg...) \ | ||
| 582 | dev_printk(KERN_ERR , dev , format , ## arg) | ||
| 583 | #define dev_info(dev, format, arg...) \ | ||
| 584 | dev_printk(KERN_INFO , dev , format , ## arg) | ||
| 585 | #define dev_warn(dev, format, arg...) \ | ||
| 586 | dev_printk(KERN_WARNING , dev , format , ## arg) | ||
| 587 | #define dev_notice(dev, format, arg...) \ | ||
| 588 | dev_printk(KERN_NOTICE , dev , format , ## arg) | ||
| 589 | |||
| 590 | /* Create alias, so I can be autoloaded. */ | 608 | /* Create alias, so I can be autoloaded. */ |
| 591 | #define MODULE_ALIAS_CHARDEV(major,minor) \ | 609 | #define MODULE_ALIAS_CHARDEV(major,minor) \ |
| 592 | MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) | 610 | MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index a3b6035b6c86..55c9a6952f44 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -132,7 +132,7 @@ struct dma_chan { | |||
| 132 | 132 | ||
| 133 | /* sysfs */ | 133 | /* sysfs */ |
| 134 | int chan_id; | 134 | int chan_id; |
| 135 | struct class_device class_dev; | 135 | struct device dev; |
| 136 | 136 | ||
| 137 | struct kref refcount; | 137 | struct kref refcount; |
| 138 | int slow_ref; | 138 | int slow_ref; |
| @@ -142,6 +142,7 @@ struct dma_chan { | |||
| 142 | struct dma_chan_percpu *local; | 142 | struct dma_chan_percpu *local; |
| 143 | }; | 143 | }; |
| 144 | 144 | ||
| 145 | #define to_dma_chan(p) container_of(p, struct dma_chan, dev) | ||
| 145 | 146 | ||
| 146 | void dma_chan_cleanup(struct kref *kref); | 147 | void dma_chan_cleanup(struct kref *kref); |
| 147 | 148 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index b3ec4a496d64..21398a5d688d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1476,7 +1476,7 @@ extern void drop_collected_mounts(struct vfsmount *); | |||
| 1476 | extern int vfs_statfs(struct dentry *, struct kstatfs *); | 1476 | extern int vfs_statfs(struct dentry *, struct kstatfs *); |
| 1477 | 1477 | ||
| 1478 | /* /sys/fs */ | 1478 | /* /sys/fs */ |
| 1479 | extern struct kset fs_subsys; | 1479 | extern struct kobject *fs_kobj; |
| 1480 | 1480 | ||
| 1481 | #define FLOCK_VERIFY_READ 1 | 1481 | #define FLOCK_VERIFY_READ 1 |
| 1482 | #define FLOCK_VERIFY_WRITE 2 | 1482 | #define FLOCK_VERIFY_WRITE 2 |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index a47b8025d399..1dbea0ac5693 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -10,9 +10,19 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/kdev_t.h> | ||
| 13 | 14 | ||
| 14 | #ifdef CONFIG_BLOCK | 15 | #ifdef CONFIG_BLOCK |
| 15 | 16 | ||
| 17 | #define kobj_to_dev(k) container_of(k, struct device, kobj) | ||
| 18 | #define dev_to_disk(device) container_of(device, struct gendisk, dev) | ||
| 19 | #define dev_to_part(device) container_of(device, struct hd_struct, dev) | ||
| 20 | |||
| 21 | extern struct device_type disk_type; | ||
| 22 | extern struct device_type part_type; | ||
| 23 | extern struct kobject *block_depr; | ||
| 24 | extern struct class block_class; | ||
| 25 | |||
| 16 | enum { | 26 | enum { |
| 17 | /* These three have identical behaviour; use the second one if DOS FDISK gets | 27 | /* These three have identical behaviour; use the second one if DOS FDISK gets |
| 18 | confused about extended/logical partitions starting past cylinder 1023. */ | 28 | confused about extended/logical partitions starting past cylinder 1023. */ |
| @@ -84,7 +94,7 @@ struct partition { | |||
| 84 | struct hd_struct { | 94 | struct hd_struct { |
| 85 | sector_t start_sect; | 95 | sector_t start_sect; |
| 86 | sector_t nr_sects; | 96 | sector_t nr_sects; |
| 87 | struct kobject kobj; | 97 | struct device dev; |
| 88 | struct kobject *holder_dir; | 98 | struct kobject *holder_dir; |
| 89 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ | 99 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ |
| 90 | int policy, partno; | 100 | int policy, partno; |
| @@ -117,15 +127,14 @@ struct gendisk { | |||
| 117 | * disks that can't be partitioned. */ | 127 | * disks that can't be partitioned. */ |
| 118 | char disk_name[32]; /* name of major driver */ | 128 | char disk_name[32]; /* name of major driver */ |
| 119 | struct hd_struct **part; /* [indexed by minor] */ | 129 | struct hd_struct **part; /* [indexed by minor] */ |
| 120 | int part_uevent_suppress; | ||
| 121 | struct block_device_operations *fops; | 130 | struct block_device_operations *fops; |
| 122 | struct request_queue *queue; | 131 | struct request_queue *queue; |
| 123 | void *private_data; | 132 | void *private_data; |
| 124 | sector_t capacity; | 133 | sector_t capacity; |
| 125 | 134 | ||
| 126 | int flags; | 135 | int flags; |
| 127 | struct device *driverfs_dev; | 136 | struct device *driverfs_dev; // FIXME: remove |
| 128 | struct kobject kobj; | 137 | struct device dev; |
| 129 | struct kobject *holder_dir; | 138 | struct kobject *holder_dir; |
| 130 | struct kobject *slave_dir; | 139 | struct kobject *slave_dir; |
| 131 | 140 | ||
| @@ -143,13 +152,6 @@ struct gendisk { | |||
| 143 | struct work_struct async_notify; | 152 | struct work_struct async_notify; |
| 144 | }; | 153 | }; |
| 145 | 154 | ||
| 146 | /* Structure for sysfs attributes on block devices */ | ||
| 147 | struct disk_attribute { | ||
| 148 | struct attribute attr; | ||
| 149 | ssize_t (*show)(struct gendisk *, char *); | ||
| 150 | ssize_t (*store)(struct gendisk *, const char *, size_t); | ||
| 151 | }; | ||
| 152 | |||
| 153 | /* | 155 | /* |
| 154 | * Macros to operate on percpu disk statistics: | 156 | * Macros to operate on percpu disk statistics: |
| 155 | * | 157 | * |
| @@ -411,7 +413,8 @@ struct unixware_disklabel { | |||
| 411 | #define ADDPART_FLAG_RAID 1 | 413 | #define ADDPART_FLAG_RAID 1 |
| 412 | #define ADDPART_FLAG_WHOLEDISK 2 | 414 | #define ADDPART_FLAG_WHOLEDISK 2 |
| 413 | 415 | ||
| 414 | char *disk_name (struct gendisk *hd, int part, char *buf); | 416 | extern dev_t blk_lookup_devt(const char *name); |
| 417 | extern char *disk_name (struct gendisk *hd, int part, char *buf); | ||
| 415 | 418 | ||
| 416 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); | 419 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); |
| 417 | extern void add_partition(struct gendisk *, int, sector_t, sector_t, int); | 420 | extern void add_partition(struct gendisk *, int, sector_t, sector_t, int); |
| @@ -423,12 +426,12 @@ extern struct gendisk *alloc_disk(int minors); | |||
| 423 | extern struct kobject *get_disk(struct gendisk *disk); | 426 | extern struct kobject *get_disk(struct gendisk *disk); |
| 424 | extern void put_disk(struct gendisk *disk); | 427 | extern void put_disk(struct gendisk *disk); |
| 425 | extern void genhd_media_change_notify(struct gendisk *disk); | 428 | extern void genhd_media_change_notify(struct gendisk *disk); |
| 426 | extern void blk_register_region(dev_t dev, unsigned long range, | 429 | extern void blk_register_region(dev_t devt, unsigned long range, |
| 427 | struct module *module, | 430 | struct module *module, |
| 428 | struct kobject *(*probe)(dev_t, int *, void *), | 431 | struct kobject *(*probe)(dev_t, int *, void *), |
| 429 | int (*lock)(dev_t, void *), | 432 | int (*lock)(dev_t, void *), |
| 430 | void *data); | 433 | void *data); |
| 431 | extern void blk_unregister_region(dev_t dev, unsigned long range); | 434 | extern void blk_unregister_region(dev_t devt, unsigned long range); |
| 432 | 435 | ||
| 433 | static inline struct block_device *bdget_disk(struct gendisk *disk, int index) | 436 | static inline struct block_device *bdget_disk(struct gendisk *disk, int index) |
| 434 | { | 437 | { |
| @@ -441,6 +444,12 @@ static inline struct block_device *bdget_disk(struct gendisk *disk, int index) | |||
| 441 | 444 | ||
| 442 | static inline void printk_all_partitions(void) { } | 445 | static inline void printk_all_partitions(void) { } |
| 443 | 446 | ||
| 447 | static inline dev_t blk_lookup_devt(const char *name) | ||
| 448 | { | ||
| 449 | dev_t devt = MKDEV(0, 0); | ||
| 450 | return devt; | ||
| 451 | } | ||
| 452 | |||
| 444 | #endif /* CONFIG_BLOCK */ | 453 | #endif /* CONFIG_BLOCK */ |
| 445 | 454 | ||
| 446 | #endif | 455 | #endif |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 4a0d27f475d7..caa3f411f15d 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -3,15 +3,14 @@ | |||
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2002-2003 Patrick Mochel | 4 | * Copyright (c) 2002-2003 Patrick Mochel |
| 5 | * Copyright (c) 2002-2003 Open Source Development Labs | 5 | * Copyright (c) 2002-2003 Open Source Development Labs |
| 6 | * Copyright (c) 2006-2007 Greg Kroah-Hartman <greg@kroah.com> | 6 | * Copyright (c) 2006-2008 Greg Kroah-Hartman <greg@kroah.com> |
| 7 | * Copyright (c) 2006-2007 Novell Inc. | 7 | * Copyright (c) 2006-2008 Novell Inc. |
| 8 | * | 8 | * |
| 9 | * This file is released under the GPLv2. | 9 | * This file is released under the GPLv2. |
| 10 | * | 10 | * |
| 11 | * | ||
| 12 | * Please read Documentation/kobject.txt before using the kobject | 11 | * Please read Documentation/kobject.txt before using the kobject |
| 13 | * interface, ESPECIALLY the parts about reference counts and object | 12 | * interface, ESPECIALLY the parts about reference counts and object |
| 14 | * destructors. | 13 | * destructors. |
| 15 | */ | 14 | */ |
| 16 | 15 | ||
| 17 | #ifndef _KOBJECT_H_ | 16 | #ifndef _KOBJECT_H_ |
| @@ -61,48 +60,54 @@ enum kobject_action { | |||
| 61 | }; | 60 | }; |
| 62 | 61 | ||
| 63 | struct kobject { | 62 | struct kobject { |
| 64 | const char * k_name; | 63 | const char *name; |
| 65 | struct kref kref; | 64 | struct kref kref; |
| 66 | struct list_head entry; | 65 | struct list_head entry; |
| 67 | struct kobject * parent; | 66 | struct kobject *parent; |
| 68 | struct kset * kset; | 67 | struct kset *kset; |
| 69 | struct kobj_type * ktype; | 68 | struct kobj_type *ktype; |
| 70 | struct sysfs_dirent * sd; | 69 | struct sysfs_dirent *sd; |
| 70 | unsigned int state_initialized:1; | ||
| 71 | unsigned int state_in_sysfs:1; | ||
| 72 | unsigned int state_add_uevent_sent:1; | ||
| 73 | unsigned int state_remove_uevent_sent:1; | ||
| 71 | }; | 74 | }; |
| 72 | 75 | ||
| 73 | extern int kobject_set_name(struct kobject *, const char *, ...) | 76 | extern int kobject_set_name(struct kobject *kobj, const char *name, ...) |
| 74 | __attribute__((format(printf,2,3))); | 77 | __attribute__((format(printf, 2, 3))); |
| 75 | 78 | ||
| 76 | static inline const char * kobject_name(const struct kobject * kobj) | 79 | static inline const char *kobject_name(const struct kobject *kobj) |
| 77 | { | 80 | { |
| 78 | return kobj->k_name; | 81 | return kobj->name; |
| 79 | } | 82 | } |
| 80 | 83 | ||
| 81 | extern void kobject_init(struct kobject *); | 84 | extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); |
| 82 | extern void kobject_cleanup(struct kobject *); | 85 | extern int __must_check kobject_add(struct kobject *kobj, |
| 86 | struct kobject *parent, | ||
| 87 | const char *fmt, ...); | ||
| 88 | extern int __must_check kobject_init_and_add(struct kobject *kobj, | ||
| 89 | struct kobj_type *ktype, | ||
| 90 | struct kobject *parent, | ||
| 91 | const char *fmt, ...); | ||
| 92 | |||
| 93 | extern void kobject_del(struct kobject *kobj); | ||
| 83 | 94 | ||
| 84 | extern int __must_check kobject_add(struct kobject *); | 95 | extern struct kobject * __must_check kobject_create(void); |
| 85 | extern void kobject_del(struct kobject *); | 96 | extern struct kobject * __must_check kobject_create_and_add(const char *name, |
| 97 | struct kobject *parent); | ||
| 86 | 98 | ||
| 87 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); | 99 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); |
| 88 | extern int __must_check kobject_move(struct kobject *, struct kobject *); | 100 | extern int __must_check kobject_move(struct kobject *, struct kobject *); |
| 89 | 101 | ||
| 90 | extern int __must_check kobject_register(struct kobject *); | 102 | extern struct kobject *kobject_get(struct kobject *kobj); |
| 91 | extern void kobject_unregister(struct kobject *); | 103 | extern void kobject_put(struct kobject *kobj); |
| 92 | |||
| 93 | extern struct kobject * kobject_get(struct kobject *); | ||
| 94 | extern void kobject_put(struct kobject *); | ||
| 95 | |||
| 96 | extern struct kobject *kobject_kset_add_dir(struct kset *kset, | ||
| 97 | struct kobject *, const char *); | ||
| 98 | extern struct kobject *kobject_add_dir(struct kobject *, const char *); | ||
| 99 | 104 | ||
| 100 | extern char * kobject_get_path(struct kobject *, gfp_t); | 105 | extern char *kobject_get_path(struct kobject *kobj, gfp_t flag); |
| 101 | 106 | ||
| 102 | struct kobj_type { | 107 | struct kobj_type { |
| 103 | void (*release)(struct kobject *); | 108 | void (*release)(struct kobject *kobj); |
| 104 | struct sysfs_ops * sysfs_ops; | 109 | struct sysfs_ops *sysfs_ops; |
| 105 | struct attribute ** default_attrs; | 110 | struct attribute **default_attrs; |
| 106 | }; | 111 | }; |
| 107 | 112 | ||
| 108 | struct kobj_uevent_env { | 113 | struct kobj_uevent_env { |
| @@ -119,6 +124,16 @@ struct kset_uevent_ops { | |||
| 119 | struct kobj_uevent_env *env); | 124 | struct kobj_uevent_env *env); |
| 120 | }; | 125 | }; |
| 121 | 126 | ||
| 127 | struct kobj_attribute { | ||
| 128 | struct attribute attr; | ||
| 129 | ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr, | ||
| 130 | char *buf); | ||
| 131 | ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr, | ||
| 132 | const char *buf, size_t count); | ||
| 133 | }; | ||
| 134 | |||
| 135 | extern struct sysfs_ops kobj_sysfs_ops; | ||
| 136 | |||
| 122 | /** | 137 | /** |
| 123 | * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem. | 138 | * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem. |
| 124 | * | 139 | * |
| @@ -128,7 +143,6 @@ struct kset_uevent_ops { | |||
| 128 | * define the attribute callbacks and other common events that happen to | 143 | * define the attribute callbacks and other common events that happen to |
| 129 | * a kobject. | 144 | * a kobject. |
| 130 | * | 145 | * |
| 131 | * @ktype: the struct kobj_type for this specific kset | ||
| 132 | * @list: the list of all kobjects for this kset | 146 | * @list: the list of all kobjects for this kset |
| 133 | * @list_lock: a lock for iterating over the kobjects | 147 | * @list_lock: a lock for iterating over the kobjects |
| 134 | * @kobj: the embedded kobject for this kset (recursion, isn't it fun...) | 148 | * @kobj: the embedded kobject for this kset (recursion, isn't it fun...) |
| @@ -138,99 +152,49 @@ struct kset_uevent_ops { | |||
| 138 | * desired. | 152 | * desired. |
| 139 | */ | 153 | */ |
| 140 | struct kset { | 154 | struct kset { |
| 141 | struct kobj_type *ktype; | 155 | struct list_head list; |
| 142 | struct list_head list; | 156 | spinlock_t list_lock; |
| 143 | spinlock_t list_lock; | 157 | struct kobject kobj; |
| 144 | struct kobject kobj; | 158 | struct kset_uevent_ops *uevent_ops; |
| 145 | struct kset_uevent_ops *uevent_ops; | ||
| 146 | }; | 159 | }; |
| 147 | 160 | ||
| 161 | extern void kset_init(struct kset *kset); | ||
| 162 | extern int __must_check kset_register(struct kset *kset); | ||
| 163 | extern void kset_unregister(struct kset *kset); | ||
| 164 | extern struct kset * __must_check kset_create_and_add(const char *name, | ||
| 165 | struct kset_uevent_ops *u, | ||
| 166 | struct kobject *parent_kobj); | ||
| 148 | 167 | ||
| 149 | extern void kset_init(struct kset * k); | 168 | static inline struct kset *to_kset(struct kobject *kobj) |
| 150 | extern int __must_check kset_add(struct kset * k); | ||
| 151 | extern int __must_check kset_register(struct kset * k); | ||
| 152 | extern void kset_unregister(struct kset * k); | ||
| 153 | |||
| 154 | static inline struct kset * to_kset(struct kobject * kobj) | ||
| 155 | { | 169 | { |
| 156 | return kobj ? container_of(kobj,struct kset,kobj) : NULL; | 170 | return kobj ? container_of(kobj, struct kset, kobj) : NULL; |
| 157 | } | 171 | } |
| 158 | 172 | ||
| 159 | static inline struct kset * kset_get(struct kset * k) | 173 | static inline struct kset *kset_get(struct kset *k) |
| 160 | { | 174 | { |
| 161 | return k ? to_kset(kobject_get(&k->kobj)) : NULL; | 175 | return k ? to_kset(kobject_get(&k->kobj)) : NULL; |
| 162 | } | 176 | } |
| 163 | 177 | ||
| 164 | static inline void kset_put(struct kset * k) | 178 | static inline void kset_put(struct kset *k) |
| 165 | { | 179 | { |
| 166 | kobject_put(&k->kobj); | 180 | kobject_put(&k->kobj); |
| 167 | } | 181 | } |
| 168 | 182 | ||
| 169 | static inline struct kobj_type * get_ktype(struct kobject * k) | 183 | static inline struct kobj_type *get_ktype(struct kobject *kobj) |
| 170 | { | 184 | { |
| 171 | if (k->kset && k->kset->ktype) | 185 | return kobj->ktype; |
| 172 | return k->kset->ktype; | ||
| 173 | else | ||
| 174 | return k->ktype; | ||
| 175 | } | 186 | } |
| 176 | 187 | ||
| 177 | extern struct kobject * kset_find_obj(struct kset *, const char *); | 188 | extern struct kobject *kset_find_obj(struct kset *, const char *); |
| 178 | |||
| 179 | |||
| 180 | /* | ||
| 181 | * Use this when initializing an embedded kset with no other | ||
| 182 | * fields to initialize. | ||
| 183 | */ | ||
| 184 | #define set_kset_name(str) .kset = { .kobj = { .k_name = str } } | ||
| 185 | |||
| 186 | |||
| 187 | #define decl_subsys(_name,_type,_uevent_ops) \ | ||
| 188 | struct kset _name##_subsys = { \ | ||
| 189 | .kobj = { .k_name = __stringify(_name) }, \ | ||
| 190 | .ktype = _type, \ | ||
| 191 | .uevent_ops =_uevent_ops, \ | ||
| 192 | } | ||
| 193 | #define decl_subsys_name(_varname,_name,_type,_uevent_ops) \ | ||
| 194 | struct kset _varname##_subsys = { \ | ||
| 195 | .kobj = { .k_name = __stringify(_name) }, \ | ||
| 196 | .ktype = _type, \ | ||
| 197 | .uevent_ops =_uevent_ops, \ | ||
| 198 | } | ||
| 199 | |||
| 200 | /* The global /sys/kernel/ subsystem for people to chain off of */ | ||
| 201 | extern struct kset kernel_subsys; | ||
| 202 | /* The global /sys/hypervisor/ subsystem */ | ||
| 203 | extern struct kset hypervisor_subsys; | ||
| 204 | |||
| 205 | /* | ||
| 206 | * Helpers for setting the kset of registered objects. | ||
| 207 | * Often, a registered object belongs to a kset embedded in a | ||
| 208 | * subsystem. These do no magic, just make the resulting code | ||
| 209 | * easier to follow. | ||
| 210 | */ | ||
| 211 | |||
| 212 | /** | ||
| 213 | * kobj_set_kset_s(obj,subsys) - set kset for embedded kobject. | ||
| 214 | * @obj: ptr to some object type. | ||
| 215 | * @subsys: a subsystem object (not a ptr). | ||
| 216 | * | ||
| 217 | * Can be used for any object type with an embedded ->kobj. | ||
| 218 | */ | ||
| 219 | |||
| 220 | #define kobj_set_kset_s(obj,subsys) \ | ||
| 221 | (obj)->kobj.kset = &(subsys) | ||
| 222 | |||
| 223 | extern int __must_check subsystem_register(struct kset *); | ||
| 224 | extern void subsystem_unregister(struct kset *); | ||
| 225 | |||
| 226 | struct subsys_attribute { | ||
| 227 | struct attribute attr; | ||
| 228 | ssize_t (*show)(struct kset *, char *); | ||
| 229 | ssize_t (*store)(struct kset *, const char *, size_t); | ||
| 230 | }; | ||
| 231 | 189 | ||
| 232 | extern int __must_check subsys_create_file(struct kset *, | 190 | /* The global /sys/kernel/ kobject for people to chain off of */ |
| 233 | struct subsys_attribute *); | 191 | extern struct kobject *kernel_kobj; |
| 192 | /* The global /sys/hypervisor/ kobject for people to chain off of */ | ||
| 193 | extern struct kobject *hypervisor_kobj; | ||
| 194 | /* The global /sys/power/ kobject for people to chain off of */ | ||
| 195 | extern struct kobject *power_kobj; | ||
| 196 | /* The global /sys/firmware/ kobject for people to chain off of */ | ||
| 197 | extern struct kobject *firmware_kobj; | ||
| 234 | 198 | ||
| 235 | #if defined(CONFIG_HOTPLUG) | 199 | #if defined(CONFIG_HOTPLUG) |
| 236 | int kobject_uevent(struct kobject *kobj, enum kobject_action action); | 200 | int kobject_uevent(struct kobject *kobj, enum kobject_action action); |
| @@ -243,18 +207,20 @@ int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) | |||
| 243 | int kobject_action_type(const char *buf, size_t count, | 207 | int kobject_action_type(const char *buf, size_t count, |
| 244 | enum kobject_action *type); | 208 | enum kobject_action *type); |
| 245 | #else | 209 | #else |
| 246 | static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action) | 210 | static inline int kobject_uevent(struct kobject *kobj, |
| 211 | enum kobject_action action) | ||
| 247 | { return 0; } | 212 | { return 0; } |
| 248 | static inline int kobject_uevent_env(struct kobject *kobj, | 213 | static inline int kobject_uevent_env(struct kobject *kobj, |
| 249 | enum kobject_action action, | 214 | enum kobject_action action, |
| 250 | char *envp[]) | 215 | char *envp[]) |
| 251 | { return 0; } | 216 | { return 0; } |
| 252 | 217 | ||
| 253 | static inline int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) | 218 | static inline int add_uevent_var(struct kobj_uevent_env *env, |
| 219 | const char *format, ...) | ||
| 254 | { return 0; } | 220 | { return 0; } |
| 255 | 221 | ||
| 256 | static inline int kobject_action_type(const char *buf, size_t count, | 222 | static inline int kobject_action_type(const char *buf, size_t count, |
| 257 | enum kobject_action *type) | 223 | enum kobject_action *type) |
| 258 | { return -EINVAL; } | 224 | { return -EINVAL; } |
| 259 | #endif | 225 | #endif |
| 260 | 226 | ||
diff --git a/include/linux/kref.h b/include/linux/kref.h index 6fee3539893f..5d185635786e 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h | |||
| @@ -24,6 +24,7 @@ struct kref { | |||
| 24 | atomic_t refcount; | 24 | atomic_t refcount; |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | void kref_set(struct kref *kref, int num); | ||
| 27 | void kref_init(struct kref *kref); | 28 | void kref_init(struct kref *kref); |
| 28 | void kref_get(struct kref *kref); | 29 | void kref_get(struct kref *kref); |
| 29 | int kref_put(struct kref *kref, void (*release) (struct kref *kref)); | 30 | int kref_put(struct kref *kref, void (*release) (struct kref *kref)); |
diff --git a/include/linux/module.h b/include/linux/module.h index 2cbc0b87e329..c97bdb7eb957 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -574,7 +574,9 @@ struct device_driver; | |||
| 574 | #ifdef CONFIG_SYSFS | 574 | #ifdef CONFIG_SYSFS |
| 575 | struct module; | 575 | struct module; |
| 576 | 576 | ||
| 577 | extern struct kset module_subsys; | 577 | extern struct kset *module_kset; |
| 578 | extern struct kobj_type module_ktype; | ||
| 579 | extern int module_sysfs_initialized; | ||
| 578 | 580 | ||
| 579 | int mod_sysfs_init(struct module *mod); | 581 | int mod_sysfs_init(struct module *mod); |
| 580 | int mod_sysfs_setup(struct module *mod, | 582 | int mod_sysfs_setup(struct module *mod, |
| @@ -607,21 +609,6 @@ static inline void module_remove_modinfo_attrs(struct module *mod) | |||
| 607 | 609 | ||
| 608 | #endif /* CONFIG_SYSFS */ | 610 | #endif /* CONFIG_SYSFS */ |
| 609 | 611 | ||
| 610 | #if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES) | ||
| 611 | |||
| 612 | void module_add_driver(struct module *mod, struct device_driver *drv); | ||
| 613 | void module_remove_driver(struct device_driver *drv); | ||
| 614 | |||
| 615 | #else /* not both CONFIG_SYSFS && CONFIG_MODULES */ | ||
| 616 | |||
| 617 | static inline void module_add_driver(struct module *mod, struct device_driver *drv) | ||
| 618 | { } | ||
| 619 | |||
| 620 | static inline void module_remove_driver(struct device_driver *drv) | ||
| 621 | { } | ||
| 622 | |||
| 623 | #endif | ||
| 624 | |||
| 625 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) | 612 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) |
| 626 | 613 | ||
| 627 | /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */ | 614 | /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */ |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index ab4cb6ecd47c..8f67e8f2a3cc 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
| @@ -174,7 +174,7 @@ extern int pci_hp_register (struct hotplug_slot *slot); | |||
| 174 | extern int pci_hp_deregister (struct hotplug_slot *slot); | 174 | extern int pci_hp_deregister (struct hotplug_slot *slot); |
| 175 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, | 175 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, |
| 176 | struct hotplug_slot_info *info); | 176 | struct hotplug_slot_info *info); |
| 177 | extern struct kset pci_hotplug_slots_subsys; | 177 | extern struct kset *pci_hotplug_slots_kset; |
| 178 | 178 | ||
| 179 | /* PCI Setting Record (Type 0) */ | 179 | /* PCI Setting Record (Type 0) */ |
| 180 | struct hpp_type0 { | 180 | struct hpp_type0 { |
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h index 5ea4f05683f6..04b4d7330e6d 100644 --- a/include/linux/pktcdvd.h +++ b/include/linux/pktcdvd.h | |||
| @@ -290,7 +290,7 @@ struct pktcdvd_device | |||
| 290 | int write_congestion_off; | 290 | int write_congestion_off; |
| 291 | int write_congestion_on; | 291 | int write_congestion_on; |
| 292 | 292 | ||
| 293 | struct class_device *clsdev; /* sysfs pktcdvd[0-7] class dev */ | 293 | struct device *dev; /* sysfs pktcdvd[0-7] dev */ |
| 294 | struct pktcdvd_kobj *kobj_stat; /* sysfs pktcdvd[0-7]/stat/ */ | 294 | struct pktcdvd_kobj *kobj_stat; /* sysfs pktcdvd[0-7]/stat/ */ |
| 295 | struct pktcdvd_kobj *kobj_wqueue; /* sysfs pktcdvd[0-7]/write_queue/ */ | 295 | struct pktcdvd_kobj *kobj_wqueue; /* sysfs pktcdvd[0-7]/write_queue/ */ |
| 296 | 296 | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index e80804316cdb..3261681c82a4 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -35,7 +35,7 @@ extern struct resource *platform_get_resource_byname(struct platform_device *, u | |||
| 35 | extern int platform_get_irq_byname(struct platform_device *, char *); | 35 | extern int platform_get_irq_byname(struct platform_device *, char *); |
| 36 | extern int platform_add_devices(struct platform_device **, int); | 36 | extern int platform_add_devices(struct platform_device **, int); |
| 37 | 37 | ||
| 38 | extern struct platform_device *platform_device_register_simple(char *, int id, | 38 | extern struct platform_device *platform_device_register_simple(const char *, int id, |
| 39 | struct resource *, unsigned int); | 39 | struct resource *, unsigned int); |
| 40 | 40 | ||
| 41 | extern struct platform_device *platform_device_alloc(const char *name, int id); | 41 | extern struct platform_device *platform_device_alloc(const char *name, int id); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index cc14656f8682..d6eacda765ca 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -552,18 +552,13 @@ struct user_struct { | |||
| 552 | #ifdef CONFIG_FAIR_USER_SCHED | 552 | #ifdef CONFIG_FAIR_USER_SCHED |
| 553 | struct task_group *tg; | 553 | struct task_group *tg; |
| 554 | #ifdef CONFIG_SYSFS | 554 | #ifdef CONFIG_SYSFS |
| 555 | struct kset kset; | 555 | struct kobject kobj; |
| 556 | struct subsys_attribute user_attr; | ||
| 557 | struct work_struct work; | 556 | struct work_struct work; |
| 558 | #endif | 557 | #endif |
| 559 | #endif | 558 | #endif |
| 560 | }; | 559 | }; |
| 561 | 560 | ||
| 562 | #ifdef CONFIG_FAIR_USER_SCHED | 561 | extern int uids_sysfs_init(void); |
| 563 | extern int uids_kobject_init(void); | ||
| 564 | #else | ||
| 565 | static inline int uids_kobject_init(void) { return 0; } | ||
| 566 | #endif | ||
| 567 | 562 | ||
| 568 | extern struct user_struct *find_user(uid_t); | 563 | extern struct user_struct *find_user(uid_t); |
| 569 | 564 | ||
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index e285746588d6..f752e73bf977 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | struct sys_device; | 29 | struct sys_device; |
| 30 | 30 | ||
| 31 | struct sysdev_class { | 31 | struct sysdev_class { |
| 32 | const char *name; | ||
| 32 | struct list_head drivers; | 33 | struct list_head drivers; |
| 33 | 34 | ||
| 34 | /* Default operations for these types of devices */ | 35 | /* Default operations for these types of devices */ |
diff --git a/include/linux/tifm.h b/include/linux/tifm.h index 6b3a31805c72..2096b76d0cee 100644 --- a/include/linux/tifm.h +++ b/include/linux/tifm.h | |||
| @@ -120,7 +120,7 @@ struct tifm_adapter { | |||
| 120 | struct completion *finish_me; | 120 | struct completion *finish_me; |
| 121 | 121 | ||
| 122 | struct work_struct media_switcher; | 122 | struct work_struct media_switcher; |
| 123 | struct class_device cdev; | 123 | struct device dev; |
| 124 | 124 | ||
| 125 | void (*eject)(struct tifm_adapter *fm, | 125 | void (*eject)(struct tifm_adapter *fm, |
| 126 | struct tifm_dev *sock); | 126 | struct tifm_dev *sock); |
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h index 44c28e94df50..973386d439da 100644 --- a/include/linux/uio_driver.h +++ b/include/linux/uio_driver.h | |||
| @@ -18,20 +18,22 @@ | |||
| 18 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
| 19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 20 | 20 | ||
| 21 | struct uio_map; | ||
| 22 | |||
| 21 | /** | 23 | /** |
| 22 | * struct uio_mem - description of a UIO memory region | 24 | * struct uio_mem - description of a UIO memory region |
| 23 | * @kobj: kobject for this mapping | ||
| 24 | * @addr: address of the device's memory | 25 | * @addr: address of the device's memory |
| 25 | * @size: size of IO | 26 | * @size: size of IO |
| 26 | * @memtype: type of memory addr points to | 27 | * @memtype: type of memory addr points to |
| 27 | * @internal_addr: ioremap-ped version of addr, for driver internal use | 28 | * @internal_addr: ioremap-ped version of addr, for driver internal use |
| 29 | * @map: for use by the UIO core only. | ||
| 28 | */ | 30 | */ |
| 29 | struct uio_mem { | 31 | struct uio_mem { |
| 30 | struct kobject kobj; | ||
| 31 | unsigned long addr; | 32 | unsigned long addr; |
| 32 | unsigned long size; | 33 | unsigned long size; |
| 33 | int memtype; | 34 | int memtype; |
| 34 | void __iomem *internal_addr; | 35 | void __iomem *internal_addr; |
| 36 | struct uio_map *map; | ||
| 35 | }; | 37 | }; |
| 36 | 38 | ||
| 37 | #define MAX_UIO_MAPS 5 | 39 | #define MAX_UIO_MAPS 5 |
