aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGanesan Ramalingam <ganesanr@broadcom.com>2012-05-08 09:25:28 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-05-12 10:49:54 -0400
commita5063f16e2963c5d5b54692fb2da2e327162da78 (patch)
tree3a9ed8fd8c03f0383202b0b7f3b4417e1e8a1040
parentc889e91d2cc22123f20f40dde0c0a91856a20eea (diff)
i2c: ocores: register OF i2c devices
Call of_i2c_register_devices() in probe function to register i2c devices specified in the device tree or OF. Signed-off-by: Ganesan Ramalingam <ganesanr@broadcom.com> Signed-off-by: Jayachandran C <jayachandranc@netlogicmicro.com> [wsa: add proper braces] Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
-rw-r--r--drivers/i2c/busses/i2c-ocores.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index 18068dee48f1..75194c579b6d 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -55,6 +55,7 @@
55#include <linux/i2c-ocores.h> 55#include <linux/i2c-ocores.h>
56#include <linux/slab.h> 56#include <linux/slab.h>
57#include <linux/io.h> 57#include <linux/io.h>
58#include <linux/of_i2c.h>
58 59
59struct ocores_i2c { 60struct ocores_i2c {
60 void __iomem *base; 61 void __iomem *base;
@@ -343,6 +344,8 @@ static int __devinit ocores_i2c_probe(struct platform_device *pdev)
343 if (pdata) { 344 if (pdata) {
344 for (i = 0; i < pdata->num_devices; i++) 345 for (i = 0; i < pdata->num_devices; i++)
345 i2c_new_device(&i2c->adap, pdata->devices + i); 346 i2c_new_device(&i2c->adap, pdata->devices + i);
347 } else {
348 of_i2c_register_devices(&i2c->adap);
346 } 349 }
347 350
348 return 0; 351 return 0;