diff options
author | Barry Song <Baohua.Song@csr.com> | 2012-12-25 21:30:16 -0500 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2013-01-22 03:54:31 -0500 |
commit | bfd059da9503e0091541285cb0481f66b95c0296 (patch) | |
tree | 6a495b89b5c57467774421f4116a505c297da7e3 /drivers | |
parent | 0f40cbc4f85e13b1a42ae2f41231645a14965872 (diff) |
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')
-rw-r--r-- | drivers/i2c/busses/i2c-sirf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c index 3f1818b87974..e03381aee34f 100644 --- a/drivers/i2c/busses/i2c-sirf.c +++ b/drivers/i2c/busses/i2c-sirf.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
15 | #include <linux/of_i2c.h> | ||
15 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
16 | #include <linux/err.h> | 17 | #include <linux/err.h> |
17 | #include <linux/io.h> | 18 | #include <linux/io.h> |
@@ -328,6 +329,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev) | |||
328 | adap->algo = &i2c_sirfsoc_algo; | 329 | adap->algo = &i2c_sirfsoc_algo; |
329 | adap->algo_data = siic; | 330 | adap->algo_data = siic; |
330 | 331 | ||
332 | adap->dev.of_node = pdev->dev.of_node; | ||
331 | adap->dev.parent = &pdev->dev; | 333 | adap->dev.parent = &pdev->dev; |
332 | adap->nr = pdev->id; | 334 | adap->nr = pdev->id; |
333 | 335 | ||
@@ -371,6 +373,8 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev) | |||
371 | 373 | ||
372 | clk_disable(clk); | 374 | clk_disable(clk); |
373 | 375 | ||
376 | of_i2c_register_devices(adap); | ||
377 | |||
374 | dev_info(&pdev->dev, " I2C adapter ready to operate\n"); | 378 | dev_info(&pdev->dev, " I2C adapter ready to operate\n"); |
375 | 379 | ||
376 | return 0; | 380 | return 0; |