]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/phy/phy-msm-usb.c
usb: phy: msm: use devm_ioremap_resource()
[karo-tx-linux.git] / drivers / usb / phy / phy-msm-usb.c
index 2bffa849336c3e730ff9aba16ff952ee8538becd..301ffb1fa0e439e9c7fd55114099deb721d3093d 100644 (file)
@@ -765,7 +765,8 @@ static int msm_otg_set_host(struct usb_otg *otg, struct usb_bus *host)
         * Kick the state machine work, if peripheral is not supported
         * or peripheral is already registered with us.
         */
-       if (motg->pdata->mode == USB_DR_MODE_HOST || otg->gadget) {
+       if (motg->pdata->mode == USB_DR_MODE_HOST ||
+                       motg->pdata->mode == USB_DR_MODE_OTG || otg->gadget) {
                pm_runtime_get_sync(otg->usb_phy->dev);
                schedule_work(&motg->sm_work);
        }
@@ -835,7 +836,8 @@ static int msm_otg_set_peripheral(struct usb_otg *otg,
         * Kick the state machine work, if host is not supported
         * or host is already registered with us.
         */
-       if (motg->pdata->mode == USB_DR_MODE_PERIPHERAL || otg->host) {
+       if (motg->pdata->mode == USB_DR_MODE_PERIPHERAL ||
+               motg->pdata->mode == USB_DR_MODE_OTG || otg->host) {
                pm_runtime_get_sync(otg->usb_phy->dev);
                schedule_work(&motg->sm_work);
        }
@@ -1716,11 +1718,9 @@ static int msm_otg_probe(struct platform_device *pdev)
                                      np ? "alt_core" : "usb_hs_core_clk");
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -EINVAL;
-       motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
-       if (!motg->regs)
-               return -ENOMEM;
+       motg->regs = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(motg->regs))
+               return PTR_ERR(motg->regs);
 
        pdata = dev_get_platdata(&pdev->dev);
        if (!pdata) {