diff options
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 45e5b1921fbb..6a69caaac18a 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #define BUS_ID_SIZE 20 | 28 | #define BUS_ID_SIZE 20 |
| 29 | 29 | ||
| 30 | struct device; | 30 | struct device; |
| 31 | struct device_private; | ||
| 31 | struct device_driver; | 32 | struct device_driver; |
| 32 | struct driver_private; | 33 | struct driver_private; |
| 33 | struct class; | 34 | struct class; |
| @@ -147,6 +148,8 @@ extern void put_driver(struct device_driver *drv); | |||
| 147 | extern struct device_driver *driver_find(const char *name, | 148 | extern struct device_driver *driver_find(const char *name, |
| 148 | struct bus_type *bus); | 149 | struct bus_type *bus); |
| 149 | extern int driver_probe_done(void); | 150 | extern int driver_probe_done(void); |
| 151 | extern void wait_for_device_probe(void); | ||
| 152 | |||
| 150 | 153 | ||
| 151 | /* sysfs interface for exporting driver attributes */ | 154 | /* sysfs interface for exporting driver attributes */ |
| 152 | 155 | ||
| @@ -365,15 +368,11 @@ struct device_dma_parameters { | |||
| 365 | }; | 368 | }; |
| 366 | 369 | ||
| 367 | struct device { | 370 | struct device { |
| 368 | struct klist klist_children; | ||
| 369 | struct klist_node knode_parent; /* node in sibling list */ | ||
| 370 | struct klist_node knode_driver; | ||
| 371 | struct klist_node knode_bus; | ||
| 372 | struct device *parent; | 371 | struct device *parent; |
| 373 | 372 | ||
| 373 | struct device_private *p; | ||
| 374 | |||
| 374 | struct kobject kobj; | 375 | struct kobject kobj; |
| 375 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | ||
| 376 | unsigned uevent_suppress:1; | ||
| 377 | const char *init_name; /* initial name of the device */ | 376 | const char *init_name; /* initial name of the device */ |
| 378 | struct device_type *type; | 377 | struct device_type *type; |
| 379 | 378 | ||
| @@ -385,8 +384,13 @@ struct device { | |||
| 385 | struct device_driver *driver; /* which driver has allocated this | 384 | struct device_driver *driver; /* which driver has allocated this |
| 386 | device */ | 385 | device */ |
| 387 | void *driver_data; /* data private to the driver */ | 386 | void *driver_data; /* data private to the driver */ |
| 388 | void *platform_data; /* Platform specific data, device | 387 | |
| 389 | core doesn't touch it */ | 388 | void *platform_data; /* We will remove platform_data |
| 389 | field if all platform devices | ||
| 390 | pass its platform specific data | ||
| 391 | from platform_device->platform_data, | ||
| 392 | other kind of devices should not | ||
| 393 | use platform_data. */ | ||
| 390 | struct dev_pm_info power; | 394 | struct dev_pm_info power; |
| 391 | 395 | ||
| 392 | #ifdef CONFIG_NUMA | 396 | #ifdef CONFIG_NUMA |
| @@ -425,8 +429,7 @@ struct device { | |||
| 425 | 429 | ||
| 426 | static inline const char *dev_name(const struct device *dev) | 430 | static inline const char *dev_name(const struct device *dev) |
| 427 | { | 431 | { |
| 428 | /* will be changed into kobject_name(&dev->kobj) in the near future */ | 432 | return kobject_name(&dev->kobj); |
| 429 | return dev->bus_id; | ||
| 430 | } | 433 | } |
| 431 | 434 | ||
| 432 | extern int dev_set_name(struct device *dev, const char *name, ...) | 435 | extern int dev_set_name(struct device *dev, const char *name, ...) |
| @@ -461,6 +464,16 @@ static inline void dev_set_drvdata(struct device *dev, void *data) | |||
| 461 | dev->driver_data = data; | 464 | dev->driver_data = data; |
| 462 | } | 465 | } |
| 463 | 466 | ||
| 467 | static inline unsigned int dev_get_uevent_suppress(const struct device *dev) | ||
| 468 | { | ||
| 469 | return dev->kobj.uevent_suppress; | ||
| 470 | } | ||
| 471 | |||
| 472 | static inline void dev_set_uevent_suppress(struct device *dev, int val) | ||
| 473 | { | ||
| 474 | dev->kobj.uevent_suppress = val; | ||
| 475 | } | ||
| 476 | |||
| 464 | static inline int device_is_registered(struct device *dev) | 477 | static inline int device_is_registered(struct device *dev) |
| 465 | { | 478 | { |
| 466 | return dev->kobj.state_in_sysfs; | 479 | return dev->kobj.state_in_sysfs; |
| @@ -481,7 +494,8 @@ extern int device_for_each_child(struct device *dev, void *data, | |||
| 481 | extern struct device *device_find_child(struct device *dev, void *data, | 494 | extern struct device *device_find_child(struct device *dev, void *data, |
| 482 | int (*match)(struct device *dev, void *data)); | 495 | int (*match)(struct device *dev, void *data)); |
| 483 | extern int device_rename(struct device *dev, char *new_name); | 496 | extern int device_rename(struct device *dev, char *new_name); |
| 484 | extern int device_move(struct device *dev, struct device *new_parent); | 497 | extern int device_move(struct device *dev, struct device *new_parent, |
| 498 | enum dpm_order dpm_order); | ||
| 485 | 499 | ||
| 486 | /* | 500 | /* |
| 487 | * Root device objects for grouping under /sys/devices | 501 | * Root device objects for grouping under /sys/devices |
| @@ -537,6 +551,7 @@ extern int (*platform_notify_remove)(struct device *dev); | |||
| 537 | extern struct device *get_device(struct device *dev); | 551 | extern struct device *get_device(struct device *dev); |
| 538 | extern void put_device(struct device *dev); | 552 | extern void put_device(struct device *dev); |
| 539 | 553 | ||
| 554 | extern void wait_for_device_probe(void); | ||
| 540 | 555 | ||
| 541 | /* drivers/base/power/shutdown.c */ | 556 | /* drivers/base/power/shutdown.c */ |
| 542 | extern void device_shutdown(void); | 557 | extern void device_shutdown(void); |
| @@ -568,7 +583,7 @@ extern const char *dev_driver_string(const struct device *dev); | |||
| 568 | #if defined(DEBUG) | 583 | #if defined(DEBUG) |
| 569 | #define dev_dbg(dev, format, arg...) \ | 584 | #define dev_dbg(dev, format, arg...) \ |
| 570 | dev_printk(KERN_DEBUG , dev , format , ## arg) | 585 | dev_printk(KERN_DEBUG , dev , format , ## arg) |
| 571 | #elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | 586 | #elif defined(CONFIG_DYNAMIC_DEBUG) |
| 572 | #define dev_dbg(dev, format, ...) do { \ | 587 | #define dev_dbg(dev, format, ...) do { \ |
| 573 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | 588 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ |
| 574 | } while (0) | 589 | } while (0) |
