1 From 04417da7ac6d1a2a38d4406d899ab92bf6e488e1 Mon Sep 17 00:00:00 2001
2 From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
3 Date: Wed, 29 May 2013 21:32:46 +0200
4 Subject: [PATCH 21/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>
12 drivers/net/ethernet/marvell/mv643xx_eth.c | 25 ++++++++++++++++++-------
13 1 file changed, 18 insertions(+), 7 deletions(-)
15 diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
16 index 0a8c064..946033b 100644
17 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
18 +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
20 #include <linux/types.h>
21 #include <linux/slab.h>
22 #include <linux/clk.h>
23 +#include <linux/of_mdio.h>
25 static char mv643xx_eth_driver_name[] = "mv643xx_eth";
26 static char mv643xx_eth_driver_version[] = "1.4";
27 @@ -2715,17 +2716,27 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
28 netif_set_real_num_tx_queues(dev, mp->txq_count);
29 netif_set_real_num_rx_queues(dev, mp->rxq_count);
31 - if (pd->phy_addr != MV643XX_ETH_PHY_NONE) {
34 + mp->phy = of_phy_connect(mp->dev, pd->phy_node,
35 + mv643xx_eth_adjust_link, 0,
36 + PHY_INTERFACE_MODE_GMII);
39 + } else if (pd->phy_addr != MV643XX_ETH_PHY_NONE) {
40 mp->phy = phy_scan(mp, pd->phy_addr);
42 - if (IS_ERR(mp->phy)) {
43 + if (IS_ERR(mp->phy))
44 err = PTR_ERR(mp->phy);
46 - err = -EPROBE_DEFER;
49 - phy_init(mp, pd->speed, pd->duplex);
51 + phy_init(mp, pd->speed, pd->duplex);
53 + if (err == -ENODEV) {
54 + err = -EPROBE_DEFER;
60 SET_ETHTOOL_OPS(dev, &mv643xx_eth_ethtool_ops);