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/can/mscan/mpc5xxx_can.c | 15 +++++++++------ drivers/net/can/sja1000/sja1000_of_platform.c | 9 ++++----- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'drivers/net/can') diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c index 312b9c8f4f3..c0a1bc5b143 100644 --- a/drivers/net/can/mscan/mpc5xxx_can.c +++ b/drivers/net/can/mscan/mpc5xxx_can.c @@ -247,10 +247,9 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev, } #endif /* CONFIG_PPC_MPC512x */ -static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev, - const struct of_device_id *id) +static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev) { - struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data; + struct mpc5xxx_can_data *data; struct device_node *np = ofdev->dev.of_node; struct net_device *dev; struct mscan_priv *priv; @@ -259,6 +258,10 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev, int irq, mscan_clksrc = 0; int err = -ENOMEM; + if (!ofdev->dev.of_match) + return -EINVAL; + data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data; + base = of_iomap(np, 0); if (!base) { dev_err(&ofdev->dev, "couldn't ioremap\n"); @@ -391,7 +394,7 @@ static struct of_device_id __devinitdata mpc5xxx_can_table[] = { {}, }; -static struct of_platform_driver mpc5xxx_can_driver = { +static struct platform_driver mpc5xxx_can_driver = { .driver = { .name = "mpc5xxx_can", .owner = THIS_MODULE, @@ -407,13 +410,13 @@ static struct of_platform_driver mpc5xxx_can_driver = { static int __init mpc5xxx_can_init(void) { - return of_register_platform_driver(&mpc5xxx_can_driver); + return platform_driver_register(&mpc5xxx_can_driver); } module_init(mpc5xxx_can_init); static void __exit mpc5xxx_can_exit(void) { - return of_unregister_platform_driver(&mpc5xxx_can_driver); + platform_driver_unregister(&mpc5xxx_can_driver); }; module_exit(mpc5xxx_can_exit); diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c index 09c3e9db931..9793df6e345 100644 --- a/drivers/net/can/sja1000/sja1000_of_platform.c +++ b/drivers/net/can/sja1000/sja1000_of_platform.c @@ -87,8 +87,7 @@ static int __devexit sja1000_ofp_remove(struct platform_device *ofdev) return 0; } -static int __devinit sja1000_ofp_probe(struct platform_device *ofdev, - const struct of_device_id *id) +static int __devinit sja1000_ofp_probe(struct platform_device *ofdev) { struct device_node *np = ofdev->dev.of_node; struct net_device *dev; @@ -210,7 +209,7 @@ static struct of_device_id __devinitdata sja1000_ofp_table[] = { }; MODULE_DEVICE_TABLE(of, sja1000_ofp_table); -static struct of_platform_driver sja1000_ofp_driver = { +static struct platform_driver sja1000_ofp_driver = { .driver = { .owner = THIS_MODULE, .name = DRV_NAME, @@ -222,12 +221,12 @@ static struct of_platform_driver sja1000_ofp_driver = { static int __init sja1000_ofp_init(void) { - return of_register_platform_driver(&sja1000_ofp_driver); + return platform_driver_register(&sja1000_ofp_driver); } module_init(sja1000_ofp_init); static void __exit sja1000_ofp_exit(void) { - return of_unregister_platform_driver(&sja1000_ofp_driver); + return platform_driver_unregister(&sja1000_ofp_driver); }; module_exit(sja1000_ofp_exit); -- cgit v1.2.3-70-g09d2