[RAMEN9610-14252] [9610] usb: phy: add iounmap and NULL check of ioremap
authorDaehwan Jung <dh10.jung@samsung.com>
Mon, 11 Mar 2019 07:50:03 +0000 (16:50 +0900)
committerhskang <hs1218.kang@samsung.com>
Sun, 21 Apr 2019 09:10:11 +0000 (18:10 +0900)
Change-Id: Ieb62e64bfd9ff925740b02197cdbe8b0d0928899
Signed-off-by: Daehwan Jung <dh10.jung@samsung.com>
drivers/phy/samsung/phy-exynos-usbdrd3.c

index 95ead4db0a98afce60fd4bedad9a4defef62450f..ec242cac56cf38440249cec942f956d3f819bca4 100644 (file)
@@ -416,6 +416,11 @@ static void exynos_usbdrd_usb_txco_enable(struct phy_usb_instance *inst, int on)
        u32     reg;
 
        base = ioremap(0x11860000, 0x100000);
+       if(!base) {
+               dev_err(phy_drd->dev, "[%s] Unable to map I/O memory\n",
+                                                       __func__);
+               return;
+       }
        reg = readl(base + EXYNOS_USBDEV_PHY_CONTROL);
 
        dev_info(phy_drd->dev, "[%s] ++USB DEVCTRL reg 0x%x \n",
@@ -431,6 +436,7 @@ static void exynos_usbdrd_usb_txco_enable(struct phy_usb_instance *inst, int on)
        reg = readl(base + EXYNOS_USBDEV_PHY_CONTROL);
        dev_info(phy_drd->dev, "[%s] --USB DEVCTRL reg 0x%x \n",
                                                        __func__, reg);
+       iounmap(base);
 }
 
 static void exynos_usbdrd_pipe3_phy_isol(struct phy_usb_instance *inst,