aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2009-11-04 17:23:37 -0500
committerGrant Likely <grant.likely@secretlab.ca>2009-11-04 17:23:37 -0500
commitad6577629acf8a3f47165248ca7ccc0d94673ada (patch)
tree7cdc5c7d4bccf93d1479e5ef8b2595f64a53e93f /drivers/spi
parentb419148e567728f6af0c3b01965c1cc141e3e13a (diff)
spi/mpc5200: Register SPI devices described in device tree
Add call to of_register_spi_devices() to register SPI devices described in the OF device tree. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index 1b74d5ca03f3..a14e9fdc0065 100644
--- a/drivers/spi/mpc52xx_psc_spi.c
+++ b/drivers/spi/mpc52xx_psc_spi.c
@@ -17,6 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#include <linux/of_spi.h>
20#include <linux/workqueue.h> 21#include <linux/workqueue.h>
21#include <linux/completion.h> 22#include <linux/completion.h>
22#include <linux/io.h> 23#include <linux/io.h>
@@ -464,6 +465,7 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op,
464 const u32 *regaddr_p; 465 const u32 *regaddr_p;
465 u64 regaddr64, size64; 466 u64 regaddr64, size64;
466 s16 id = -1; 467 s16 id = -1;
468 int rc;
467 469
468 regaddr_p = of_get_address(op->node, 0, &size64, NULL); 470 regaddr_p = of_get_address(op->node, 0, &size64, NULL);
469 if (!regaddr_p) { 471 if (!regaddr_p) {
@@ -485,8 +487,12 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op,
485 id = *psc_nump + 1; 487 id = *psc_nump + 1;
486 } 488 }
487 489
488 return mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64, 490 rc = mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64,
489 irq_of_parse_and_map(op->node, 0), id); 491 irq_of_parse_and_map(op->node, 0), id);
492 if (rc == 0)
493 of_register_spi_devices(dev_get_drvdata(&op->dev), op->node);
494
495 return rc;
490} 496}
491 497
492static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op) 498static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op)