Skip to content

Commit

Permalink
usb: phy: msm: change devm_ioremap() to devm_ioremap_resource()
Browse files Browse the repository at this point in the history
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: 6b99c68 ('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>
  • Loading branch information
Dan Carpenter authored and Felipe Balbi committed May 14, 2014
1 parent c5ab571 commit 10f0577
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/phy/phy-msm-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ 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(&pdev->dev, res->start, resource_size(res));
motg->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(motg->regs))
return PTR_ERR(motg->regs);

Expand Down

0 comments on commit 10f0577

Please sign in to comment.