of/i2c: Generalize OF support
This patch cleans up the i2c OF support code to make it selectable by
all architectures and allow for automatic registration of i2c devices.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index b02b453..03ae62e 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -652,6 +652,7 @@
cpm->adap = cpm_ops;
i2c_set_adapdata(&cpm->adap, cpm);
cpm->adap.dev.parent = &ofdev->dev;
+ cpm->adap.dev.of_node = of_node_get(ofdev->dev.of_node);
result = cpm_i2c_setup(cpm);
if (result) {
@@ -679,7 +680,7 @@
/*
* register OF I2C devices
*/
- of_register_i2c_devices(&cpm->adap, ofdev->dev.of_node);
+ of_i2c_register_devices(&cpm->adap);
return 0;
out_shut: