diff options
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 47f343c7bdda..2918c0e8fdfd 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,7 +148,7 @@ 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); |
| 150 | extern int wait_for_device_probe(void); | 151 | extern void wait_for_device_probe(void); |
| 151 | 152 | ||
| 152 | 153 | ||
| 153 | /* sysfs interface for exporting driver attributes */ | 154 | /* sysfs interface for exporting driver attributes */ |
| @@ -367,15 +368,11 @@ struct device_dma_parameters { | |||
| 367 | }; | 368 | }; |
| 368 | 369 | ||
| 369 | struct device { | 370 | struct device { |
| 370 | struct klist klist_children; | ||
| 371 | struct klist_node knode_parent; /* node in sibling list */ | ||
| 372 | struct klist_node knode_driver; | ||
| 373 | struct klist_node knode_bus; | ||
| 374 | struct device *parent; | 371 | struct device *parent; |
| 375 | 372 | ||
| 373 | struct device_private *p; | ||
| 374 | |||
| 376 | struct kobject kobj; | 375 | struct kobject kobj; |
| 377 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | ||
| 378 | unsigned uevent_suppress:1; | ||
| 379 | const char *init_name; /* initial name of the device */ | 376 | const char *init_name; /* initial name of the device */ |
| 380 | struct device_type *type; | 377 | struct device_type *type; |
| 381 | 378 | ||
| @@ -387,8 +384,13 @@ struct device { | |||
| 387 | struct device_driver *driver; /* which driver has allocated this | 384 | struct device_driver *driver; /* which driver has allocated this |
| 388 | device */ | 385 | device */ |
| 389 | void *driver_data; /* data private to the driver */ | 386 | void *driver_data; /* data private to the driver */ |
| 390 | void *platform_data; /* Platform specific data, device | 387 | |
| 391 | 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. */ | ||
| 392 | struct dev_pm_info power; | 394 | struct dev_pm_info power; |
| 393 | 395 | ||
| 394 | #ifdef CONFIG_NUMA | 396 | #ifdef CONFIG_NUMA |
| @@ -427,8 +429,7 @@ struct device { | |||
| 427 | 429 | ||
| 428 | static inline const char *dev_name(const struct device *dev) | 430 | static inline const char *dev_name(const struct device *dev) |
| 429 | { | 431 | { |
| 430 | /* will be changed into kobject_name(&dev->kobj) in the near future */ | 432 | return kobject_name(&dev->kobj); |
| 431 | return dev->bus_id; | ||
| 432 | } | 433 | } |
| 433 | 434 | ||
| 434 | extern int dev_set_name(struct device *dev, const char *name, ...) | 435 | extern int dev_set_name(struct device *dev, const char *name, ...) |
| @@ -463,6 +464,16 @@ static inline void dev_set_drvdata(struct device *dev, void *data) | |||
| 463 | dev->driver_data = data; | 464 | dev->driver_data = data; |
| 464 | } | 465 | } |
| 465 | 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 | |||
| 466 | static inline int device_is_registered(struct device *dev) | 477 | static inline int device_is_registered(struct device *dev) |
| 467 | { | 478 | { |
| 468 | return dev->kobj.state_in_sysfs; | 479 | return dev->kobj.state_in_sysfs; |
| @@ -483,7 +494,8 @@ extern int device_for_each_child(struct device *dev, void *data, | |||
| 483 | extern struct device *device_find_child(struct device *dev, void *data, | 494 | extern struct device *device_find_child(struct device *dev, void *data, |
| 484 | int (*match)(struct device *dev, void *data)); | 495 | int (*match)(struct device *dev, void *data)); |
| 485 | extern int device_rename(struct device *dev, char *new_name); | 496 | extern int device_rename(struct device *dev, char *new_name); |
| 486 | 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); | ||
| 487 | 499 | ||
| 488 | /* | 500 | /* |
| 489 | * Root device objects for grouping under /sys/devices | 501 | * Root device objects for grouping under /sys/devices |
| @@ -570,7 +582,7 @@ extern const char *dev_driver_string(const struct device *dev); | |||
| 570 | #if defined(DEBUG) | 582 | #if defined(DEBUG) |
| 571 | #define dev_dbg(dev, format, arg...) \ | 583 | #define dev_dbg(dev, format, arg...) \ |
| 572 | dev_printk(KERN_DEBUG , dev , format , ## arg) | 584 | dev_printk(KERN_DEBUG , dev , format , ## arg) |
| 573 | #elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | 585 | #elif defined(CONFIG_DYNAMIC_DEBUG) |
| 574 | #define dev_dbg(dev, format, ...) do { \ | 586 | #define dev_dbg(dev, format, ...) do { \ |
| 575 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | 587 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ |
| 576 | } while (0) | 588 | } while (0) |
