X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fucc_geth_mii.c;h=2af490781005d63dbfe5eb1322ab7142c9c178ea;hb=62429f434091586d54b37b8dd46076e7c08b27b9;hp=e3ba14a19915d0ab5b01837c9429339761c216eb;hpb=b7e23d913aafc93fc5f119e1be17620073cc3811;p=linux-2.6 diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c index e3ba14a199..2af4907810 100644 --- a/drivers/net/ucc_geth_mii.c +++ b/drivers/net/ucc_geth_mii.c @@ -109,7 +109,7 @@ int uec_mdio_reset(struct mii_bus *bus) struct ucc_mii_mng __iomem *regs = (void __iomem *)bus->priv; unsigned int timeout = PHY_INIT_TIMEOUT; - spin_lock_bh(&bus->mdio_lock); + mutex_lock(&bus->mdio_lock); /* Reset the management interface */ out_be32(®s->miimcfg, MIIMCFG_RESET_MANAGEMENT); @@ -121,7 +121,7 @@ int uec_mdio_reset(struct mii_bus *bus) while ((in_be32(®s->miimind) & MIIMIND_BUSY) && timeout--) cpu_relax(); - spin_unlock_bh(&bus->mdio_lock); + mutex_unlock(&bus->mdio_lock); if (timeout <= 0) { printk(KERN_ERR "%s: The MII Bus is stuck!\n", bus->name); @@ -157,7 +157,7 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma if (err) goto reg_map_fail; - new_bus->id = res.start; + snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start); new_bus->irq = kmalloc(32 * sizeof(int), GFP_KERNEL); @@ -203,9 +203,14 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma if ((res.start >= tempres.start) && (res.end <= tempres.end)) { /* set this UCC to be the MII master */ - const u32 *id = of_get_property(tempnp, "device-id", NULL); - if (id == NULL) - goto bus_register_fail; + const u32 *id; + + id = of_get_property(tempnp, "cell-index", NULL); + if (!id) { + id = of_get_property(tempnp, "device-id", NULL); + if (!id) + goto bus_register_fail; + } ucc_set_qe_mux_mii_mng(*id - 1);