Commit 00c33afb authored by Jisheng Zhang's avatar Jisheng Zhang Committed by David S. Miller

net: mvneta: use devm_platform_ioremap_resource() to simplify code

devm_platform_ioremap_resource() wraps platform_get_resource() and
devm_ioremap_resource() in a single helper, let's use that helper to
simplify the code.
Signed-off-by: default avatarJisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b591c6f6
...@@ -4469,7 +4469,6 @@ static int mvneta_port_power_up(struct mvneta_port *pp, int phy_mode) ...@@ -4469,7 +4469,6 @@ static int mvneta_port_power_up(struct mvneta_port *pp, int phy_mode)
/* Device initialization routine */ /* Device initialization routine */
static int mvneta_probe(struct platform_device *pdev) static int mvneta_probe(struct platform_device *pdev)
{ {
struct resource *res;
struct device_node *dn = pdev->dev.of_node; struct device_node *dn = pdev->dev.of_node;
struct device_node *bm_node; struct device_node *bm_node;
struct mvneta_port *pp; struct mvneta_port *pp;
...@@ -4553,8 +4552,7 @@ static int mvneta_probe(struct platform_device *pdev) ...@@ -4553,8 +4552,7 @@ static int mvneta_probe(struct platform_device *pdev)
if (!IS_ERR(pp->clk_bus)) if (!IS_ERR(pp->clk_bus))
clk_prepare_enable(pp->clk_bus); clk_prepare_enable(pp->clk_bus);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pp->base = devm_platform_ioremap_resource(pdev, 0);
pp->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(pp->base)) { if (IS_ERR(pp->base)) {
err = PTR_ERR(pp->base); err = PTR_ERR(pp->base);
goto err_clk; goto err_clk;
......
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