diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-22 03:12:37 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-22 03:12:37 -0400 |
commit | 8725f25acc656c1522d48a6746055099efdaca4c (patch) | |
tree | e241424fa58178ed6c2a95a4eb931ea83dbea33c /drivers/net/fs_enet | |
parent | c69cccc95fe4b90dde5fe33e6a3b77880b534fa4 (diff) | |
parent | 93ded9b8fd42abe2c3607097963d8de6ad9117eb (diff) |
Merge commit 'origin/master'
Manually fixed up:
drivers/net/fs_enet/fs_enet-main.c
Diffstat (limited to 'drivers/net/fs_enet')
-rw-r--r-- | drivers/net/fs_enet/fs_enet-main.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index ac2c48741d04..92591384afa5 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
38 | #include <linux/phy.h> | 38 | #include <linux/phy.h> |
39 | #include <linux/of_platform.h> | 39 | #include <linux/of_platform.h> |
40 | #include <linux/of_gpio.h> | ||
40 | 41 | ||
41 | #include <linux/vmalloc.h> | 42 | #include <linux/vmalloc.h> |
42 | #include <asm/pgtable.h> | 43 | #include <asm/pgtable.h> |
@@ -729,7 +730,7 @@ static void generic_adjust_link(struct net_device *dev) | |||
729 | if (!fep->oldlink) { | 730 | if (!fep->oldlink) { |
730 | new_state = 1; | 731 | new_state = 1; |
731 | fep->oldlink = 1; | 732 | fep->oldlink = 1; |
732 | netif_schedule(dev); | 733 | netif_tx_schedule_all(dev); |
733 | netif_carrier_on(dev); | 734 | netif_carrier_on(dev); |
734 | netif_start_queue(dev); | 735 | netif_start_queue(dev); |
735 | } | 736 | } |
@@ -979,8 +980,7 @@ static int __devinit find_phy(struct device_node *np, | |||
979 | struct fs_platform_info *fpi) | 980 | struct fs_platform_info *fpi) |
980 | { | 981 | { |
981 | struct device_node *phynode, *mdionode; | 982 | struct device_node *phynode, *mdionode; |
982 | struct resource res; | 983 | int ret = 0, len, bus_id; |
983 | int ret = 0, len; | ||
984 | const u32 *data; | 984 | const u32 *data; |
985 | 985 | ||
986 | data = of_get_property(np, "fixed-link", NULL); | 986 | data = of_get_property(np, "fixed-link", NULL); |
@@ -997,19 +997,28 @@ static int __devinit find_phy(struct device_node *np, | |||
997 | if (!phynode) | 997 | if (!phynode) |
998 | return -EINVAL; | 998 | return -EINVAL; |
999 | 999 | ||
1000 | mdionode = of_get_parent(phynode); | 1000 | data = of_get_property(phynode, "reg", &len); |
1001 | if (!mdionode) | 1001 | if (!data || len != 4) { |
1002 | ret = -EINVAL; | ||
1002 | goto out_put_phy; | 1003 | goto out_put_phy; |
1004 | } | ||
1003 | 1005 | ||
1004 | ret = of_address_to_resource(mdionode, 0, &res); | 1006 | mdionode = of_get_parent(phynode); |
1005 | if (ret) | 1007 | if (!mdionode) { |
1006 | goto out_put_mdio; | 1008 | ret = -EINVAL; |
1009 | goto out_put_phy; | ||
1010 | } | ||
1007 | 1011 | ||
1008 | data = of_get_property(phynode, "reg", &len); | 1012 | bus_id = of_get_gpio(mdionode, 0); |
1009 | if (!data || len != 4) | 1013 | if (bus_id < 0) { |
1010 | goto out_put_mdio; | 1014 | struct resource res; |
1015 | ret = of_address_to_resource(mdionode, 0, &res); | ||
1016 | if (ret) | ||
1017 | goto out_put_mdio; | ||
1018 | bus_id = res.start; | ||
1019 | } | ||
1011 | 1020 | ||
1012 | snprintf(fpi->bus_id, 16, "%x:%02x", res.start, *data); | 1021 | snprintf(fpi->bus_id, 16, "%x:%02x", bus_id, *data); |
1013 | 1022 | ||
1014 | out_put_mdio: | 1023 | out_put_mdio: |
1015 | of_node_put(mdionode); | 1024 | of_node_put(mdionode); |