1 From db22a1196162f981444d241f92d02e2e50d12ed7 Mon Sep 17 00:00:00 2001
2 From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
3 Date: Wed, 29 May 2013 09:32:46 +0000
4 Subject: [PATCH 23/29] net: mv643xx_eth: use of_phy_connect if phy_node
7 This connects to a phy node passed to the port device instead of probing
10 Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
13 drivers/net/ethernet/marvell/mv643xx_eth.c | 25 ++++++++++++++++++-------
14 1 file changed, 18 insertions(+), 7 deletions(-)
16 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
17 +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
19 #include <linux/types.h>
20 #include <linux/slab.h>
21 #include <linux/clk.h>
22 +#include <linux/of_mdio.h>
24 static char mv643xx_eth_driver_name[] = "mv643xx_eth";
25 static char mv643xx_eth_driver_version[] = "1.4";
26 @@ -2714,17 +2715,27 @@ static int mv643xx_eth_probe(struct plat
27 netif_set_real_num_tx_queues(dev, mp->txq_count);
28 netif_set_real_num_rx_queues(dev, mp->rxq_count);
30 - if (pd->phy_addr != MV643XX_ETH_PHY_NONE) {
33 + mp->phy = of_phy_connect(mp->dev, pd->phy_node,
34 + mv643xx_eth_adjust_link, 0,
35 + PHY_INTERFACE_MODE_GMII);
38 + } else if (pd->phy_addr != MV643XX_ETH_PHY_NONE) {
39 mp->phy = phy_scan(mp, pd->phy_addr);
41 - if (IS_ERR(mp->phy)) {
42 + if (IS_ERR(mp->phy))
43 err = PTR_ERR(mp->phy);
45 - err = -EPROBE_DEFER;
48 - phy_init(mp, pd->speed, pd->duplex);
50 + phy_init(mp, pd->speed, pd->duplex);
52 + if (err == -ENODEV) {
53 + err = -EPROBE_DEFER;
59 SET_ETHTOOL_OPS(dev, &mv643xx_eth_ethtool_ops);