Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122861
b: refs/heads/master
c: 161c8d2
h: refs/heads/master
i:
  122859: 9a528f2
v: v3
  • Loading branch information
Krzysztof Halasa authored and David S. Miller committed Dec 26, 2008
1 parent bcb9d5a commit d19af58
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7d1b9f5aafa371d7f51f644aa3c38bc914e9205
refs/heads/master: 161c8d2f50109b44b664eaf23831ea1587979a61
22 changes: 15 additions & 7 deletions trunk/drivers/net/phy/mdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ EXPORT_SYMBOL(mdiobus_alloc);
static void mdiobus_release(struct device *d)
{
struct mii_bus *bus = to_mii_bus(d);
BUG_ON(bus->state != MDIOBUS_RELEASED);
BUG_ON(bus->state != MDIOBUS_RELEASED &&
/* for compatibility with error handling in drivers */
bus->state != MDIOBUS_ALLOCATED);
kfree(bus);
}

Expand All @@ -83,8 +85,7 @@ static struct class mdio_bus_class = {
*/
int mdiobus_register(struct mii_bus *bus)
{
int i;
int err = 0;
int i, err;

if (NULL == bus || NULL == bus->name ||
NULL == bus->read ||
Expand Down Expand Up @@ -116,16 +117,23 @@ int mdiobus_register(struct mii_bus *bus)
struct phy_device *phydev;

phydev = mdiobus_scan(bus, i);
if (IS_ERR(phydev))
if (IS_ERR(phydev)) {
err = PTR_ERR(phydev);
goto error;
}
}
}

if (!err)
bus->state = MDIOBUS_REGISTERED;

bus->state = MDIOBUS_REGISTERED;
pr_info("%s: probed\n", bus->name);
return 0;

error:
while (--i >= 0) {
if (bus->phy_map[i])
device_unregister(&bus->phy_map[i]->dev);
}
device_del(&bus->dev);
return err;
}
EXPORT_SYMBOL(mdiobus_register);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
return NULL;

/*
* Broken hardware is sometimes missing the pull down resistor on the
* Broken hardware is sometimes missing the pull-up resistor on the
* MDIO line, which results in reads to non-existent devices returning
* 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
* device as well.
Expand Down

0 comments on commit d19af58

Please sign in to comment.