summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-07-31 14:38:52 +0000
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-08-29 10:01:34 +0300
commitb497fff6f59ec4ab2816439e7ab976a90b7bab5c (patch)
tree1e13c2d26d14f115f253f20bd21fc98a3663156f /drivers/usb
parentdfe1a51d2a36647f74cbad478801efa7cf394376 (diff)
usb: dwc3: pci: Fix return value check in dwc3_byt_enable_ulpi_refclock()
In case of error, the function pcim_iomap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 7740d04d901d ("usb: dwc3: pci: Enable ULPI Refclk on platforms where the firmware does not") Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc3/dwc3-pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 5edd79470368..1286076a8890 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -85,8 +85,8 @@ static int dwc3_byt_enable_ulpi_refclock(struct pci_dev *pci)
u32 value;
reg = pcim_iomap(pci, GP_RWBAR, 0);
- if (IS_ERR(reg))
- return PTR_ERR(reg);
+ if (!reg)
+ return -ENOMEM;
value = readl(reg + GP_RWREG1);
if (!(value & GP_RWREG1_ULPI_REFCLK_DISABLE))