diff options
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 7d960d581e9c..389becc88be6 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -66,6 +66,9 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |||
66 | * @bus_attrs: Default attributes of the bus. | 66 | * @bus_attrs: Default attributes of the bus. |
67 | * @dev_attrs: Default attributes of the devices on the bus. | 67 | * @dev_attrs: Default attributes of the devices on the bus. |
68 | * @drv_attrs: Default attributes of the device drivers on the bus. | 68 | * @drv_attrs: Default attributes of the device drivers on the bus. |
69 | * @bus_groups: Default attributes of the bus. | ||
70 | * @dev_groups: Default attributes of the devices on the bus. | ||
71 | * @drv_groups: Default attributes of the device drivers on the bus. | ||
69 | * @match: Called, perhaps multiple times, whenever a new device or driver | 72 | * @match: Called, perhaps multiple times, whenever a new device or driver |
70 | * is added for this bus. It should return a nonzero value if the | 73 | * is added for this bus. It should return a nonzero value if the |
71 | * given device can be handled by the given driver. | 74 | * given device can be handled by the given driver. |
@@ -103,9 +106,12 @@ struct bus_type { | |||
103 | const char *name; | 106 | const char *name; |
104 | const char *dev_name; | 107 | const char *dev_name; |
105 | struct device *dev_root; | 108 | struct device *dev_root; |
106 | struct bus_attribute *bus_attrs; | 109 | struct bus_attribute *bus_attrs; /* use bus_groups instead */ |
107 | struct device_attribute *dev_attrs; | 110 | struct device_attribute *dev_attrs; /* use dev_groups instead */ |
108 | struct driver_attribute *drv_attrs; | 111 | struct driver_attribute *drv_attrs; /* use drv_groups instead */ |
112 | const struct attribute_group **bus_groups; | ||
113 | const struct attribute_group **dev_groups; | ||
114 | const struct attribute_group **drv_groups; | ||
109 | 115 | ||
110 | int (*match)(struct device *dev, struct device_driver *drv); | 116 | int (*match)(struct device *dev, struct device_driver *drv); |
111 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); | 117 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
@@ -271,6 +277,8 @@ struct driver_attribute { | |||
271 | struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) | 277 | struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) |
272 | #define DRIVER_ATTR_RO(_name) \ | 278 | #define DRIVER_ATTR_RO(_name) \ |
273 | struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) | 279 | struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) |
280 | #define DRIVER_ATTR_WO(_name) \ | ||
281 | struct driver_attribute driver_attr_##_name = __ATTR_WO(_name) | ||
274 | 282 | ||
275 | extern int __must_check driver_create_file(struct device_driver *driver, | 283 | extern int __must_check driver_create_file(struct device_driver *driver, |
276 | const struct driver_attribute *attr); | 284 | const struct driver_attribute *attr); |
@@ -528,6 +536,8 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr, | |||
528 | struct device_attribute dev_attr_##_name = __ATTR_RW(_name) | 536 | struct device_attribute dev_attr_##_name = __ATTR_RW(_name) |
529 | #define DEVICE_ATTR_RO(_name) \ | 537 | #define DEVICE_ATTR_RO(_name) \ |
530 | struct device_attribute dev_attr_##_name = __ATTR_RO(_name) | 538 | struct device_attribute dev_attr_##_name = __ATTR_RO(_name) |
539 | #define DEVICE_ATTR_WO(_name) \ | ||
540 | struct device_attribute dev_attr_##_name = __ATTR_WO(_name) | ||
531 | #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ | 541 | #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ |
532 | struct dev_ext_attribute dev_attr_##_name = \ | 542 | struct dev_ext_attribute dev_attr_##_name = \ |
533 | { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } | 543 | { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } |