summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2007-07-12 14:12:29 +0200
committerJean Delvare <khali@hyperion.delvare>2007-07-12 14:12:29 +0200
commit1469fa263870acd890a4b9f6ef557acc5d673b44 (patch)
tree4be6e9ac5a5d30db7b4a446ae101cd6010b38470
parent65b22ad9508b609b0625eccb2680996a1e09ed16 (diff)
i2c-mpc: Use i2c_add_numbered_adapter
Move the i2c-mpc driver over to using the new i2c infrastructure. Specifically, it now uses i2c_add_numbered_adapter so that the bus number can be determined ahead of time and used to register i2c clients before the bus is instantiated. Tested on an MPC5200 based board Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Jean Delvare <khali@linux-fr.org>
-rw-r--r--drivers/i2c/busses/i2c-mpc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index c6b6898592b1..a769efc7f408 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -327,9 +327,10 @@ static int fsl_i2c_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, i2c);
i2c->adap = mpc_ops;
+ i2c->adap.nr = pdev->id;
i2c_set_adapdata(&i2c->adap, i2c);
i2c->adap.dev.parent = &pdev->dev;
- if ((result = i2c_add_adapter(&i2c->adap)) < 0) {
+ if ((result = i2c_add_numbered_adapter(&i2c->adap)) < 0) {
printk(KERN_ERR "i2c-mpc - failed to add adapter\n");
goto fail_add;
}