diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-30 12:02:13 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-30 12:06:51 +0100 |
commit | 54aa8af53905e39a825773883914810033f4d3d3 (patch) | |
tree | f33702b2b297322bbd42965d6c86fde1b4fad40c /drivers/usb/gadget/legacy | |
parent | Revert "usb: gadget: udc: bcm63xx: Convert to use list_count()" (diff) | |
download | linux-54aa8af53905e39a825773883914810033f4d3d3.tar.xz linux-54aa8af53905e39a825773883914810033f4d3d3.zip |
Revert "usb: gadget: hid: Convert to use list_count()"
This reverts commit 33f00f41d963c86176dba2f9faff9b428a542e60 as it
breaks the build.
Link: https://lore.kernel.org/r/20221130131854.35b58b16@canb.auug.org.au
Link: https://lore.kernel.org/r/202211301628.iwMjPVMp-lkp@intel.com
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/legacy')
-rw-r--r-- | drivers/usb/gadget/legacy/hid.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/gadget/legacy/hid.c b/drivers/usb/gadget/legacy/hid.c index 6196c3456e0b..1187ee4f316a 100644 --- a/drivers/usb/gadget/legacy/hid.c +++ b/drivers/usb/gadget/legacy/hid.c @@ -133,11 +133,14 @@ static struct usb_configuration config_driver = { static int hid_bind(struct usb_composite_dev *cdev) { struct usb_gadget *gadget = cdev->gadget; + struct list_head *tmp; struct hidg_func_node *n = NULL, *m, *iter_n; struct f_hid_opts *hid_opts; - int status, funcs; + int status, funcs = 0; + + list_for_each(tmp, &hidg_func_list) + funcs++; - funcs = list_count(&hidg_func_list); if (!funcs) return -ENODEV; |