diff options
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index b2e5da2b637..1e5f30da98b 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -60,11 +60,6 @@ extern void bus_unregister(struct bus_type * bus); | |||
60 | 60 | ||
61 | extern void bus_rescan_devices(struct bus_type * bus); | 61 | extern void bus_rescan_devices(struct bus_type * bus); |
62 | 62 | ||
63 | extern struct bus_type * get_bus(struct bus_type * bus); | ||
64 | extern void put_bus(struct bus_type * bus); | ||
65 | |||
66 | extern struct bus_type * find_bus(char * name); | ||
67 | |||
68 | /* iterator helpers for buses */ | 63 | /* iterator helpers for buses */ |
69 | 64 | ||
70 | int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, | 65 | int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, |
@@ -147,6 +142,7 @@ struct class { | |||
147 | 142 | ||
148 | struct subsystem subsys; | 143 | struct subsystem subsys; |
149 | struct list_head children; | 144 | struct list_head children; |
145 | struct list_head devices; | ||
150 | struct list_head interfaces; | 146 | struct list_head interfaces; |
151 | struct semaphore sem; /* locks both the children and interfaces lists */ | 147 | struct semaphore sem; /* locks both the children and interfaces lists */ |
152 | 148 | ||
@@ -163,9 +159,6 @@ struct class { | |||
163 | extern int class_register(struct class *); | 159 | extern int class_register(struct class *); |
164 | extern void class_unregister(struct class *); | 160 | extern void class_unregister(struct class *); |
165 | 161 | ||
166 | extern struct class * class_get(struct class *); | ||
167 | extern void class_put(struct class *); | ||
168 | |||
169 | 162 | ||
170 | struct class_attribute { | 163 | struct class_attribute { |
171 | struct attribute attr; | 164 | struct attribute attr; |
@@ -313,6 +306,7 @@ struct device { | |||
313 | struct kobject kobj; | 306 | struct kobject kobj; |
314 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 307 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
315 | struct device_attribute uevent_attr; | 308 | struct device_attribute uevent_attr; |
309 | struct device_attribute *devt_attr; | ||
316 | 310 | ||
317 | struct semaphore sem; /* semaphore to synchronize calls to | 311 | struct semaphore sem; /* semaphore to synchronize calls to |
318 | * its driver. | 312 | * its driver. |
@@ -340,6 +334,11 @@ struct device { | |||
340 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem | 334 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem |
341 | override */ | 335 | override */ |
342 | 336 | ||
337 | /* class_device migration path */ | ||
338 | struct list_head node; | ||
339 | struct class *class; /* optional*/ | ||
340 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | ||
341 | |||
343 | void (*release)(struct device * dev); | 342 | void (*release)(struct device * dev); |
344 | }; | 343 | }; |
345 | 344 | ||
@@ -381,6 +380,13 @@ extern int device_attach(struct device * dev); | |||
381 | extern void driver_attach(struct device_driver * drv); | 380 | extern void driver_attach(struct device_driver * drv); |
382 | extern void device_reprobe(struct device *dev); | 381 | extern void device_reprobe(struct device *dev); |
383 | 382 | ||
383 | /* | ||
384 | * Easy functions for dynamically creating devices on the fly | ||
385 | */ | ||
386 | extern struct device *device_create(struct class *cls, struct device *parent, | ||
387 | dev_t devt, char *fmt, ...) | ||
388 | __attribute__((format(printf,4,5))); | ||
389 | extern void device_destroy(struct class *cls, dev_t devt); | ||
384 | 390 | ||
385 | /* | 391 | /* |
386 | * Platform "fixup" functions - allow the platform to have their say | 392 | * Platform "fixup" functions - allow the platform to have their say |
@@ -410,8 +416,9 @@ extern int firmware_register(struct subsystem *); | |||
410 | extern void firmware_unregister(struct subsystem *); | 416 | extern void firmware_unregister(struct subsystem *); |
411 | 417 | ||
412 | /* debugging and troubleshooting/diagnostic helpers. */ | 418 | /* debugging and troubleshooting/diagnostic helpers. */ |
419 | extern const char *dev_driver_string(struct device *dev); | ||
413 | #define dev_printk(level, dev, format, arg...) \ | 420 | #define dev_printk(level, dev, format, arg...) \ |
414 | printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg) | 421 | printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg) |
415 | 422 | ||
416 | #ifdef DEBUG | 423 | #ifdef DEBUG |
417 | #define dev_dbg(dev, format, arg...) \ | 424 | #define dev_dbg(dev, format, arg...) \ |