Commit f150b8d28b4e (usb: dwc3: Enable undefined length INCR burst
type) introduced code that assign the content of dwc->dev to a
variable. But in u-boot the type of this field changes if building
with driver model enabled or not. As this variable is then only used
once just remove it and use the struct field directly.

Another issued was also introduced in fb146fbc1ae5 (usb: dwc3: core:
stop the core when it's removed) which define a static function which
is only used when the driver model is enabled. Mark this function with
__maybe_unused to supress the warning when building without driver
model.

Signed-off-by: Alban Bedel <alban.be...@aerq.com>
---
v2: Use __maybe_unused instead of an #ifdef
---
 drivers/usb/dwc3/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index b592a487e001..2107a2993309 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -465,7 +465,6 @@ static void dwc3_phy_setup(struct dwc3 *dwc)
 /* set global incr burst type configuration registers */
 static void dwc3_set_incr_burst_type(struct dwc3 *dwc)
 {
-       struct udevice *dev = dwc->dev;
        u32 cfg;

        if (!dwc->incrx_size)
@@ -502,7 +501,7 @@ static void dwc3_set_incr_burst_type(struct dwc3 *dwc)
        case 1:
                break;
        default:
-               dev_err(dev, "Invalid property\n");
+               dev_err(dwc->dev, "Invalid property\n");
                break;
        }

@@ -706,7 +705,7 @@ static void dwc3_gadget_run(struct dwc3 *dwc)
        mdelay(100);
 }

-static void dwc3_core_stop(struct dwc3 *dwc)
+static void __maybe_unused dwc3_core_stop(struct dwc3 *dwc)
 {
        u32 reg;

--
2.32.0

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to