summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2009-11-04 15:23:37 -0700
committerGrant Likely <grant.likely@secretlab.ca>2009-11-04 15:23:37 -0700
commitad6577629acf8a3f47165248ca7ccc0d94673ada (patch)
tree7cdc5c7d4bccf93d1479e5ef8b2595f64a53e93f /drivers/spi
parentb419148e567728f6af0c3b01965c1cc141e3e13a (diff)
downloadblackbird-op-linux-ad6577629acf8a3f47165248ca7ccc0d94673ada.tar.gz
blackbird-op-linux-ad6577629acf8a3f47165248ca7ccc0d94673ada.zip
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 @@
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/of_platform.h>
+#include <linux/of_spi.h>
#include <linux/workqueue.h>
#include <linux/completion.h>
#include <linux/io.h>
@@ -464,6 +465,7 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op,
const u32 *regaddr_p;
u64 regaddr64, size64;
s16 id = -1;
+ int rc;
regaddr_p = of_get_address(op->node, 0, &size64, NULL);
if (!regaddr_p) {
@@ -485,8 +487,12 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op,
id = *psc_nump + 1;
}
- return mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64,
+ rc = mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64,
irq_of_parse_and_map(op->node, 0), id);
+ if (rc == 0)
+ of_register_spi_devices(dev_get_drvdata(&op->dev), op->node);
+
+ return rc;
}
static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op)
OpenPOWER on IntegriCloud