diff options
author | Bjørn Mork <bjorn@mork.no> | 2012-05-13 06:35:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-14 12:30:40 -0400 |
commit | ef206f3f01d8cc0d363cfce7dc9ca11db429faa3 (patch) | |
tree | f5767b00bf7c34ea96a1450e27b2a8dda68760d9 /drivers/usb/serial/bus.c | |
parent | e6bbcef0211ed75db1ca3017551a584aed4e00be (diff) |
USB: add read support to usb-serial/../new_id
Keep the usb-serial support for dynamic IDs in sync with the usb
support. This enables readout of dynamic device IDs for
usb-serial drivers. Common code is exported from the usb core
system and reused by the usb-serial bus driver.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/bus.c')
-rw-r--r-- | drivers/usb/serial/bus.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index ed8adb052ca7..f398d1e34474 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c | |||
@@ -124,8 +124,15 @@ static ssize_t store_new_id(struct device_driver *driver, | |||
124 | return retval; | 124 | return retval; |
125 | } | 125 | } |
126 | 126 | ||
127 | static ssize_t show_dynids(struct device_driver *driver, char *buf) | ||
128 | { | ||
129 | struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); | ||
130 | |||
131 | return usb_show_dynids(&usb_drv->dynids, buf); | ||
132 | } | ||
133 | |||
127 | static struct driver_attribute drv_attrs[] = { | 134 | static struct driver_attribute drv_attrs[] = { |
128 | __ATTR(new_id, S_IWUSR, NULL, store_new_id), | 135 | __ATTR(new_id, S_IRUGO | S_IWUSR, show_dynids, store_new_id), |
129 | __ATTR_NULL, | 136 | __ATTR_NULL, |
130 | }; | 137 | }; |
131 | 138 | ||