Commit 0b5604af authored by Chunfeng Yun's avatar Chunfeng Yun Committed by Vinod Koul

phy: renesas: convert to devm_platform_ioremap_resource

Use devm_platform_ioremap_resource to simplify code
Signed-off-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1604642930-29019-12-git-send-email-chunfeng.yun@mediatek.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent fc566212
...@@ -339,7 +339,6 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev) ...@@ -339,7 +339,6 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev)
struct rcar_gen2_phy_driver *drv; struct rcar_gen2_phy_driver *drv;
struct phy_provider *provider; struct phy_provider *provider;
struct device_node *np; struct device_node *np;
struct resource *res;
void __iomem *base; void __iomem *base;
struct clk *clk; struct clk *clk;
const struct rcar_gen2_phy_data *data; const struct rcar_gen2_phy_data *data;
...@@ -357,8 +356,7 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev) ...@@ -357,8 +356,7 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev)
return PTR_ERR(clk); return PTR_ERR(clk);
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(pdev, 0);
base = devm_ioremap_resource(dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
...@@ -76,7 +76,6 @@ static int rcar_gen3_phy_pcie_probe(struct platform_device *pdev) ...@@ -76,7 +76,6 @@ static int rcar_gen3_phy_pcie_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct phy_provider *provider; struct phy_provider *provider;
struct rcar_gen3_phy *phy; struct rcar_gen3_phy *phy;
struct resource *res;
void __iomem *base; void __iomem *base;
int error; int error;
...@@ -86,8 +85,7 @@ static int rcar_gen3_phy_pcie_probe(struct platform_device *pdev) ...@@ -86,8 +85,7 @@ static int rcar_gen3_phy_pcie_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(pdev, 0);
base = devm_ioremap_resource(dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
...@@ -611,7 +611,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev) ...@@ -611,7 +611,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct rcar_gen3_chan *channel; struct rcar_gen3_chan *channel;
struct phy_provider *provider; struct phy_provider *provider;
struct resource *res;
const struct phy_ops *phy_usb2_ops; const struct phy_ops *phy_usb2_ops;
int ret = 0, i; int ret = 0, i;
...@@ -624,8 +623,7 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev) ...@@ -624,8 +623,7 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
if (!channel) if (!channel)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); channel->base = devm_platform_ioremap_resource(pdev, 0);
channel->base = devm_ioremap_resource(dev, res);
if (IS_ERR(channel->base)) if (IS_ERR(channel->base))
return PTR_ERR(channel->base); return PTR_ERR(channel->base);
......
...@@ -133,7 +133,6 @@ static int rcar_gen3_phy_usb3_probe(struct platform_device *pdev) ...@@ -133,7 +133,6 @@ static int rcar_gen3_phy_usb3_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct rcar_gen3_usb3 *r; struct rcar_gen3_usb3 *r;
struct phy_provider *provider; struct phy_provider *provider;
struct resource *res;
int ret = 0; int ret = 0;
struct clk *clk; struct clk *clk;
...@@ -146,8 +145,7 @@ static int rcar_gen3_phy_usb3_probe(struct platform_device *pdev) ...@@ -146,8 +145,7 @@ static int rcar_gen3_phy_usb3_probe(struct platform_device *pdev)
if (!r) if (!r)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); r->base = devm_platform_ioremap_resource(pdev, 0);
r->base = devm_ioremap_resource(dev, res);
if (IS_ERR(r->base)) if (IS_ERR(r->base))
return PTR_ERR(r->base); return PTR_ERR(r->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment