diff options
Diffstat (limited to 'drivers/of/of_mdio.c')
-rw-r--r-- | drivers/of/of_mdio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 4b22ba568b19..18ecae4a4375 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c | |||
@@ -51,7 +51,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | |||
51 | 51 | ||
52 | /* Loop over the child nodes and register a phy_device for each one */ | 52 | /* Loop over the child nodes and register a phy_device for each one */ |
53 | for_each_child_of_node(np, child) { | 53 | for_each_child_of_node(np, child) { |
54 | const u32 *addr; | 54 | const __be32 *addr; |
55 | int len; | 55 | int len; |
56 | 56 | ||
57 | /* A PHY must have a reg property in the range [0-31] */ | 57 | /* A PHY must have a reg property in the range [0-31] */ |
@@ -68,7 +68,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | |||
68 | mdio->irq[*addr] = PHY_POLL; | 68 | mdio->irq[*addr] = PHY_POLL; |
69 | } | 69 | } |
70 | 70 | ||
71 | phy = get_phy_device(mdio, *addr); | 71 | phy = get_phy_device(mdio, be32_to_cpup(addr)); |
72 | if (!phy) { | 72 | if (!phy) { |
73 | dev_err(&mdio->dev, "error probing PHY at address %i\n", | 73 | dev_err(&mdio->dev, "error probing PHY at address %i\n", |
74 | *addr); | 74 | *addr); |
@@ -160,7 +160,7 @@ struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | |||
160 | struct device_node *net_np; | 160 | struct device_node *net_np; |
161 | char bus_id[MII_BUS_ID_SIZE + 3]; | 161 | char bus_id[MII_BUS_ID_SIZE + 3]; |
162 | struct phy_device *phy; | 162 | struct phy_device *phy; |
163 | const u32 *phy_id; | 163 | const __be32 *phy_id; |
164 | int sz; | 164 | int sz; |
165 | 165 | ||
166 | if (!dev->dev.parent) | 166 | if (!dev->dev.parent) |
@@ -174,7 +174,7 @@ struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | |||
174 | if (!phy_id || sz < sizeof(*phy_id)) | 174 | if (!phy_id || sz < sizeof(*phy_id)) |
175 | return NULL; | 175 | return NULL; |
176 | 176 | ||
177 | sprintf(bus_id, PHY_ID_FMT, "0", phy_id[0]); | 177 | sprintf(bus_id, PHY_ID_FMT, "0", be32_to_cpu(phy_id[0])); |
178 | 178 | ||
179 | phy = phy_connect(dev, bus_id, hndlr, 0, iface); | 179 | phy = phy_connect(dev, bus_id, hndlr, 0, iface); |
180 | return IS_ERR(phy) ? NULL : phy; | 180 | return IS_ERR(phy) ? NULL : phy; |