mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
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>
This commit is contained in:
parent
0f40cbc4f8
commit
bfd059da95
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user