aboutsummaryrefslogtreecommitdiffstats
path: root/usb-serial-convert-bus-code-to-use-drv_groups.patch
diff options
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-23 14:22:10 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-23 14:22:10 -0700
commitcba9545b635d1566060d5a8f1a9dc78680f4e839 (patch)
treeaeec00e82328c58b7ab25333f130524bd5df1c50 /usb-serial-convert-bus-code-to-use-drv_groups.patch
parentf2fea6a31b09a12fe4d9e9e3f9a8e2be017ad611 (diff)
downloadpatches-cba9545b635d1566060d5a8f1a9dc78680f4e839.tar.gz
more updates
Diffstat (limited to 'usb-serial-convert-bus-code-to-use-drv_groups.patch')
-rw-r--r--usb-serial-convert-bus-code-to-use-drv_groups.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/usb-serial-convert-bus-code-to-use-drv_groups.patch b/usb-serial-convert-bus-code-to-use-drv_groups.patch
new file mode 100644
index 00000000000000..98647aa6092686
--- /dev/null
+++ b/usb-serial-convert-bus-code-to-use-drv_groups.patch
@@ -0,0 +1,59 @@
+From foo@baz Fri Aug 23 13:58:06 PDT 2013
+Date: Fri, 23 Aug 2013 13:58:06 -0700
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: USB: serial: convert bus code to use drv_groups
+
+The drv_attrs field of struct bus_type is going away soon, drv_groups
+should be used instead. This converts the USB serial bus code to use
+the correct field.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/serial/bus.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/serial/bus.c
++++ b/drivers/usb/serial/bus.c
+@@ -122,7 +122,7 @@ static int usb_serial_device_remove(stru
+ return retval;
+ }
+
+-static ssize_t store_new_id(struct device_driver *driver,
++static ssize_t new_id_store(struct device_driver *driver,
+ const char *buf, size_t count)
+ {
+ struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
+@@ -135,17 +135,19 @@ static ssize_t store_new_id(struct devic
+ return retval;
+ }
+
+-static ssize_t show_dynids(struct device_driver *driver, char *buf)
++static ssize_t new_id_show(struct device_driver *driver, char *buf)
+ {
+ struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
+
+ return usb_show_dynids(&usb_drv->dynids, buf);
+ }
++static DRIVER_ATTR_RW(new_id);
+
+-static struct driver_attribute drv_attrs[] = {
+- __ATTR(new_id, S_IRUGO | S_IWUSR, show_dynids, store_new_id),
+- __ATTR_NULL,
++static struct attribute *usb_serial_drv_attrs[] = {
++ &driver_attr_new_id.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(usb_serial_drv);
+
+ static void free_dynids(struct usb_serial_driver *drv)
+ {
+@@ -164,7 +166,7 @@ struct bus_type usb_serial_bus_type = {
+ .match = usb_serial_device_match,
+ .probe = usb_serial_device_probe,
+ .remove = usb_serial_device_remove,
+- .drv_attrs = drv_attrs,
++ .drv_groups = usb_serial_drv_groups,
+ };
+
+ int usb_serial_bus_register(struct usb_serial_driver *driver)