summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-06 10:44:51 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-07 08:05:04 -0400
commitb71b283e3d6df40cef03b5ce882b2385971f58a3 (patch)
treef5cde255403b1db797272738e2b02108d6a3b9da
parent91148dbad80bb6024389287be4aefcbf20b2d0e4 (diff)
USB: add support for dev_groups to struct usb_driver
Now that the driver core supports dev_groups for individual drivers, expose that pointer to struct usb_driver to make it easier for USB drivers to also use it. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20190806144502.17792-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/driver.c1
-rw-r--r--include/linux/usb.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index ebcadaad89d1..687fc5df4c17 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -954,6 +954,7 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner,
954 new_driver->drvwrap.driver.remove = usb_unbind_interface; 954 new_driver->drvwrap.driver.remove = usb_unbind_interface;
955 new_driver->drvwrap.driver.owner = owner; 955 new_driver->drvwrap.driver.owner = owner;
956 new_driver->drvwrap.driver.mod_name = mod_name; 956 new_driver->drvwrap.driver.mod_name = mod_name;
957 new_driver->drvwrap.driver.dev_groups = new_driver->dev_groups;
957 spin_lock_init(&new_driver->dynids.lock); 958 spin_lock_init(&new_driver->dynids.lock);
958 INIT_LIST_HEAD(&new_driver->dynids.list); 959 INIT_LIST_HEAD(&new_driver->dynids.list);
959 960
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 83d35d993e8c..af4eb6419ae8 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1151,6 +1151,8 @@ struct usbdrv_wrap {
1151 * @id_table: USB drivers use ID table to support hotplugging. 1151 * @id_table: USB drivers use ID table to support hotplugging.
1152 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 1152 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
1153 * or your driver's probe function will never get called. 1153 * or your driver's probe function will never get called.
1154 * @dev_groups: Attributes attached to the device that will be created once it
1155 * is bound to the driver.
1154 * @dynids: used internally to hold the list of dynamically added device 1156 * @dynids: used internally to hold the list of dynamically added device
1155 * ids for this driver. 1157 * ids for this driver.
1156 * @drvwrap: Driver-model core structure wrapper. 1158 * @drvwrap: Driver-model core structure wrapper.
@@ -1198,6 +1200,7 @@ struct usb_driver {
1198 int (*post_reset)(struct usb_interface *intf); 1200 int (*post_reset)(struct usb_interface *intf);
1199 1201
1200 const struct usb_device_id *id_table; 1202 const struct usb_device_id *id_table;
1203 const struct attribute_group **dev_groups;
1201 1204
1202 struct usb_dynids dynids; 1205 struct usb_dynids dynids;
1203 struct usbdrv_wrap drvwrap; 1206 struct usbdrv_wrap drvwrap;