aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2008-04-09 20:38:13 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-16 20:09:35 -0400
commit9d9326d3bc0ea9a8bbe40bf3e5e66c7b9858caa0 (patch)
tree51b2ee6bfa87bbd6faac0bc00a787354e1fb72a0 /drivers/net/fs_enet
parentd080cd6301e107e79c6a0fc654319f8979f70549 (diff)
phy: Change mii_bus id field to a string
Having the id field be an int was making more complex bus topologies excessively difficult. For now, just convert it to a string, and change all instances of "bus->id = val" to snprintf(id, MII_BUS_ID_LEN, "%x", val). Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/fs_enet')
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c4
-rw-r--r--drivers/net/fs_enet/mii-bitbang.c4
-rw-r--r--drivers/net/fs_enet/mii-fec.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index 940e2041ba38..67b4b0728fce 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -1178,7 +1178,7 @@ static int __devinit find_phy(struct device_node *np,
1178 1178
1179 data = of_get_property(np, "fixed-link", NULL); 1179 data = of_get_property(np, "fixed-link", NULL);
1180 if (data) { 1180 if (data) {
1181 snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data); 1181 snprintf(fpi->bus_id, 16, "%x:%02x", 0, *data);
1182 return 0; 1182 return 0;
1183 } 1183 }
1184 1184
@@ -1202,7 +1202,7 @@ static int __devinit find_phy(struct device_node *np,
1202 if (!data || len != 4) 1202 if (!data || len != 4)
1203 goto out_put_mdio; 1203 goto out_put_mdio;
1204 1204
1205 snprintf(fpi->bus_id, 16, PHY_ID_FMT, res.start, *data); 1205 snprintf(fpi->bus_id, 16, "%x:%02x", res.start, *data);
1206 1206
1207out_put_mdio: 1207out_put_mdio:
1208 of_node_put(mdionode); 1208 of_node_put(mdionode);
diff --git a/drivers/net/fs_enet/mii-bitbang.c b/drivers/net/fs_enet/mii-bitbang.c
index b8e4a736a130..1620030cd33c 100644
--- a/drivers/net/fs_enet/mii-bitbang.c
+++ b/drivers/net/fs_enet/mii-bitbang.c
@@ -130,7 +130,7 @@ static int __devinit fs_mii_bitbang_init(struct mii_bus *bus,
130 * we get is an int, and the odds of multiple bitbang mdio buses 130 * we get is an int, and the odds of multiple bitbang mdio buses
131 * is low enough that it's not worth going too crazy. 131 * is low enough that it's not worth going too crazy.
132 */ 132 */
133 bus->id = res.start; 133 snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start);
134 134
135 data = of_get_property(np, "fsl,mdio-pin", &len); 135 data = of_get_property(np, "fsl,mdio-pin", &len);
136 if (!data || len != 4) 136 if (!data || len != 4)
@@ -307,7 +307,7 @@ static int __devinit fs_enet_mdio_probe(struct device *dev)
307 return -ENOMEM; 307 return -ENOMEM;
308 308
309 new_bus->name = "BB MII Bus", 309 new_bus->name = "BB MII Bus",
310 new_bus->id = pdev->id; 310 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id);
311 311
312 new_bus->phy_mask = ~0x9; 312 new_bus->phy_mask = ~0x9;
313 pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data; 313 pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data;
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c
index a89cf15090b8..ba75efc9f5b5 100644
--- a/drivers/net/fs_enet/mii-fec.c
+++ b/drivers/net/fs_enet/mii-fec.c
@@ -196,7 +196,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev,
196 if (ret) 196 if (ret)
197 return ret; 197 return ret;
198 198
199 new_bus->id = res.start; 199 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start);
200 200
201 fec->fecp = ioremap(res.start, res.end - res.start + 1); 201 fec->fecp = ioremap(res.start, res.end - res.start + 1);
202 if (!fec->fecp) 202 if (!fec->fecp)
@@ -309,7 +309,7 @@ static int __devinit fs_enet_fec_mdio_probe(struct device *dev)
309 new_bus->read = &fs_enet_fec_mii_read, 309 new_bus->read = &fs_enet_fec_mii_read,
310 new_bus->write = &fs_enet_fec_mii_write, 310 new_bus->write = &fs_enet_fec_mii_write,
311 new_bus->reset = &fs_enet_fec_mii_reset, 311 new_bus->reset = &fs_enet_fec_mii_reset,
312 new_bus->id = pdev->id; 312 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id);
313 313
314 pdata = (struct fs_mii_fec_platform_info *)pdev->dev.platform_data; 314 pdata = (struct fs_mii_fec_platform_info *)pdev->dev.platform_data;
315 315