diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2013-12-05 17:52:12 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-06 14:57:21 -0500 |
commit | 7d976376560b72e187c96e4b18d059e0a0f9eba5 (patch) | |
tree | cf45208ea156824643ce01398abefa2feba4da4a /drivers/of | |
parent | bed2f9ed2f3c4debe2e930c44ee95af980db7e20 (diff) |
net: of_mdio: do not overwrite PHY interrupt configuration
If irq_of_parse_and_map fails to find an interrupt line for a given PHY,
we will force the PHY interrupt to be PHY_POLL, completely overriding
the previous value that the MDIO bus may have set for us (e.g:
PHY_IGNORE_INTERRUPT). In case of failure, just restore the previous
value.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/of_mdio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index f93ebca0fcb7..14feffc36964 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c | |||
@@ -27,7 +27,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi | |||
27 | { | 27 | { |
28 | struct phy_device *phy; | 28 | struct phy_device *phy; |
29 | bool is_c45; | 29 | bool is_c45; |
30 | int rc; | 30 | int rc, prev_irq; |
31 | 31 | ||
32 | is_c45 = of_device_is_compatible(child, | 32 | is_c45 = of_device_is_compatible(child, |
33 | "ethernet-phy-ieee802.3-c45"); | 33 | "ethernet-phy-ieee802.3-c45"); |
@@ -37,10 +37,11 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi | |||
37 | return 1; | 37 | return 1; |
38 | 38 | ||
39 | if (mdio->irq) { | 39 | if (mdio->irq) { |
40 | prev_irq = mdio->irq[addr]; | ||
40 | mdio->irq[addr] = | 41 | mdio->irq[addr] = |
41 | irq_of_parse_and_map(child, 0); | 42 | irq_of_parse_and_map(child, 0); |
42 | if (!mdio->irq[addr]) | 43 | if (!mdio->irq[addr]) |
43 | mdio->irq[addr] = PHY_POLL; | 44 | mdio->irq[addr] = prev_irq; |
44 | } | 45 | } |
45 | 46 | ||
46 | /* Associate the OF node with the device structure so it | 47 | /* Associate the OF node with the device structure so it |