summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-sirf.c
diff options
context:
space:
mode:
authorBarry Song <Baohua.Song@csr.com>2012-12-26 10:30:16 +0800
committerWolfram Sang <w.sang@pengutronix.de>2013-01-22 09:54:31 +0100
commitbfd059da9503e0091541285cb0481f66b95c0296 (patch)
tree6a495b89b5c57467774421f4116a505c297da7e3 /drivers/i2c/busses/i2c-sirf.c
parent0f40cbc4f85e13b1a42ae2f41231645a14965872 (diff)
downloadlinux-3.10-bfd059da9503e0091541285cb0481f66b95c0296.tar.gz
linux-3.10-bfd059da9503e0091541285cb0481f66b95c0296.tar.bz2
linux-3.10-bfd059da9503e0091541285cb0481f66b95c0296.zip
i2c: sirf: register i2c_client from dt child-nodes in probe entry
in probe() entry of i2c_driver, set the of node of adapter and call of_i2c_register_devices to register all i2c_client from dt child-nodes Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-sirf.c')
-rw-r--r--drivers/i2c/busses/i2c-sirf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 3f1818b8797..e03381aee34 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -12,6 +12,7 @@
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
+#include <linux/of_i2c.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
@@ -328,6 +329,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
adap->algo = &i2c_sirfsoc_algo;
adap->algo_data = siic;
+ adap->dev.of_node = pdev->dev.of_node;
adap->dev.parent = &pdev->dev;
adap->nr = pdev->id;
@@ -371,6 +373,8 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
clk_disable(clk);
+ of_i2c_register_devices(adap);
+
dev_info(&pdev->dev, " I2C adapter ready to operate\n");
return 0;