]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: dwc3: pci: Fix return value check in dwc3_byt_enable_ulpi_refclock()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 31 Jul 2018 14:38:52 +0000 (14:38 +0000)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 29 Aug 2018 07:01:34 +0000 (10:01 +0300)
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>
drivers/usb/dwc3/dwc3-pci.c

index 5edd7947036832f3042f503dbe8cdd9d0d5b0cba..1286076a8890308a66d6ef494b85169ae92d7798 100644 (file)
@@ -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))