提交 b497fff6 编写于 作者: W Wei Yongjun 提交者: Felipe Balbi

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: 7740d04d ("usb: dwc3: pci: Enable ULPI Refclk on platforms where the firmware does not")
Reviewed-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 dfe1a51d
...@@ -85,8 +85,8 @@ static int dwc3_byt_enable_ulpi_refclock(struct pci_dev *pci) ...@@ -85,8 +85,8 @@ static int dwc3_byt_enable_ulpi_refclock(struct pci_dev *pci)
u32 value; u32 value;
reg = pcim_iomap(pci, GP_RWBAR, 0); reg = pcim_iomap(pci, GP_RWBAR, 0);
if (IS_ERR(reg)) if (!reg)
return PTR_ERR(reg); return -ENOMEM;
value = readl(reg + GP_RWREG1); value = readl(reg + GP_RWREG1);
if (!(value & GP_RWREG1_ULPI_REFCLK_DISABLE)) if (!(value & GP_RWREG1_ULPI_REFCLK_DISABLE))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册