mirror of https://gitee.com/openkylin/linux.git
phy: allwinner: convert to devm_platform_ioremap_resource(_byname)
Use devm_platform_ioremap_resource(_byname) to simplify code Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/1604642930-29019-1-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
6edf7700a9
commit
08d4deda69
|
@ -686,7 +686,6 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
|
|||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
struct phy_provider *phy_provider;
|
||||
struct resource *res;
|
||||
int i, ret;
|
||||
|
||||
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
|
||||
|
@ -700,8 +699,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
|
|||
if (!data->cfg)
|
||||
return -EINVAL;
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl");
|
||||
data->base = devm_ioremap_resource(dev, res);
|
||||
data->base = devm_platform_ioremap_resource_byname(pdev, "phy_ctrl");
|
||||
if (IS_ERR(data->base))
|
||||
return PTR_ERR(data->base);
|
||||
|
||||
|
@ -796,9 +794,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
|
|||
|
||||
if (i || data->cfg->phy0_dual_route) { /* No pmu for musb */
|
||||
snprintf(name, sizeof(name), "pmu%d", i);
|
||||
res = platform_get_resource_byname(pdev,
|
||||
IORESOURCE_MEM, name);
|
||||
phy->pmu = devm_ioremap_resource(dev, res);
|
||||
phy->pmu = devm_platform_ioremap_resource_byname(pdev, name);
|
||||
if (IS_ERR(phy->pmu))
|
||||
return PTR_ERR(phy->pmu);
|
||||
}
|
||||
|
|
|
@ -134,7 +134,6 @@ static int sun50i_usb3_phy_probe(struct platform_device *pdev)
|
|||
struct sun50i_usb3_phy *phy;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct phy_provider *phy_provider;
|
||||
struct resource *res;
|
||||
|
||||
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
|
||||
if (!phy)
|
||||
|
@ -153,8 +152,7 @@ static int sun50i_usb3_phy_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(phy->reset);
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
phy->regs = devm_ioremap_resource(dev, res);
|
||||
phy->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(phy->regs))
|
||||
return PTR_ERR(phy->regs);
|
||||
|
||||
|
|
|
@ -253,15 +253,13 @@ static int sun6i_dphy_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct phy_provider *phy_provider;
|
||||
struct sun6i_dphy *dphy;
|
||||
struct resource *res;
|
||||
void __iomem *regs;
|
||||
|
||||
dphy = devm_kzalloc(&pdev->dev, sizeof(*dphy), GFP_KERNEL);
|
||||
if (!dphy)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
regs = devm_ioremap_resource(&pdev->dev, res);
|
||||
regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(regs)) {
|
||||
dev_err(&pdev->dev, "Couldn't map the DPHY encoder registers\n");
|
||||
return PTR_ERR(regs);
|
||||
|
|
|
@ -117,7 +117,6 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev)
|
|||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
struct phy_provider *phy_provider;
|
||||
struct resource *res;
|
||||
|
||||
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
|
||||
if (!phy)
|
||||
|
@ -156,8 +155,7 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev)
|
|||
}
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
phy->pmu = devm_ioremap_resource(dev, res);
|
||||
phy->pmu = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(phy->pmu))
|
||||
return PTR_ERR(phy->pmu);
|
||||
|
||||
|
|
Loading…
Reference in New Issue