Commit bfd059da authored by Barry Song's avatar Barry Song Committed by Wolfram Sang

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: default avatarBarry Song <Baohua.Song@csr.com>
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
parent 0f40cbc4
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment