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 /drivers/usb/serial | |
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 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/bus.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index 0ce51f21ed2a..6335490d5760 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c | |||
@@ -121,7 +121,7 @@ static int usb_serial_device_remove(struct device *dev) | |||
121 | return retval; | 121 | return retval; |
122 | } | 122 | } |
123 | 123 | ||
124 | static ssize_t store_new_id(struct device_driver *driver, | 124 | static ssize_t new_id_store(struct device_driver *driver, |
125 | const char *buf, size_t count) | 125 | const char *buf, size_t count) |
126 | { | 126 | { |
127 | struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); | 127 | struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); |
@@ -134,17 +134,19 @@ static ssize_t store_new_id(struct device_driver *driver, | |||
134 | return retval; | 134 | return retval; |
135 | } | 135 | } |
136 | 136 | ||
137 | static ssize_t show_dynids(struct device_driver *driver, char *buf) | 137 | static ssize_t new_id_show(struct device_driver *driver, char *buf) |
138 | { | 138 | { |
139 | struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); | 139 | struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); |
140 | 140 | ||
141 | return usb_show_dynids(&usb_drv->dynids, buf); | 141 | return usb_show_dynids(&usb_drv->dynids, buf); |
142 | } | 142 | } |
143 | static DRIVER_ATTR_RW(new_id); | ||
143 | 144 | ||
144 | static struct driver_attribute drv_attrs[] = { | 145 | static struct attribute *usb_serial_drv_attrs[] = { |
145 | __ATTR(new_id, S_IRUGO | S_IWUSR, show_dynids, store_new_id), | 146 | &driver_attr_new_id.attr, |
146 | __ATTR_NULL, | 147 | NULL, |
147 | }; | 148 | }; |
149 | ATTRIBUTE_GROUPS(usb_serial_drv); | ||
148 | 150 | ||
149 | static void free_dynids(struct usb_serial_driver *drv) | 151 | static void free_dynids(struct usb_serial_driver *drv) |
150 | { | 152 | { |
@@ -163,7 +165,7 @@ struct bus_type usb_serial_bus_type = { | |||
163 | .match = usb_serial_device_match, | 165 | .match = usb_serial_device_match, |
164 | .probe = usb_serial_device_probe, | 166 | .probe = usb_serial_device_probe, |
165 | .remove = usb_serial_device_remove, | 167 | .remove = usb_serial_device_remove, |
166 | .drv_attrs = drv_attrs, | 168 | .drv_groups = usb_serial_drv_groups, |
167 | }; | 169 | }; |
168 | 170 | ||
169 | int usb_serial_bus_register(struct usb_serial_driver *driver) | 171 | int usb_serial_bus_register(struct usb_serial_driver *driver) |