aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r--drivers/net/phy/phy_device.c48
1 files changed, 33 insertions, 15 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index f0595af4c837..c11138330fed 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -39,6 +39,19 @@
39#include <asm/irq.h> 39#include <asm/irq.h>
40#include <asm/uaccess.h> 40#include <asm/uaccess.h>
41 41
42static int genphy_config_init(struct phy_device *phydev);
43
44static struct phy_driver genphy_driver = {
45 .phy_id = 0xffffffff,
46 .phy_id_mask = 0xffffffff,
47 .name = "Generic PHY",
48 .config_init = genphy_config_init,
49 .features = 0,
50 .config_aneg = genphy_config_aneg,
51 .read_status = genphy_read_status,
52 .driver = {.owner = THIS_MODULE, },
53};
54
42/* get_phy_device 55/* get_phy_device
43 * 56 *
44 * description: Reads the ID registers of the PHY at addr on the 57 * description: Reads the ID registers of the PHY at addr on the
@@ -656,27 +669,32 @@ void phy_driver_unregister(struct phy_driver *drv)
656} 669}
657EXPORT_SYMBOL(phy_driver_unregister); 670EXPORT_SYMBOL(phy_driver_unregister);
658 671
659static struct phy_driver genphy_driver = {
660 .phy_id = 0xffffffff,
661 .phy_id_mask = 0xffffffff,
662 .name = "Generic PHY",
663 .config_init = genphy_config_init,
664 .features = 0,
665 .config_aneg = genphy_config_aneg,
666 .read_status = genphy_read_status,
667 .driver = {.owner = THIS_MODULE, },
668};
669 672
670static int __init genphy_init(void) 673static int __init phy_init(void)
671{ 674{
672 return phy_driver_register(&genphy_driver); 675 int rc;
676 extern int mdio_bus_init(void);
677
678 rc = phy_driver_register(&genphy_driver);
679 if (rc)
680 goto out;
681
682 rc = mdio_bus_init();
683 if (rc)
684 goto out_unreg;
673 685
686 return 0;
687
688out_unreg:
689 phy_driver_unregister(&genphy_driver);
690out:
691 return rc;
674} 692}
675 693
676static void __exit genphy_exit(void) 694static void __exit phy_exit(void)
677{ 695{
678 phy_driver_unregister(&genphy_driver); 696 phy_driver_unregister(&genphy_driver);
679} 697}
680 698
681module_init(genphy_init); 699module_init(phy_init);
682module_exit(genphy_exit); 700module_exit(phy_exit);