aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet/mii-fec.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/fs_enet/mii-fec.c')
-rw-r--r--drivers/net/fs_enet/mii-fec.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c
index dbb9c48623df..6a2e150e75bb 100644
--- a/drivers/net/fs_enet/mii-fec.c
+++ b/drivers/net/fs_enet/mii-fec.c
@@ -101,15 +101,21 @@ static int fs_enet_fec_mii_reset(struct mii_bus *bus)
101 return 0; 101 return 0;
102} 102}
103 103
104static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev, 104static struct of_device_id fs_enet_mdio_fec_match[];
105 const struct of_device_id *match) 105static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
106{ 106{
107 const struct of_device_id *match;
107 struct resource res; 108 struct resource res;
108 struct mii_bus *new_bus; 109 struct mii_bus *new_bus;
109 struct fec_info *fec; 110 struct fec_info *fec;
110 int (*get_bus_freq)(struct device_node *) = match->data; 111 int (*get_bus_freq)(struct device_node *);
111 int ret = -ENOMEM, clock, speed; 112 int ret = -ENOMEM, clock, speed;
112 113
114 match = of_match_device(fs_enet_mdio_fec_match, &ofdev->dev);
115 if (!match)
116 return -EINVAL;
117 get_bus_freq = match->data;
118
113 new_bus = mdiobus_alloc(); 119 new_bus = mdiobus_alloc();
114 if (!new_bus) 120 if (!new_bus)
115 goto out; 121 goto out;
@@ -221,7 +227,7 @@ static struct of_device_id fs_enet_mdio_fec_match[] = {
221}; 227};
222MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match); 228MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match);
223 229
224static struct of_platform_driver fs_enet_fec_mdio_driver = { 230static struct platform_driver fs_enet_fec_mdio_driver = {
225 .driver = { 231 .driver = {
226 .name = "fsl-fec-mdio", 232 .name = "fsl-fec-mdio",
227 .owner = THIS_MODULE, 233 .owner = THIS_MODULE,
@@ -233,12 +239,12 @@ static struct of_platform_driver fs_enet_fec_mdio_driver = {
233 239
234static int fs_enet_mdio_fec_init(void) 240static int fs_enet_mdio_fec_init(void)
235{ 241{
236 return of_register_platform_driver(&fs_enet_fec_mdio_driver); 242 return platform_driver_register(&fs_enet_fec_mdio_driver);
237} 243}
238 244
239static void fs_enet_mdio_fec_exit(void) 245static void fs_enet_mdio_fec_exit(void)
240{ 246{
241 of_unregister_platform_driver(&fs_enet_fec_mdio_driver); 247 platform_driver_unregister(&fs_enet_fec_mdio_driver);
242} 248}
243 249
244module_init(fs_enet_mdio_fec_init); 250module_init(fs_enet_mdio_fec_init);