summaryrefslogtreecommitdiff
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2017-07-30 03:58:56 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-08-15 12:46:02 +0300
commitc7733dc117fe0a8b0095cc3c3b4c22c67a4b5155 (patch)
tree2102a1166153db712db2d37ead1343e10acb8bf4 /drivers/usb/phy
parent89c996820629a36553b5dbb975f4f47597951d8a (diff)
downloadlinux-c7733dc117fe0a8b0095cc3c3b4c22c67a4b5155.tar.xz
usb: phy: qcom: Use devm_ioremap_resource()
Using devm_ioremap_resource() can make the code simpler, as it already does the resource NULL check. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/phy-qcom-8x16-usb.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c b/drivers/usb/phy/phy-qcom-8x16-usb.c
index b6a83a5cbad3..679afeaaa9a8 100644
--- a/drivers/usb/phy/phy-qcom-8x16-usb.c
+++ b/drivers/usb/phy/phy-qcom-8x16-usb.c
@@ -270,12 +270,9 @@ static int phy_8x16_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, qphy);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
-
- qphy->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
- if (!qphy->regs)
- return -ENOMEM;
+ qphy->regs = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(qphy->regs))
+ return PTR_ERR(qphy->regs);
phy = &qphy->phy;
phy->dev = &pdev->dev;