#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/phy.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
+static struct phy_driver genphy_driver;
+extern int mdio_bus_init(void);
+extern void mdio_bus_exit(void);
+
/* get_phy_device
*
* description: Reads the ID registers of the PHY at addr on the
phydev->adjust_link = handler;
}
-#ifdef CONFIG_PHYCONTROL
/* phy_connect:
*
* description: Convenience function for connecting ethernet
}
EXPORT_SYMBOL(phy_disconnect);
-#endif /* CONFIG_PHYCONTROL */
-
/* phy_attach:
*
* description: Called by drivers to attach to a particular PHY
.features = 0,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
- .driver = {.owner = THIS_MODULE, },
+ .driver = {.owner= THIS_MODULE, },
};
-static int __init genphy_init(void)
+static int __init phy_init(void)
{
- return phy_driver_register(&genphy_driver);
+ int rc;
+
+ rc = mdio_bus_init();
+ if (rc)
+ return rc;
+
+ rc = phy_driver_register(&genphy_driver);
+ if (rc)
+ mdio_bus_exit();
+ return rc;
}
-static void __exit genphy_exit(void)
+static void __exit phy_exit(void)
{
phy_driver_unregister(&genphy_driver);
+ mdio_bus_exit();
}
-module_init(genphy_init);
-module_exit(genphy_exit);
+subsys_initcall(phy_init);
+module_exit(phy_exit);