usb: dwc3: Fix remove function if there is no ulpi_reset gpio
authorVenkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Wed, 9 Aug 2023 03:33:50 +0000 (09:03 +0530)
committerMarek Vasut <marex@denx.de>
Fri, 25 Aug 2023 00:35:40 +0000 (02:35 +0200)
commit9871b0e5d0f9a5479dddfc5d3a9f47924a996421
treec08335eac4267d697e04212a00cd9afe9e827864
parent291055efee4e1ae4ad0b62393256514a4e76cb1e
usb: dwc3: Fix remove function if there is no ulpi_reset gpio

As ulpi_reset gpio is now optional, we need to check it when doing
the 'dwc3_generic_remove' function. Check if it is declared before
accessing the ulpi_reset.

Fixes: 237d1f60b1d ("usb: dwc3: Use the devm_gpiod_get_optional()
     API for reset gpio")

Reported-by: Thomas Nizan <tnizan@witekio.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
drivers/usb/dwc3/dwc3-generic.c