aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-01-31 10:10:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-17 16:43:57 +0100
commitb65bdf7fd605ebd652a8d44304bafe753f44f160 (patch)
tree305d3c91da3e3804d05e0834050f95d5f5a9baf7 /drivers/usb
parent50c72a46eb41404d6b019532469639a8c26ca026 (diff)
usb: dwc3: Fix an IS_ERR() vs NULL check in dwc3_power_off_all_roothub_ports()
The ioremap() function doesn't return error pointers, it returns NULL on error. Update the check. Fixes: 2d2a3349521d ("usb: dwc3: Add workaround for host mode VBUS glitch when boot") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/71499112-4ed3-489a-9a56-b4a8ab89cd05@moroto.mountain Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc3/host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index ae189b7a4f8b..4e6239d3a0ac 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -35,7 +35,7 @@ static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc)
/* xhci regs is not mapped yet, do it temperary here */
if (dwc->xhci_resources[0].start) {
xhci_regs = ioremap(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END);
- if (IS_ERR(xhci_regs)) {
+ if (!xhci_regs) {
dev_err(dwc->dev, "Failed to ioremap xhci_regs\n");
return;
}