aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h39
1 files changed, 26 insertions, 13 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 47f343c7bdda..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
30struct device; 30struct device;
31struct device_private;
31struct device_driver; 32struct device_driver;
32struct driver_private; 33struct driver_private;
33struct class; 34struct class;
@@ -147,7 +148,7 @@ extern void put_driver(struct device_driver *drv);
147extern struct device_driver *driver_find(const char *name, 148extern struct device_driver *driver_find(const char *name,
148 struct bus_type *bus); 149 struct bus_type *bus);
149extern int driver_probe_done(void); 150extern int driver_probe_done(void);
150extern int wait_for_device_probe(void); 151extern 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
369struct device { 370struct 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
428static inline const char *dev_name(const struct device *dev) 430static 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
434extern int dev_set_name(struct device *dev, const char *name, ...) 435extern 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
467static inline unsigned int dev_get_uevent_suppress(const struct device *dev)
468{
469 return dev->kobj.uevent_suppress;
470}
471
472static inline void dev_set_uevent_suppress(struct device *dev, int val)
473{
474 dev->kobj.uevent_suppress = val;
475}
476
466static inline int device_is_registered(struct device *dev) 477static 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,
483extern struct device *device_find_child(struct device *dev, void *data, 494extern 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));
485extern int device_rename(struct device *dev, char *new_name); 496extern int device_rename(struct device *dev, char *new_name);
486extern int device_move(struct device *dev, struct device *new_parent); 497extern 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
@@ -539,6 +551,7 @@ extern int (*platform_notify_remove)(struct device *dev);
539extern struct device *get_device(struct device *dev); 551extern struct device *get_device(struct device *dev);
540extern void put_device(struct device *dev); 552extern void put_device(struct device *dev);
541 553
554extern void wait_for_device_probe(void);
542 555
543/* drivers/base/power/shutdown.c */ 556/* drivers/base/power/shutdown.c */
544extern void device_shutdown(void); 557extern void device_shutdown(void);
@@ -570,7 +583,7 @@ extern const char *dev_driver_string(const struct device *dev);
570#if defined(DEBUG) 583#if defined(DEBUG)
571#define dev_dbg(dev, format, arg...) \ 584#define dev_dbg(dev, format, arg...) \
572 dev_printk(KERN_DEBUG , dev , format , ## arg) 585 dev_printk(KERN_DEBUG , dev , format , ## arg)
573#elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG) 586#elif defined(CONFIG_DYNAMIC_DEBUG)
574#define dev_dbg(dev, format, ...) do { \ 587#define dev_dbg(dev, format, ...) do { \
575 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ 588 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
576 } while (0) 589 } while (0)