diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-03 14:37:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-03 14:37:15 -0400 |
commit | 542a086ac72fb193cbc1b996963a572269e57743 (patch) | |
tree | b137c08037cca4ffc8a156a891a01113b3b8edce /kernel | |
parent | 1d1fdd95df681f0c065d90ffaafa215a0e8825e2 (diff) | |
parent | 1eeeef153c02f5856ec109fa532eb5f31c39f85c (diff) |
Merge tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core patches from Greg KH:
"Here's the big driver core pull request for 3.12-rc1.
Lots of tiny changes here fixing up the way sysfs attributes are
created, to try to make drivers simpler, and fix a whole class race
conditions with creations of device attributes after the device was
announced to userspace.
All the various pieces are acked by the different subsystem
maintainers"
* tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (119 commits)
firmware loader: fix pending_fw_head list corruption
drivers/base/memory.c: introduce help macro to_memory_block
dynamic debug: line queries failing due to uninitialized local variable
sysfs: sysfs_create_groups returns a value.
debugfs: provide debugfs_create_x64() when disabled
rbd: convert bus code to use bus_groups
firmware: dcdbas: use binary attribute groups
sysfs: add sysfs_create/remove_groups for when SYSFS is not enabled
driver core: add #include <linux/sysfs.h> to core files.
HID: convert bus code to use dev_groups
Input: serio: convert bus code to use drv_groups
Input: gameport: convert bus code to use drv_groups
driver core: firmware: use __ATTR_RW()
driver core: core: use DEVICE_ATTR_RO
driver core: bus: use DRIVER_ATTR_WO()
driver core: create write-only attribute macros for devices and drivers
sysfs: create __ATTR_WO()
driver-core: platform: convert bus code to use dev_groups
workqueue: convert bus code to use dev_groups
MEI: convert bus code to use dev_groups
...
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/workqueue.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index e93f7b9067d8..5f8ee91abdff 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -3095,25 +3095,26 @@ static struct workqueue_struct *dev_to_wq(struct device *dev) | |||
3095 | return wq_dev->wq; | 3095 | return wq_dev->wq; |
3096 | } | 3096 | } |
3097 | 3097 | ||
3098 | static ssize_t wq_per_cpu_show(struct device *dev, | 3098 | static ssize_t per_cpu_show(struct device *dev, struct device_attribute *attr, |
3099 | struct device_attribute *attr, char *buf) | 3099 | char *buf) |
3100 | { | 3100 | { |
3101 | struct workqueue_struct *wq = dev_to_wq(dev); | 3101 | struct workqueue_struct *wq = dev_to_wq(dev); |
3102 | 3102 | ||
3103 | return scnprintf(buf, PAGE_SIZE, "%d\n", (bool)!(wq->flags & WQ_UNBOUND)); | 3103 | return scnprintf(buf, PAGE_SIZE, "%d\n", (bool)!(wq->flags & WQ_UNBOUND)); |
3104 | } | 3104 | } |
3105 | static DEVICE_ATTR_RO(per_cpu); | ||
3105 | 3106 | ||
3106 | static ssize_t wq_max_active_show(struct device *dev, | 3107 | static ssize_t max_active_show(struct device *dev, |
3107 | struct device_attribute *attr, char *buf) | 3108 | struct device_attribute *attr, char *buf) |
3108 | { | 3109 | { |
3109 | struct workqueue_struct *wq = dev_to_wq(dev); | 3110 | struct workqueue_struct *wq = dev_to_wq(dev); |
3110 | 3111 | ||
3111 | return scnprintf(buf, PAGE_SIZE, "%d\n", wq->saved_max_active); | 3112 | return scnprintf(buf, PAGE_SIZE, "%d\n", wq->saved_max_active); |
3112 | } | 3113 | } |
3113 | 3114 | ||
3114 | static ssize_t wq_max_active_store(struct device *dev, | 3115 | static ssize_t max_active_store(struct device *dev, |
3115 | struct device_attribute *attr, | 3116 | struct device_attribute *attr, const char *buf, |
3116 | const char *buf, size_t count) | 3117 | size_t count) |
3117 | { | 3118 | { |
3118 | struct workqueue_struct *wq = dev_to_wq(dev); | 3119 | struct workqueue_struct *wq = dev_to_wq(dev); |
3119 | int val; | 3120 | int val; |
@@ -3124,12 +3125,14 @@ static ssize_t wq_max_active_store(struct device *dev, | |||
3124 | workqueue_set_max_active(wq, val); | 3125 | workqueue_set_max_active(wq, val); |
3125 | return count; | 3126 | return count; |
3126 | } | 3127 | } |
3128 | static DEVICE_ATTR_RW(max_active); | ||
3127 | 3129 | ||
3128 | static struct device_attribute wq_sysfs_attrs[] = { | 3130 | static struct attribute *wq_sysfs_attrs[] = { |
3129 | __ATTR(per_cpu, 0444, wq_per_cpu_show, NULL), | 3131 | &dev_attr_per_cpu.attr, |
3130 | __ATTR(max_active, 0644, wq_max_active_show, wq_max_active_store), | 3132 | &dev_attr_max_active.attr, |
3131 | __ATTR_NULL, | 3133 | NULL, |
3132 | }; | 3134 | }; |
3135 | ATTRIBUTE_GROUPS(wq_sysfs); | ||
3133 | 3136 | ||
3134 | static ssize_t wq_pool_ids_show(struct device *dev, | 3137 | static ssize_t wq_pool_ids_show(struct device *dev, |
3135 | struct device_attribute *attr, char *buf) | 3138 | struct device_attribute *attr, char *buf) |
@@ -3279,7 +3282,7 @@ static struct device_attribute wq_sysfs_unbound_attrs[] = { | |||
3279 | 3282 | ||
3280 | static struct bus_type wq_subsys = { | 3283 | static struct bus_type wq_subsys = { |
3281 | .name = "workqueue", | 3284 | .name = "workqueue", |
3282 | .dev_attrs = wq_sysfs_attrs, | 3285 | .dev_groups = wq_sysfs_groups, |
3283 | }; | 3286 | }; |
3284 | 3287 | ||
3285 | static int __init wq_sysfs_init(void) | 3288 | static int __init wq_sysfs_init(void) |