diff options
author | Andy Fleming <afleming@freescale.com> | 2008-04-09 19:38:13 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-16 20:09:35 -0400 |
commit | 9d9326d3bc0ea9a8bbe40bf3e5e66c7b9858caa0 (patch) | |
tree | 51b2ee6bfa87bbd6faac0bc00a787354e1fb72a0 /drivers/net/fs_enet | |
parent | d080cd6301e107e79c6a0fc654319f8979f70549 (diff) | |
download | linux-9d9326d3bc0ea9a8bbe40bf3e5e66c7b9858caa0.tar.gz linux-9d9326d3bc0ea9a8bbe40bf3e5e66c7b9858caa0.tar.bz2 linux-9d9326d3bc0ea9a8bbe40bf3e5e66c7b9858caa0.zip |
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.c | 4 | ||||
-rw-r--r-- | drivers/net/fs_enet/mii-bitbang.c | 4 | ||||
-rw-r--r-- | drivers/net/fs_enet/mii-fec.c | 4 |
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, data = of_get_property(np, "fixed-link", NULL); if (data) { - snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data); + snprintf(fpi->bus_id, 16, "%x:%02x", 0, *data); return 0; } @@ -1202,7 +1202,7 @@ static int __devinit find_phy(struct device_node *np, if (!data || len != 4) goto out_put_mdio; - snprintf(fpi->bus_id, 16, PHY_ID_FMT, res.start, *data); + snprintf(fpi->bus_id, 16, "%x:%02x", res.start, *data); out_put_mdio: 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, * we get is an int, and the odds of multiple bitbang mdio buses * is low enough that it's not worth going too crazy. */ - bus->id = res.start; + snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start); data = of_get_property(np, "fsl,mdio-pin", &len); if (!data || len != 4) @@ -307,7 +307,7 @@ static int __devinit fs_enet_mdio_probe(struct device *dev) return -ENOMEM; new_bus->name = "BB MII Bus", - new_bus->id = pdev->id; + snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id); new_bus->phy_mask = ~0x9; 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, if (ret) return ret; - new_bus->id = res.start; + snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start); fec->fecp = ioremap(res.start, res.end - res.start + 1); if (!fec->fecp) @@ -309,7 +309,7 @@ static int __devinit fs_enet_fec_mdio_probe(struct device *dev) new_bus->read = &fs_enet_fec_mii_read, new_bus->write = &fs_enet_fec_mii_write, new_bus->reset = &fs_enet_fec_mii_reset, - new_bus->id = pdev->id; + snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id); pdata = (struct fs_mii_fec_platform_info *)pdev->dev.platform_data; |