]> exis.tech > repos - linux.git/commitdiff
usb: dwc3: fix dwc3_readl() and dwc3_writel() calls in dwc3_ulpi_setup()
authorBen Dooks <ben.dooks@codethink.co.uk>
Fri, 3 Jul 2026 16:20:33 +0000 (17:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jul 2026 11:33:43 +0000 (13:33 +0200)
The dwc3_ulpi_setup() calls the register read and write calls with
dwc3->regs when both these calls take the dwc3 structure directly.

Chnage these two calls to fix the following sparse warning, and
possibly a nasty bug in the dwc3_ulpi_setup() code:

drivers/usb/dwc3/core.c:796:45: warning: incorrect type in argument 1 (different address spaces)
drivers/usb/dwc3/core.c:796:45:    expected struct dwc3 *dwc
drivers/usb/dwc3/core.c:796:45:    got void [noderef] __iomem *regs
drivers/usb/dwc3/core.c:798:40: warning: incorrect type in argument 1 (different address spaces)
drivers/usb/dwc3/core.c:798:40:    expected struct dwc3 *dwc
drivers/usb/dwc3/core.c:798:40:    got void [noderef] __iomem *regs

Cc: stable <stable@kernel.org>
Fixes: 9accc68b1cf0 ("usb: dwc3: Add dwc pointer to dwc3_readl/writel")
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Link: https://patch.msgid.link/20260703162033.2847599-1-ben.dooks@codethink.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/core.c

index 517aa7f1486da6c2f1bb976c0faa7881a2a3a0c3..ceb49f2f8004188ca30008ae5b7596226485052d 100644 (file)
@@ -789,9 +789,9 @@ static void dwc3_ulpi_setup(struct dwc3 *dwc)
 
        if (dwc->enable_usb2_transceiver_delay) {
                for (index = 0; index < dwc->num_usb2_ports; index++) {
-                       reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(index));
+                       reg = dwc3_readl(dwc, DWC3_GUSB2PHYCFG(index));
                        reg |= DWC3_GUSB2PHYCFG_XCVRDLY;
-                       dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(index), reg);
+                       dwc3_writel(dwc, DWC3_GUSB2PHYCFG(index), reg);
                }
        }
 }