]> git.kernelconcepts.de Git - meta-kc-bsp.git/blob - recipes-kernel/linux/linux-karo-4.9.11/reset-phy-minimal.patch
fix machine definition substitution
[meta-kc-bsp.git] / recipes-kernel / linux / linux-karo-4.9.11 / reset-phy-minimal.patch
1 diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
2 index 41a31f2..c062438 100644
3 --- a/drivers/net/ethernet/freescale/fec_main.c
4 +++ b/drivers/net/ethernet/freescale/fec_main.c
5 @@ -1875,6 +1875,8 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
6         return ret;
7  }
8  
9 +static int fec_reset_phy(struct platform_device *pdev);
10 +
11  static int fec_enet_clk_enable(struct net_device *ndev, bool enable)
12  {
13         struct fec_enet_private *fep = netdev_priv(ndev);
14 @@ -1885,6 +1887,7 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable)
15                         ret = clk_prepare_enable(fep->clk_enet_out);
16                         if (ret)
17                                 return ret;
18 +                       fec_reset_phy(fep->pdev);
19                 }
20                 if (fep->clk_ptp) {
21                         mutex_lock(&fep->ptp_clk_mutex);
22 @@ -3367,6 +3370,8 @@ static int fec_reset_phy(struct platform_device *pdev)
23  
24         gpio_set_value_cansleep(phy_reset, !active_high);
25  
26 +       devm_gpio_free(&pdev->dev, phy_reset);
27 +
28         return 0;
29  }
30  #else /* CONFIG_OF */