ibm_newemac: Fix ZMII refcounting bug
[pandora-kernel.git] / drivers / net / ibm_newemac / zmii.c
index 2219ec2..0f8cfbc 100644 (file)
@@ -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);