summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mpc.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-09-30 14:14:23 +0200
committerJean Delvare <khali@endymion.delvare>2010-09-30 14:14:23 +0200
commit925bb9c649cf8d7200549b395f2ae291833dd494 (patch)
treed784277831b7ae02d63d277dbacb0a73609d8661 /drivers/i2c/busses/i2c-mpc.c
parent64b4782fc9e4bdc59ae90897e2258e4ec938690e (diff)
downloadblackbird-op-linux-925bb9c649cf8d7200549b395f2ae291833dd494.tar.gz
blackbird-op-linux-925bb9c649cf8d7200549b395f2ae291833dd494.zip
of/i2c: Fix module load order issue caused by of_i2c.c
Commit 959e85f7, "i2c: add OF-style registration and binding" caused a module dependency loop where of_i2c.c calls functions in i2c-core, and i2c-core calls of_i2c_register_devices() in of_i2c. This means that when i2c support is built as a module when CONFIG_OF is set, then neither i2c_core nor of_i2c are able to be loaded. This patch fixes the problem by moving the of_i2c_register_devices() calls back into the device drivers. Device drivers already specifically request the core code to parse the device tree for devices anyway by setting the of_node pointer, so it isn't a big deal to also call the registration function. The drivers just become slightly more verbose. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-mpc.c')
-rw-r--r--drivers/i2c/busses/i2c-mpc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index a1c419a716af..b74e6dc6886c 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -632,6 +632,7 @@ static int __devinit fsl_i2c_probe(struct platform_device *op,
dev_err(i2c->dev, "failed to add adapter\n");
goto fail_add;
}
+ of_i2c_register_devices(&i2c->adap);
return result;
OpenPOWER on IntegriCloud