diff options
| author | Olof Johansson <olof@lixom.net> | 2013-08-04 16:19:05 -0400 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2013-08-04 16:19:05 -0400 |
| commit | 6a33fc8cacfc7fac829c72bd321868be7e72f609 (patch) | |
| tree | ca8572f214a30c4743b731b4ab2809a980b78369 /include/linux | |
| parent | 3bd957978bb50390bb07678bc4c125989e9a81a2 (diff) | |
| parent | 2746a7c272a3242f919fa2fd5a5f2d9f8a41173a (diff) | |
Merge tag 'fixes-non-3.12' of git://git.infradead.org/linux-mvebu into next/fixes-non-critical
From Jason Cooper:
mvebu fixes-non-critical for v3.12
- dove
- fix section mismatch (all callers are already _init, so it's just a space
issue)
* tag 'fixes-non-3.12' of git://git.infradead.org/linux-mvebu:
ARM: dove: fix missing __init section of dove_mpp_gpio_mode
+ Linux 3.11-rc2
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/acpi.h | 1 | ||||
| -rw-r--r-- | include/linux/cpu.h | 2 | ||||
| -rw-r--r-- | include/linux/dcache.h | 2 | ||||
| -rw-r--r-- | include/linux/device.h | 37 | ||||
| -rw-r--r-- | include/linux/if_vlan.h | 3 | ||||
| -rw-r--r-- | include/linux/iio/iio.h | 4 | ||||
| -rw-r--r-- | include/linux/list.h | 11 | ||||
| -rw-r--r-- | include/linux/perf_event.h | 2 | ||||
| -rw-r--r-- | include/linux/pm_wakeup.h | 4 | ||||
| -rw-r--r-- | include/linux/sysfs.h | 64 |
10 files changed, 93 insertions, 37 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 353ba256f368..6ad72f92469c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -191,6 +191,7 @@ extern bool wmi_has_guid(const char *guid); | |||
| 191 | #define ACPI_VIDEO_BACKLIGHT_DMI_VIDEO 0x0200 | 191 | #define ACPI_VIDEO_BACKLIGHT_DMI_VIDEO 0x0200 |
| 192 | #define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VENDOR 0x0400 | 192 | #define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VENDOR 0x0400 |
| 193 | #define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO 0x0800 | 193 | #define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO 0x0800 |
| 194 | #define ACPI_VIDEO_SKIP_BACKLIGHT 0x1000 | ||
| 194 | 195 | ||
| 195 | #if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) | 196 | #if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) |
| 196 | 197 | ||
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 944f283f01c4..ab0eade73039 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -114,7 +114,7 @@ enum { | |||
| 114 | /* Need to know about CPUs going up/down? */ | 114 | /* Need to know about CPUs going up/down? */ |
| 115 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) | 115 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) |
| 116 | #define cpu_notifier(fn, pri) { \ | 116 | #define cpu_notifier(fn, pri) { \ |
| 117 | static struct notifier_block fn##_nb __cpuinitdata = \ | 117 | static struct notifier_block fn##_nb = \ |
| 118 | { .notifier_call = fn, .priority = pri }; \ | 118 | { .notifier_call = fn, .priority = pri }; \ |
| 119 | register_cpu_notifier(&fn##_nb); \ | 119 | register_cpu_notifier(&fn##_nb); \ |
| 120 | } | 120 | } |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 3092df3614ae..b90337c9d468 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -324,7 +324,7 @@ static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq) | |||
| 324 | return ret; | 324 | return ret; |
| 325 | } | 325 | } |
| 326 | 326 | ||
| 327 | static inline unsigned d_count(struct dentry *dentry) | 327 | static inline unsigned d_count(const struct dentry *dentry) |
| 328 | { | 328 | { |
| 329 | return dentry->d_count; | 329 | return dentry->d_count; |
| 330 | } | 330 | } |
diff --git a/include/linux/device.h b/include/linux/device.h index bcf8c0d4cd98..22b546a58591 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -47,7 +47,11 @@ struct bus_attribute { | |||
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | #define BUS_ATTR(_name, _mode, _show, _store) \ | 49 | #define BUS_ATTR(_name, _mode, _show, _store) \ |
| 50 | struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store) | 50 | struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store) |
| 51 | #define BUS_ATTR_RW(_name) \ | ||
| 52 | struct bus_attribute bus_attr_##_name = __ATTR_RW(_name) | ||
| 53 | #define BUS_ATTR_RO(_name) \ | ||
| 54 | struct bus_attribute bus_attr_##_name = __ATTR_RO(_name) | ||
| 51 | 55 | ||
| 52 | extern int __must_check bus_create_file(struct bus_type *, | 56 | extern int __must_check bus_create_file(struct bus_type *, |
| 53 | struct bus_attribute *); | 57 | struct bus_attribute *); |
| @@ -261,9 +265,12 @@ struct driver_attribute { | |||
| 261 | size_t count); | 265 | size_t count); |
| 262 | }; | 266 | }; |
| 263 | 267 | ||
| 264 | #define DRIVER_ATTR(_name, _mode, _show, _store) \ | 268 | #define DRIVER_ATTR(_name, _mode, _show, _store) \ |
| 265 | struct driver_attribute driver_attr_##_name = \ | 269 | struct driver_attribute driver_attr_##_name = __ATTR(_name, _mode, _show, _store) |
| 266 | __ATTR(_name, _mode, _show, _store) | 270 | #define DRIVER_ATTR_RW(_name) \ |
| 271 | struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) | ||
| 272 | #define DRIVER_ATTR_RO(_name) \ | ||
| 273 | struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) | ||
| 267 | 274 | ||
| 268 | extern int __must_check driver_create_file(struct device_driver *driver, | 275 | extern int __must_check driver_create_file(struct device_driver *driver, |
| 269 | const struct driver_attribute *attr); | 276 | const struct driver_attribute *attr); |
| @@ -313,6 +320,7 @@ int subsys_virtual_register(struct bus_type *subsys, | |||
| 313 | * @name: Name of the class. | 320 | * @name: Name of the class. |
| 314 | * @owner: The module owner. | 321 | * @owner: The module owner. |
| 315 | * @class_attrs: Default attributes of this class. | 322 | * @class_attrs: Default attributes of this class. |
| 323 | * @dev_groups: Default attributes of the devices that belong to the class. | ||
| 316 | * @dev_attrs: Default attributes of the devices belong to the class. | 324 | * @dev_attrs: Default attributes of the devices belong to the class. |
| 317 | * @dev_bin_attrs: Default binary attributes of the devices belong to the class. | 325 | * @dev_bin_attrs: Default binary attributes of the devices belong to the class. |
| 318 | * @dev_kobj: The kobject that represents this class and links it into the hierarchy. | 326 | * @dev_kobj: The kobject that represents this class and links it into the hierarchy. |
| @@ -342,7 +350,8 @@ struct class { | |||
| 342 | struct module *owner; | 350 | struct module *owner; |
| 343 | 351 | ||
| 344 | struct class_attribute *class_attrs; | 352 | struct class_attribute *class_attrs; |
| 345 | struct device_attribute *dev_attrs; | 353 | struct device_attribute *dev_attrs; /* use dev_groups instead */ |
| 354 | const struct attribute_group **dev_groups; | ||
| 346 | struct bin_attribute *dev_bin_attrs; | 355 | struct bin_attribute *dev_bin_attrs; |
| 347 | struct kobject *dev_kobj; | 356 | struct kobject *dev_kobj; |
| 348 | 357 | ||
| @@ -414,8 +423,12 @@ struct class_attribute { | |||
| 414 | const struct class_attribute *attr); | 423 | const struct class_attribute *attr); |
| 415 | }; | 424 | }; |
| 416 | 425 | ||
| 417 | #define CLASS_ATTR(_name, _mode, _show, _store) \ | 426 | #define CLASS_ATTR(_name, _mode, _show, _store) \ |
| 418 | struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store) | 427 | struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store) |
| 428 | #define CLASS_ATTR_RW(_name) \ | ||
| 429 | struct class_attribute class_attr_##_name = __ATTR_RW(_name) | ||
| 430 | #define CLASS_ATTR_RO(_name) \ | ||
| 431 | struct class_attribute class_attr_##_name = __ATTR_RO(_name) | ||
| 419 | 432 | ||
| 420 | extern int __must_check class_create_file(struct class *class, | 433 | extern int __must_check class_create_file(struct class *class, |
| 421 | const struct class_attribute *attr); | 434 | const struct class_attribute *attr); |
| @@ -423,7 +436,6 @@ extern void class_remove_file(struct class *class, | |||
| 423 | const struct class_attribute *attr); | 436 | const struct class_attribute *attr); |
| 424 | 437 | ||
| 425 | /* Simple class attribute that is just a static string */ | 438 | /* Simple class attribute that is just a static string */ |
| 426 | |||
| 427 | struct class_attribute_string { | 439 | struct class_attribute_string { |
| 428 | struct class_attribute attr; | 440 | struct class_attribute attr; |
| 429 | char *str; | 441 | char *str; |
| @@ -512,6 +524,10 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr, | |||
| 512 | 524 | ||
| 513 | #define DEVICE_ATTR(_name, _mode, _show, _store) \ | 525 | #define DEVICE_ATTR(_name, _mode, _show, _store) \ |
| 514 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) | 526 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) |
| 527 | #define DEVICE_ATTR_RW(_name) \ | ||
| 528 | struct device_attribute dev_attr_##_name = __ATTR_RW(_name) | ||
| 529 | #define DEVICE_ATTR_RO(_name) \ | ||
| 530 | struct device_attribute dev_attr_##_name = __ATTR_RO(_name) | ||
| 515 | #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ | 531 | #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ |
| 516 | struct dev_ext_attribute dev_attr_##_name = \ | 532 | struct dev_ext_attribute dev_attr_##_name = \ |
| 517 | { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } | 533 | { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } |
| @@ -924,6 +940,11 @@ extern __printf(5, 6) | |||
| 924 | struct device *device_create(struct class *cls, struct device *parent, | 940 | struct device *device_create(struct class *cls, struct device *parent, |
| 925 | dev_t devt, void *drvdata, | 941 | dev_t devt, void *drvdata, |
| 926 | const char *fmt, ...); | 942 | const char *fmt, ...); |
| 943 | extern __printf(6, 7) | ||
| 944 | struct device *device_create_with_groups(struct class *cls, | ||
| 945 | struct device *parent, dev_t devt, void *drvdata, | ||
| 946 | const struct attribute_group **groups, | ||
| 947 | const char *fmt, ...); | ||
| 927 | extern void device_destroy(struct class *cls, dev_t devt); | 948 | extern void device_destroy(struct class *cls, dev_t devt); |
| 928 | 949 | ||
| 929 | /* | 950 | /* |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index cdcbafa9b39a..715c343f7c00 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -79,9 +79,8 @@ static inline int is_vlan_dev(struct net_device *dev) | |||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) | 81 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
| 82 | #define vlan_tx_nonzero_tag_present(__skb) \ | ||
| 83 | (vlan_tx_tag_present(__skb) && ((__skb)->vlan_tci & VLAN_VID_MASK)) | ||
| 84 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 82 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
| 83 | #define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) | ||
| 85 | 84 | ||
| 86 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 85 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
| 87 | 86 | ||
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 8d171f427632..3d35b7023591 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
| @@ -211,8 +211,8 @@ struct iio_chan_spec { | |||
| 211 | static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, | 211 | static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, |
| 212 | enum iio_chan_info_enum type) | 212 | enum iio_chan_info_enum type) |
| 213 | { | 213 | { |
| 214 | return (chan->info_mask_separate & type) | | 214 | return (chan->info_mask_separate & BIT(type)) | |
| 215 | (chan->info_mask_shared_by_type & type); | 215 | (chan->info_mask_shared_by_type & BIT(type)); |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | #define IIO_ST(si, rb, sb, sh) \ | 218 | #define IIO_ST(si, rb, sb, sh) \ |
diff --git a/include/linux/list.h b/include/linux/list.h index b83e5657365a..f4d8a2f12a33 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -381,17 +381,6 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
| 381 | for (pos = (head)->next; pos != (head); pos = pos->next) | 381 | for (pos = (head)->next; pos != (head); pos = pos->next) |
| 382 | 382 | ||
| 383 | /** | 383 | /** |
| 384 | * __list_for_each - iterate over a list | ||
| 385 | * @pos: the &struct list_head to use as a loop cursor. | ||
| 386 | * @head: the head for your list. | ||
| 387 | * | ||
| 388 | * This variant doesn't differ from list_for_each() any more. | ||
| 389 | * We don't do prefetching in either case. | ||
| 390 | */ | ||
| 391 | #define __list_for_each(pos, head) \ | ||
| 392 | for (pos = (head)->next; pos != (head); pos = pos->next) | ||
| 393 | |||
| 394 | /** | ||
| 395 | * list_for_each_prev - iterate over a list backwards | 384 | * list_for_each_prev - iterate over a list backwards |
| 396 | * @pos: the &struct list_head to use as a loop cursor. | 385 | * @pos: the &struct list_head to use as a loop cursor. |
| 397 | * @head: the head for your list. | 386 | * @head: the head for your list. |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 8873f82c7baa..c43f6eabad5b 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -826,7 +826,7 @@ static inline void perf_restore_debug_store(void) { } | |||
| 826 | */ | 826 | */ |
| 827 | #define perf_cpu_notifier(fn) \ | 827 | #define perf_cpu_notifier(fn) \ |
| 828 | do { \ | 828 | do { \ |
| 829 | static struct notifier_block fn##_nb __cpuinitdata = \ | 829 | static struct notifier_block fn##_nb = \ |
| 830 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ | 830 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ |
| 831 | unsigned long cpu = smp_processor_id(); \ | 831 | unsigned long cpu = smp_processor_id(); \ |
| 832 | unsigned long flags; \ | 832 | unsigned long flags; \ |
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 569781faa504..a0f70808d7f4 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h | |||
| @@ -36,8 +36,8 @@ | |||
| 36 | * @last_time: Monotonic clock when the wakeup source's was touched last time. | 36 | * @last_time: Monotonic clock when the wakeup source's was touched last time. |
| 37 | * @prevent_sleep_time: Total time this source has been preventing autosleep. | 37 | * @prevent_sleep_time: Total time this source has been preventing autosleep. |
| 38 | * @event_count: Number of signaled wakeup events. | 38 | * @event_count: Number of signaled wakeup events. |
| 39 | * @active_count: Number of times the wakeup sorce was activated. | 39 | * @active_count: Number of times the wakeup source was activated. |
| 40 | * @relax_count: Number of times the wakeup sorce was deactivated. | 40 | * @relax_count: Number of times the wakeup source was deactivated. |
| 41 | * @expire_count: Number of times the wakeup source's timeout has expired. | 41 | * @expire_count: Number of times the wakeup source's timeout has expired. |
| 42 | * @wakeup_count: Number of times the wakeup source might abort suspend. | 42 | * @wakeup_count: Number of times the wakeup source might abort suspend. |
| 43 | * @active: Status of the wakeup source. | 43 | * @active: Status of the wakeup source. |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index e2cee22f578a..9e8a9b555ad6 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -17,10 +17,12 @@ | |||
| 17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
| 18 | #include <linux/lockdep.h> | 18 | #include <linux/lockdep.h> |
| 19 | #include <linux/kobject_ns.h> | 19 | #include <linux/kobject_ns.h> |
| 20 | #include <linux/stat.h> | ||
| 20 | #include <linux/atomic.h> | 21 | #include <linux/atomic.h> |
| 21 | 22 | ||
| 22 | struct kobject; | 23 | struct kobject; |
| 23 | struct module; | 24 | struct module; |
| 25 | struct bin_attribute; | ||
| 24 | enum kobj_ns_type; | 26 | enum kobj_ns_type; |
| 25 | 27 | ||
| 26 | struct attribute { | 28 | struct attribute { |
| @@ -59,26 +61,28 @@ struct attribute_group { | |||
| 59 | umode_t (*is_visible)(struct kobject *, | 61 | umode_t (*is_visible)(struct kobject *, |
| 60 | struct attribute *, int); | 62 | struct attribute *, int); |
| 61 | struct attribute **attrs; | 63 | struct attribute **attrs; |
| 64 | struct bin_attribute **bin_attrs; | ||
| 62 | }; | 65 | }; |
| 63 | 66 | ||
| 64 | |||
| 65 | |||
| 66 | /** | 67 | /** |
| 67 | * Use these macros to make defining attributes easier. See include/linux/device.h | 68 | * Use these macros to make defining attributes easier. See include/linux/device.h |
| 68 | * for examples.. | 69 | * for examples.. |
| 69 | */ | 70 | */ |
| 70 | 71 | ||
| 71 | #define __ATTR(_name,_mode,_show,_store) { \ | 72 | #define __ATTR(_name,_mode,_show,_store) { \ |
| 72 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | 73 | .attr = {.name = __stringify(_name), .mode = _mode }, \ |
| 73 | .show = _show, \ | 74 | .show = _show, \ |
| 74 | .store = _store, \ | 75 | .store = _store, \ |
| 75 | } | 76 | } |
| 76 | 77 | ||
| 77 | #define __ATTR_RO(_name) { \ | 78 | #define __ATTR_RO(_name) { \ |
| 78 | .attr = { .name = __stringify(_name), .mode = 0444 }, \ | 79 | .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ |
| 79 | .show = _name##_show, \ | 80 | .show = _name##_show, \ |
| 80 | } | 81 | } |
| 81 | 82 | ||
| 83 | #define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \ | ||
| 84 | _name##_show, _name##_store) | ||
| 85 | |||
| 82 | #define __ATTR_NULL { .attr = { .name = NULL } } | 86 | #define __ATTR_NULL { .attr = { .name = NULL } } |
| 83 | 87 | ||
| 84 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 88 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| @@ -92,6 +96,18 @@ struct attribute_group { | |||
| 92 | #define __ATTR_IGNORE_LOCKDEP __ATTR | 96 | #define __ATTR_IGNORE_LOCKDEP __ATTR |
| 93 | #endif | 97 | #endif |
| 94 | 98 | ||
| 99 | #define __ATTRIBUTE_GROUPS(_name) \ | ||
| 100 | static const struct attribute_group *_name##_groups[] = { \ | ||
| 101 | &_name##_group, \ | ||
| 102 | NULL, \ | ||
| 103 | } | ||
| 104 | |||
| 105 | #define ATTRIBUTE_GROUPS(_name) \ | ||
| 106 | static const struct attribute_group _name##_group = { \ | ||
| 107 | .attrs = _name##_attrs, \ | ||
| 108 | }; \ | ||
| 109 | __ATTRIBUTE_GROUPS(_name) | ||
| 110 | |||
| 95 | #define attr_name(_attr) (_attr).attr.name | 111 | #define attr_name(_attr) (_attr).attr.name |
| 96 | 112 | ||
| 97 | struct file; | 113 | struct file; |
| @@ -121,6 +137,36 @@ struct bin_attribute { | |||
| 121 | */ | 137 | */ |
| 122 | #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) | 138 | #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) |
| 123 | 139 | ||
| 140 | /* macros to create static binary attributes easier */ | ||
| 141 | #define __BIN_ATTR(_name, _mode, _read, _write, _size) { \ | ||
| 142 | .attr = { .name = __stringify(_name), .mode = _mode }, \ | ||
| 143 | .read = _read, \ | ||
| 144 | .write = _write, \ | ||
| 145 | .size = _size, \ | ||
| 146 | } | ||
| 147 | |||
| 148 | #define __BIN_ATTR_RO(_name, _size) { \ | ||
| 149 | .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ | ||
| 150 | .read = _name##_read, \ | ||
| 151 | .size = _size, \ | ||
| 152 | } | ||
| 153 | |||
| 154 | #define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name, \ | ||
| 155 | (S_IWUSR | S_IRUGO), _name##_read, \ | ||
| 156 | _name##_write) | ||
| 157 | |||
| 158 | #define __BIN_ATTR_NULL __ATTR_NULL | ||
| 159 | |||
| 160 | #define BIN_ATTR(_name, _mode, _read, _write, _size) \ | ||
| 161 | struct bin_attribute bin_attr_##_name = __BIN_ATTR(_name, _mode, _read, \ | ||
| 162 | _write, _size) | ||
| 163 | |||
| 164 | #define BIN_ATTR_RO(_name, _size) \ | ||
| 165 | struct bin_attribute bin_attr_##_name = __BIN_ATTR_RO(_name, _size) | ||
| 166 | |||
| 167 | #define BIN_ATTR_RW(_name, _size) \ | ||
| 168 | struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size) | ||
| 169 | |||
| 124 | struct sysfs_ops { | 170 | struct sysfs_ops { |
| 125 | ssize_t (*show)(struct kobject *, struct attribute *,char *); | 171 | ssize_t (*show)(struct kobject *, struct attribute *,char *); |
| 126 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 172 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
