aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index dadd9a5f6323..c9f1d1b7ef37 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2969,14 +2969,14 @@ static int mvneta_probe(struct platform_device *pdev)
2969 /* In the case of a fixed PHY, the DT node associated 2969 /* In the case of a fixed PHY, the DT node associated
2970 * to the PHY is the Ethernet MAC DT node. 2970 * to the PHY is the Ethernet MAC DT node.
2971 */ 2971 */
2972 phy_node = dn; 2972 phy_node = of_node_get(dn);
2973 } 2973 }
2974 2974
2975 phy_mode = of_get_phy_mode(dn); 2975 phy_mode = of_get_phy_mode(dn);
2976 if (phy_mode < 0) { 2976 if (phy_mode < 0) {
2977 dev_err(&pdev->dev, "incorrect phy-mode\n"); 2977 dev_err(&pdev->dev, "incorrect phy-mode\n");
2978 err = -EINVAL; 2978 err = -EINVAL;
2979 goto err_free_irq; 2979 goto err_put_phy_node;
2980 } 2980 }
2981 2981
2982 dev->tx_queue_len = MVNETA_MAX_TXD; 2982 dev->tx_queue_len = MVNETA_MAX_TXD;
@@ -2992,7 +2992,7 @@ static int mvneta_probe(struct platform_device *pdev)
2992 pp->clk = devm_clk_get(&pdev->dev, NULL); 2992 pp->clk = devm_clk_get(&pdev->dev, NULL);
2993 if (IS_ERR(pp->clk)) { 2993 if (IS_ERR(pp->clk)) {
2994 err = PTR_ERR(pp->clk); 2994 err = PTR_ERR(pp->clk);
2995 goto err_free_irq; 2995 goto err_put_phy_node;
2996 } 2996 }
2997 2997
2998 clk_prepare_enable(pp->clk); 2998 clk_prepare_enable(pp->clk);
@@ -3071,6 +3071,8 @@ err_free_stats:
3071 free_percpu(pp->stats); 3071 free_percpu(pp->stats);
3072err_clk: 3072err_clk:
3073 clk_disable_unprepare(pp->clk); 3073 clk_disable_unprepare(pp->clk);
3074err_put_phy_node:
3075 of_node_put(phy_node);
3074err_free_irq: 3076err_free_irq:
3075 irq_dispose_mapping(dev->irq); 3077 irq_dispose_mapping(dev->irq);
3076err_free_netdev: 3078err_free_netdev:
@@ -3088,6 +3090,7 @@ static int mvneta_remove(struct platform_device *pdev)
3088 clk_disable_unprepare(pp->clk); 3090 clk_disable_unprepare(pp->clk);
3089 free_percpu(pp->stats); 3091 free_percpu(pp->stats);
3090 irq_dispose_mapping(dev->irq); 3092 irq_dispose_mapping(dev->irq);
3093 of_node_put(pp->phy_node);
3091 free_netdev(dev); 3094 free_netdev(dev);
3092 3095
3093 return 0; 3096 return 0;