From 74888760d40b3ac9054f9c5fa07b566c0676ba2d Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Tue, 22 Feb 2011 21:05:51 -0700 Subject: dt/net: Eliminate users of of_platform_{,un}register_driver Get rid of users of of_platform_driver in drivers/net. The of_platform_{,un}register_driver functions are going away, so the users need to be converted to using the platform_bus_type directly. Signed-off-by: Grant Likely --- drivers/net/fs_enet/fs_enet-main.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'drivers/net/fs_enet/fs_enet-main.c') diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 7a1f3d0..24cb953 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c @@ -998,8 +998,7 @@ 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 int __devinit fs_enet_probe(struct platform_device *ofdev) { struct net_device *ndev; struct fs_enet_private *fep; @@ -1008,11 +1007,14 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev, const u8 *mac_addr; int privsize, len, ret = -ENODEV; + if (!ofdev->dev.of_match) + return -EINVAL; + fpi = kzalloc(sizeof(*fpi), GFP_KERNEL); if (!fpi) return -ENOMEM; - if (!IS_FEC(match)) { + if (!IS_FEC(ofdev->dev.of_match)) { data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len); if (!data || len != 4) goto out_free_fpi; @@ -1047,7 +1049,7 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev, fep->dev = &ofdev->dev; fep->ndev = ndev; fep->fpi = fpi; - fep->ops = match->data; + fep->ops = ofdev->dev.of_match->data; ret = fep->ops->setup_data(ndev); if (ret) @@ -1156,7 +1158,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 +1170,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 -- cgit v1.1