diff options
Diffstat (limited to 'drivers/net/fs_enet/fs_enet-main.c')
-rw-r--r-- | drivers/net/fs_enet/fs_enet-main.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 7a1f3d0ffa78..5131e61c358c 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c @@ -998,9 +998,10 @@ static const struct net_device_ops fs_enet_netdev_ops = { #endif }; -static int __devinit fs_enet_probe(struct platform_device *ofdev, - const struct of_device_id *match) +static struct of_device_id fs_enet_match[]; +static int __devinit fs_enet_probe(struct platform_device *ofdev) { + const struct of_device_id *match; struct net_device *ndev; struct fs_enet_private *fep; struct fs_platform_info *fpi; @@ -1008,6 +1009,10 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev, const u8 *mac_addr; int privsize, len, ret = -ENODEV; + match = of_match_device(fs_enet_match, &ofdev->dev); + if (!match) + return -EINVAL; + fpi = kzalloc(sizeof(*fpi), GFP_KERNEL); if (!fpi) return -ENOMEM; @@ -1156,7 +1161,7 @@ static struct of_device_id fs_enet_match[] = { }; MODULE_DEVICE_TABLE(of, fs_enet_match); -static struct of_platform_driver fs_enet_driver = { +static struct platform_driver fs_enet_driver = { .driver = { .owner = THIS_MODULE, .name = "fs_enet", @@ -1168,12 +1173,12 @@ static struct of_platform_driver fs_enet_driver = { static int __init fs_init(void) { - return of_register_platform_driver(&fs_enet_driver); + return platform_driver_register(&fs_enet_driver); } static void __exit fs_cleanup(void) { - of_unregister_platform_driver(&fs_enet_driver); + platform_driver_unregister(&fs_enet_driver); } #ifdef CONFIG_NET_POLL_CONTROLLER |