aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ibm_newemac/zmii.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2007-12-04 19:14:27 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-07 15:09:05 -0500
commit968530643a0685caced9dfd6f72f20d5e7bc8fbb (patch)
treea56c14b1c7df99569b5d3e6fbeb3e7433c9f2d72 /drivers/net/ibm_newemac/zmii.c
parent8df4538e21f7313a29fa6c5af78c08a135d44738 (diff)
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/zmii.c')
-rw-r--r--drivers/net/ibm_newemac/zmii.c4
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)
83 83
84 ZMII_DBG(dev, "init(%d, %d)" NL, input, *mode); 84 ZMII_DBG(dev, "init(%d, %d)" NL, input, *mode);
85 85
86 if (!zmii_valid_mode(*mode)) 86 if (!zmii_valid_mode(*mode)) {
87 /* Probably an EMAC connected to RGMII, 87 /* Probably an EMAC connected to RGMII,
88 * but it still may need ZMII for MDIO so 88 * but it still may need ZMII for MDIO so
89 * we don't fail here. 89 * we don't fail here.
90 */ 90 */
91 dev->users++;
91 return 0; 92 return 0;
93 }
92 94
93 mutex_lock(&dev->lock); 95 mutex_lock(&dev->lock);
94 96