i2c: ocores: register OF i2c devices
authorGanesan Ramalingam <ganesanr@broadcom.com>
Tue, 8 May 2012 13:25:28 +0000 (18:55 +0530)
committerWolfram Sang <w.sang@pengutronix.de>
Sat, 12 May 2012 14:49:54 +0000 (16:49 +0200)
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>
drivers/i2c/busses/i2c-ocores.c

index 18068dee48f1aa11543413894485e4916bfc5811..75194c579b6d78f419f8886de4d028a2447e08a4 100644 (file)
@@ -55,6 +55,7 @@
 #include <linux/i2c-ocores.h>
 #include <linux/slab.h>
 #include <linux/io.h>
+#include <linux/of_i2c.h>
 
 struct ocores_i2c {
        void __iomem *base;
@@ -343,6 +344,8 @@ static int __devinit ocores_i2c_probe(struct platform_device *pdev)
        if (pdata) {
                for (i = 0; i < pdata->num_devices; i++)
                        i2c_new_device(&i2c->adap, pdata->devices + i);
+       } else {
+               of_i2c_register_devices(&i2c->adap);
        }
 
        return 0;
This page took 0.027023 seconds and 5 git commands to generate.