aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-msm-usb.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-05-14 09:54:47 -0400
committerFelipe Balbi <balbi@ti.com>2014-05-14 10:25:51 -0400
commit10f0577aa5cb03c81cf6ddc2ff7de1b6d6152d0b (patch)
treeef2c9c6c16b2a01b46a082af41ec837c2a99529c /drivers/usb/phy/phy-msm-usb.c
parentc5ab571f81905568a59dce306df0181f33e00932 (diff)
usb: phy: msm: change devm_ioremap() to devm_ioremap_resource()
There are several issues here: 1) platform_get_resource() can return NULL and that wasn't handled. 2) We should request the memory before we remap it, and devm_ioremap_resource() does that. 3) devm_ioremap() returns a NULL but we were checking for IS_ERR(). Fixes: 6b99c68ec1f9 ('usb: phy: msm: Migrate to Managed Device Resource allocation') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy-msm-usb.c')
-rw-r--r--drivers/usb/phy/phy-msm-usb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index c522c4ff8084..4f88174aede5 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1586,7 +1586,7 @@ static int msm_otg_probe(struct platform_device *pdev)
1586 np ? "alt_core" : "usb_hs_core_clk"); 1586 np ? "alt_core" : "usb_hs_core_clk");
1587 1587
1588 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1588 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1589 motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res)); 1589 motg->regs = devm_ioremap_resource(&pdev->dev, res);
1590 if (IS_ERR(motg->regs)) 1590 if (IS_ERR(motg->regs))
1591 return PTR_ERR(motg->regs); 1591 return PTR_ERR(motg->regs);
1592 1592