usb: dwc3: gadget: Refactor loop to avoid NULL endpoints
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 12 Feb 2025 19:28:02 +0000 (21:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:59:17 +0000 (07:59 +0200)
commit2ecae001385ee6c9d3aee9733f5ed558c1429572
tree81fc579fcbb9a6ff5f0d2ac509b3135ea239650c
parent8a5e1d32c620c5d0d1eec23d477fc3e30e80786a
usb: dwc3: gadget: Refactor loop to avoid NULL endpoints

[ Upstream commit eafba0205426091354f050381c32ad1567c35844 ]

Prepare the gadget driver to handle the reserved endpoints that will be
not allocated at the initialisation time.

While at it, add a warning where the NULL endpoint should never happen.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <fntoth@gmail.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20250212193116.2487289-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/gadget.c