aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 20:28:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 20:28:10 -0400
commit4c5811bf463b0ef82fabbd1708f8bb2d753aeb18 (patch)
treeff37d31217c3804ca05de21a55a9b5ca1ca818b2 /drivers/net/can
parentf74b9444192c60603020c61d7915b72893137edc (diff)
parent9f15444fefdb33509132ff5c9be60cb315c44cb2 (diff)
Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6: (21 commits) tty: serial: altera_jtaguart: Add device tree support tty: serial: altera_uart: Add devicetree support dt: eliminate of_platform_driver shim code dt: Eliminate of_platform_{,un}register_driver dt/serial: Eliminate users of of_platform_{,un}register_driver dt/usb: Eliminate users of of_platform_{,un}register_driver dt/video: Eliminate users of of_platform_{,un}register_driver dt/net: Eliminate users of of_platform_{,un}register_driver dt/sound: Eliminate users of of_platform_{,un}register_driver dt/spi: Eliminate users of of_platform_{,un}register_driver dt: uartlite: merge platform and of_platform driver bindings dt: xilinx_hwicap: merge platform and of_platform driver bindings ipmi: convert OF driver to platform driver leds/leds-gpio: merge platform_driver with of_platform_driver dt/sparc: Eliminate users of of_platform_{,un}register_driver dt/powerpc: Eliminate users of of_platform_{,un}register_driver dt/powerpc: move of_bus_type infrastructure to ibmebus drivercore/dt: add a match table pointer to struct device dt: Typo fix. altera_ps2: Add devicetree support ...
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/mscan/mpc5xxx_can.c15
-rw-r--r--drivers/net/can/sja1000/sja1000_of_platform.c9
2 files changed, 13 insertions, 11 deletions
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 312b9c8f4f3b..c0a1bc5b1435 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,
247} 247}
248#endif /* CONFIG_PPC_MPC512x */ 248#endif /* CONFIG_PPC_MPC512x */
249 249
250static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev, 250static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
251 const struct of_device_id *id)
252{ 251{
253 struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data; 252 struct mpc5xxx_can_data *data;
254 struct device_node *np = ofdev->dev.of_node; 253 struct device_node *np = ofdev->dev.of_node;
255 struct net_device *dev; 254 struct net_device *dev;
256 struct mscan_priv *priv; 255 struct mscan_priv *priv;
@@ -259,6 +258,10 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev,
259 int irq, mscan_clksrc = 0; 258 int irq, mscan_clksrc = 0;
260 int err = -ENOMEM; 259 int err = -ENOMEM;
261 260
261 if (!ofdev->dev.of_match)
262 return -EINVAL;
263 data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data;
264
262 base = of_iomap(np, 0); 265 base = of_iomap(np, 0);
263 if (!base) { 266 if (!base) {
264 dev_err(&ofdev->dev, "couldn't ioremap\n"); 267 dev_err(&ofdev->dev, "couldn't ioremap\n");
@@ -391,7 +394,7 @@ static struct of_device_id __devinitdata mpc5xxx_can_table[] = {
391 {}, 394 {},
392}; 395};
393 396
394static struct of_platform_driver mpc5xxx_can_driver = { 397static struct platform_driver mpc5xxx_can_driver = {
395 .driver = { 398 .driver = {
396 .name = "mpc5xxx_can", 399 .name = "mpc5xxx_can",
397 .owner = THIS_MODULE, 400 .owner = THIS_MODULE,
@@ -407,13 +410,13 @@ static struct of_platform_driver mpc5xxx_can_driver = {
407 410
408static int __init mpc5xxx_can_init(void) 411static int __init mpc5xxx_can_init(void)
409{ 412{
410 return of_register_platform_driver(&mpc5xxx_can_driver); 413 return platform_driver_register(&mpc5xxx_can_driver);
411} 414}
412module_init(mpc5xxx_can_init); 415module_init(mpc5xxx_can_init);
413 416
414static void __exit mpc5xxx_can_exit(void) 417static void __exit mpc5xxx_can_exit(void)
415{ 418{
416 return of_unregister_platform_driver(&mpc5xxx_can_driver); 419 platform_driver_unregister(&mpc5xxx_can_driver);
417}; 420};
418module_exit(mpc5xxx_can_exit); 421module_exit(mpc5xxx_can_exit);
419 422
diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c
index 09c3e9db9316..9793df6e3455 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)
87 return 0; 87 return 0;
88} 88}
89 89
90static int __devinit sja1000_ofp_probe(struct platform_device *ofdev, 90static int __devinit sja1000_ofp_probe(struct platform_device *ofdev)
91 const struct of_device_id *id)
92{ 91{
93 struct device_node *np = ofdev->dev.of_node; 92 struct device_node *np = ofdev->dev.of_node;
94 struct net_device *dev; 93 struct net_device *dev;
@@ -210,7 +209,7 @@ static struct of_device_id __devinitdata sja1000_ofp_table[] = {
210}; 209};
211MODULE_DEVICE_TABLE(of, sja1000_ofp_table); 210MODULE_DEVICE_TABLE(of, sja1000_ofp_table);
212 211
213static struct of_platform_driver sja1000_ofp_driver = { 212static struct platform_driver sja1000_ofp_driver = {
214 .driver = { 213 .driver = {
215 .owner = THIS_MODULE, 214 .owner = THIS_MODULE,
216 .name = DRV_NAME, 215 .name = DRV_NAME,
@@ -222,12 +221,12 @@ static struct of_platform_driver sja1000_ofp_driver = {
222 221
223static int __init sja1000_ofp_init(void) 222static int __init sja1000_ofp_init(void)
224{ 223{
225 return of_register_platform_driver(&sja1000_ofp_driver); 224 return platform_driver_register(&sja1000_ofp_driver);
226} 225}
227module_init(sja1000_ofp_init); 226module_init(sja1000_ofp_init);
228 227
229static void __exit sja1000_ofp_exit(void) 228static void __exit sja1000_ofp_exit(void)
230{ 229{
231 return of_unregister_platform_driver(&sja1000_ofp_driver); 230 return platform_driver_unregister(&sja1000_ofp_driver);
232}; 231};
233module_exit(sja1000_ofp_exit); 232module_exit(sja1000_ofp_exit);