diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-05-19 23:35:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-23 16:51:33 +0900 |
commit | 2ea7b1487f975eb409a7a2df4081d838069cab05 (patch) | |
tree | e3436f8f544bed02ce0e06a7c369e6f5a77a7035 /drivers/usb/phy/phy-msm-usb.c | |
parent | 10775eb17bee1ccc02ac22bb85e50699e0576a84 (diff) |
usb: phy: msm: fix bug in probe()
My previous patch introduced a bug which prevented this driver from
loading. devm_ioremap_resource() has a call to
devm_request_mem_region() which will fail because the address space is
shared between this PHY driver and CI device controller driver.
Fixes: 10f0577aa5cb ('usb: phy: msm: change devm_ioremap() to devm_ioremap_resource()')
Reported-by:"Ivan T. Ivanov" <iivanov@mm-sol.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/phy/phy-msm-usb.c')
-rw-r--r-- | drivers/usb/phy/phy-msm-usb.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 4f88174aede5..ced34f39bdd4 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -1586,9 +1586,11 @@ static int msm_otg_probe(struct platform_device *pdev) np ? "alt_core" : "usb_hs_core_clk"); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - motg->regs = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(motg->regs)) - return PTR_ERR(motg->regs); + if (!res) + return -EINVAL; + motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!motg->regs) + return -ENOMEM; /* * NOTE: The PHYs can be multiplexed between the chipidea controller |