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>
This commit is contained in:
parent
89c9968206
commit
c7733dc117
@ -270,12 +270,9 @@ static int phy_8x16_probe(struct platform_device *pdev)
|
|||||||
platform_set_drvdata(pdev, qphy);
|
platform_set_drvdata(pdev, qphy);
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (!res)
|
qphy->regs = devm_ioremap_resource(&pdev->dev, res);
|
||||||
return -EINVAL;
|
if (IS_ERR(qphy->regs))
|
||||||
|
return PTR_ERR(qphy->regs);
|
||||||
qphy->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
|
|
||||||
if (!qphy->regs)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
phy = &qphy->phy;
|
phy = &qphy->phy;
|
||||||
phy->dev = &pdev->dev;
|
phy->dev = &pdev->dev;
|
||||||
|
Loading…
Reference in New Issue
Block a user