diff options
-rw-r--r-- | drivers/net/ethernet/marvell/mvneta.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index f3afcbdbb725..bcce0b437722 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
23 | #include <net/ip.h> | 23 | #include <net/ip.h> |
24 | #include <net/ipv6.h> | 24 | #include <net/ipv6.h> |
25 | #include <linux/io.h> | ||
25 | #include <linux/of.h> | 26 | #include <linux/of.h> |
26 | #include <linux/of_irq.h> | 27 | #include <linux/of_irq.h> |
27 | #include <linux/of_mdio.h> | 28 | #include <linux/of_mdio.h> |
@@ -2774,6 +2775,7 @@ static void mvneta_port_power_up(struct mvneta_port *pp, int phy_mode) | |||
2774 | static int mvneta_probe(struct platform_device *pdev) | 2775 | static int mvneta_probe(struct platform_device *pdev) |
2775 | { | 2776 | { |
2776 | const struct mbus_dram_target_info *dram_target_info; | 2777 | const struct mbus_dram_target_info *dram_target_info; |
2778 | struct resource *res; | ||
2777 | struct device_node *dn = pdev->dev.of_node; | 2779 | struct device_node *dn = pdev->dev.of_node; |
2778 | struct device_node *phy_node; | 2780 | struct device_node *phy_node; |
2779 | u32 phy_addr; | 2781 | u32 phy_addr; |
@@ -2837,9 +2839,10 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2837 | 2839 | ||
2838 | clk_prepare_enable(pp->clk); | 2840 | clk_prepare_enable(pp->clk); |
2839 | 2841 | ||
2840 | pp->base = of_iomap(dn, 0); | 2842 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2841 | if (pp->base == NULL) { | 2843 | pp->base = devm_ioremap_resource(&pdev->dev, res); |
2842 | err = -ENOMEM; | 2844 | if (IS_ERR(pp->base)) { |
2845 | err = PTR_ERR(pp->base); | ||
2843 | goto err_clk; | 2846 | goto err_clk; |
2844 | } | 2847 | } |
2845 | 2848 | ||
@@ -2847,7 +2850,7 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2847 | pp->stats = netdev_alloc_pcpu_stats(struct mvneta_pcpu_stats); | 2850 | pp->stats = netdev_alloc_pcpu_stats(struct mvneta_pcpu_stats); |
2848 | if (!pp->stats) { | 2851 | if (!pp->stats) { |
2849 | err = -ENOMEM; | 2852 | err = -ENOMEM; |
2850 | goto err_unmap; | 2853 | goto err_clk; |
2851 | } | 2854 | } |
2852 | 2855 | ||
2853 | dt_mac_addr = of_get_mac_address(dn); | 2856 | dt_mac_addr = of_get_mac_address(dn); |
@@ -2906,8 +2909,6 @@ err_deinit: | |||
2906 | mvneta_deinit(pp); | 2909 | mvneta_deinit(pp); |
2907 | err_free_stats: | 2910 | err_free_stats: |
2908 | free_percpu(pp->stats); | 2911 | free_percpu(pp->stats); |
2909 | err_unmap: | ||
2910 | iounmap(pp->base); | ||
2911 | err_clk: | 2912 | err_clk: |
2912 | clk_disable_unprepare(pp->clk); | 2913 | clk_disable_unprepare(pp->clk); |
2913 | err_free_irq: | 2914 | err_free_irq: |
@@ -2927,7 +2928,6 @@ static int mvneta_remove(struct platform_device *pdev) | |||
2927 | mvneta_deinit(pp); | 2928 | mvneta_deinit(pp); |
2928 | clk_disable_unprepare(pp->clk); | 2929 | clk_disable_unprepare(pp->clk); |
2929 | free_percpu(pp->stats); | 2930 | free_percpu(pp->stats); |
2930 | iounmap(pp->base); | ||
2931 | irq_dispose_mapping(dev->irq); | 2931 | irq_dispose_mapping(dev->irq); |
2932 | free_netdev(dev); | 2932 | free_netdev(dev); |
2933 | 2933 | ||