diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-12-05 01:14:27 +0100 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-12-07 21:09:05 +0100 |
commit | 968530643a0685caced9dfd6f72f20d5e7bc8fbb (patch) | |
tree | a56c14b1c7df99569b5d3e6fbeb3e7433c9f2d72 /drivers/net/ibm_newemac | |
parent | ibm_newemac: Add ET1011c PHY support (diff) | |
download | linux-968530643a0685caced9dfd6f72f20d5e7bc8fbb.tar.xz linux-968530643a0685caced9dfd6f72f20d5e7bc8fbb.zip |
ibm_newemac: Fix ZMII refcounting bug
When using ZMII for MDIO only (such as 440GX with RGMII for data and ZMII for
MDIO), the ZMII code would fail to properly refcount, thus triggering a
BUG_ON().
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ibm_newemac')
-rw-r--r-- | drivers/net/ibm_newemac/zmii.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ibm_newemac/zmii.c b/drivers/net/ibm_newemac/zmii.c index 2219ec2740e0..0f8cfbc0c618 100644 --- a/drivers/net/ibm_newemac/zmii.c +++ b/drivers/net/ibm_newemac/zmii.c @@ -83,12 +83,14 @@ int __devinit zmii_attach(struct of_device *ofdev, int input, int *mode) ZMII_DBG(dev, "init(%d, %d)" NL, input, *mode); - if (!zmii_valid_mode(*mode)) + if (!zmii_valid_mode(*mode)) { /* Probably an EMAC connected to RGMII, * but it still may need ZMII for MDIO so * we don't fail here. */ + dev->users++; return 0; + } mutex_lock(&dev->lock); |