]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/ibm_newemac/zmii.c
Linux 2.6.28-rc4
[linux-2.6-omap-h63xx.git] / drivers / net / ibm_newemac / zmii.c
index 2219ec2740e056f37f12619613c94f49c4e6fcd0..17b154124943e5baf89e6640f26643ade28be72c 100644 (file)
@@ -3,6 +3,11 @@
  *
  * Driver for PowerPC 4xx on-chip ethernet controller, ZMII bridge support.
  *
+ * Copyright 2007 Benjamin Herrenschmidt, IBM Corp.
+ *                <benh@kernel.crashing.org>
+ *
+ * Based on the arch/ppc version of the driver:
+ *
  * Copyright (c) 2004, 2005 Zultys Technologies.
  * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
  *
@@ -83,12 +88,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);
 
@@ -182,7 +189,7 @@ void zmii_set_speed(struct of_device *ofdev, int input, int speed)
        mutex_unlock(&dev->lock);
 }
 
-void __devexit zmii_detach(struct of_device *ofdev, int input)
+void zmii_detach(struct of_device *ofdev, int input)
 {
        struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev);