mvebu: Add MTD split framework support
[openwrt/svn-archive/archive.git] / target / linux / mvebu / patches-3.14 / 021-mvneta_support_fixed_links.patch
1 From 83895bedeee6fbf56d887af4280bf9edcc80da60 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Fri, 16 May 2014 16:14:06 +0200
4 Subject: net: mvneta: add support for fixed links
5
6 Following the introduction of of_phy_register_fixed_link(), this patch
7 introduces fixed link support in the mvneta driver, for Marvell Armada
8 370/XP SOCs.
9
10 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
12
13 --- a/drivers/net/ethernet/marvell/mvneta.c
14 +++ b/drivers/net/ethernet/marvell/mvneta.c
15 @@ -2808,9 +2808,22 @@ static int mvneta_probe(struct platform_
16
17 phy_node = of_parse_phandle(dn, "phy", 0);
18 if (!phy_node) {
19 - dev_err(&pdev->dev, "no associated PHY\n");
20 - err = -ENODEV;
21 - goto err_free_irq;
22 + if (!of_phy_is_fixed_link(dn)) {
23 + dev_err(&pdev->dev, "no PHY specified\n");
24 + err = -ENODEV;
25 + goto err_free_irq;
26 + }
27 +
28 + err = of_phy_register_fixed_link(dn);
29 + if (err < 0) {
30 + dev_err(&pdev->dev, "cannot register fixed PHY\n");
31 + goto err_free_irq;
32 + }
33 +
34 + /* In the case of a fixed PHY, the DT node associated
35 + * to the PHY is the Ethernet MAC DT node.
36 + */
37 + phy_node = dn;
38 }
39
40 phy_mode = of_get_phy_mode(dn);