Revert "usb: gadget: udc: bcm63xx: Convert to use list_count()"
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Nov 2022 11:02:12 +0000 (12:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Nov 2022 11:06:51 +0000 (12:06 +0100)
This reverts commit c2d9d02f7bf3c641f9b8e6c9f5de1e564cdeca69 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>
drivers/usb/gadget/udc/bcm63xx_udc.c

index 0762e49e85f85120b1a50d7af77e1882c0219b29..2cdb07905bdebee0120c0c8b35992be1c6fea349 100644 (file)
@@ -2172,6 +2172,7 @@ static int bcm63xx_iudma_dbg_show(struct seq_file *s, void *p)
 
        for (ch_idx = 0; ch_idx < BCM63XX_NUM_IUDMA; ch_idx++) {
                struct iudma_ch *iudma = &udc->iudma[ch_idx];
+               struct list_head *pos;
 
                seq_printf(s, "IUDMA channel %d -- ", ch_idx);
                switch (iudma_defaults[ch_idx].ep_type) {
@@ -2204,10 +2205,14 @@ static int bcm63xx_iudma_dbg_show(struct seq_file *s, void *p)
                seq_printf(s, "  desc: %d/%d used", iudma->n_bds_used,
                           iudma->n_bds);
 
-               if (iudma->bep)
-                       seq_printf(s, "; %zu queued\n", list_count(&iudma->bep->queue));
-               else
+               if (iudma->bep) {
+                       i = 0;
+                       list_for_each(pos, &iudma->bep->queue)
+                               i++;
+                       seq_printf(s, "; %d queued\n", i);
+               } else {
                        seq_printf(s, "\n");
+               }
 
                for (i = 0; i < iudma->n_bds; i++) {
                        struct bcm_enet_desc *d = &iudma->bd_ring[i];