Commit b65bdf7f authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

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: 2d2a3349 ("usb: dwc3: Add workaround for host mode VBUS glitch when boot")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Acked-by: default avatarThinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/71499112-4ed3-489a-9a56-b4a8ab89cd05@moroto.mountainSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 50c72a46
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment