diff options
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 9d6464ea99c6..c0a126125325 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/pm.h> | 25 | #include <linux/pm.h> |
| 26 | #include <linux/atomic.h> | 26 | #include <linux/atomic.h> |
| 27 | #include <linux/ratelimit.h> | 27 | #include <linux/ratelimit.h> |
| 28 | #include <linux/uidgid.h> | ||
| 28 | #include <asm/device.h> | 29 | #include <asm/device.h> |
| 29 | 30 | ||
| 30 | struct device; | 31 | struct device; |
| @@ -111,17 +112,11 @@ struct bus_type { | |||
| 111 | struct iommu_ops *iommu_ops; | 112 | struct iommu_ops *iommu_ops; |
| 112 | 113 | ||
| 113 | struct subsys_private *p; | 114 | struct subsys_private *p; |
| 115 | struct lock_class_key lock_key; | ||
| 114 | }; | 116 | }; |
| 115 | 117 | ||
| 116 | /* This is a #define to keep the compiler from merging different | 118 | extern int __must_check bus_register(struct bus_type *bus); |
| 117 | * instances of the __key variable */ | 119 | |
| 118 | #define bus_register(subsys) \ | ||
| 119 | ({ \ | ||
| 120 | static struct lock_class_key __key; \ | ||
| 121 | __bus_register(subsys, &__key); \ | ||
| 122 | }) | ||
| 123 | extern int __must_check __bus_register(struct bus_type *bus, | ||
| 124 | struct lock_class_key *key); | ||
| 125 | extern void bus_unregister(struct bus_type *bus); | 120 | extern void bus_unregister(struct bus_type *bus); |
| 126 | 121 | ||
| 127 | extern int __must_check bus_rescan_devices(struct bus_type *bus); | 122 | extern int __must_check bus_rescan_devices(struct bus_type *bus); |
| @@ -302,6 +297,8 @@ void subsys_interface_unregister(struct subsys_interface *sif); | |||
| 302 | 297 | ||
| 303 | int subsys_system_register(struct bus_type *subsys, | 298 | int subsys_system_register(struct bus_type *subsys, |
| 304 | const struct attribute_group **groups); | 299 | const struct attribute_group **groups); |
| 300 | int subsys_virtual_register(struct bus_type *subsys, | ||
| 301 | const struct attribute_group **groups); | ||
| 305 | 302 | ||
| 306 | /** | 303 | /** |
| 307 | * struct class - device classes | 304 | * struct class - device classes |
| @@ -471,7 +468,8 @@ struct device_type { | |||
| 471 | const char *name; | 468 | const char *name; |
| 472 | const struct attribute_group **groups; | 469 | const struct attribute_group **groups; |
| 473 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); | 470 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
| 474 | char *(*devnode)(struct device *dev, umode_t *mode); | 471 | char *(*devnode)(struct device *dev, umode_t *mode, |
| 472 | kuid_t *uid, kgid_t *gid); | ||
| 475 | void (*release)(struct device *dev); | 473 | void (*release)(struct device *dev); |
| 476 | 474 | ||
| 477 | const struct dev_pm_ops *pm; | 475 | const struct dev_pm_ops *pm; |
| @@ -578,6 +576,10 @@ void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); | |||
| 578 | void __iomem *devm_request_and_ioremap(struct device *dev, | 576 | void __iomem *devm_request_and_ioremap(struct device *dev, |
| 579 | struct resource *res); | 577 | struct resource *res); |
| 580 | 578 | ||
| 579 | /* allows to add/remove a custom action to devres stack */ | ||
| 580 | int devm_add_action(struct device *dev, void (*action)(void *), void *data); | ||
| 581 | void devm_remove_action(struct device *dev, void (*action)(void *), void *data); | ||
| 582 | |||
| 581 | struct device_dma_parameters { | 583 | struct device_dma_parameters { |
| 582 | /* | 584 | /* |
| 583 | * a low level driver may set these to teach IOMMU code about | 585 | * a low level driver may set these to teach IOMMU code about |
| @@ -849,7 +851,8 @@ extern int device_rename(struct device *dev, const char *new_name); | |||
| 849 | extern int device_move(struct device *dev, struct device *new_parent, | 851 | extern int device_move(struct device *dev, struct device *new_parent, |
| 850 | enum dpm_order dpm_order); | 852 | enum dpm_order dpm_order); |
| 851 | extern const char *device_get_devnode(struct device *dev, | 853 | extern const char *device_get_devnode(struct device *dev, |
| 852 | umode_t *mode, const char **tmp); | 854 | umode_t *mode, kuid_t *uid, kgid_t *gid, |
| 855 | const char **tmp); | ||
| 853 | extern void *dev_get_drvdata(const struct device *dev); | 856 | extern void *dev_get_drvdata(const struct device *dev); |
| 854 | extern int dev_set_drvdata(struct device *dev, void *data); | 857 | extern int dev_set_drvdata(struct device *dev, void *data); |
| 855 | 858 | ||
