[i2c] [patch 2.6.19-rc6 10/11] i2c-omap uses i2c_register_adapter()
David Brownell
david-b at pacbell.net
Sun Nov 26 00:04:11 CET 2006
Make the OMAP I2C driver use the new i2c_register_adapter() call,
ensuring that the adapters use bus numbers matching the hardware.
(Plus minor driver shrinkage; those probe messages are only useful
when porting to new silicon.)
Signed-off-by: David Brownell <dbrownell at users.sourceforge.net>
---
drivers/i2c/busses/i2c-omap.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
Index: at91/drivers/i2c/busses/i2c-omap.c
===================================================================
--- at91.orig/drivers/i2c/busses/i2c-omap.c 2006-11-25 08:05:51.000000000 -0800
+++ at91/drivers/i2c/busses/i2c-omap.c 2006-11-25 08:06:07.000000000 -0800
@@ -589,7 +589,8 @@ omap_i2c_probe(struct platform_device *p
0, pdev->name, dev);
if (r) {
- dev_err(dev->dev, "failure requesting irq %i\n", dev->irq);
+ dev_dbg(dev->dev, "failure %d requesting irq %i\n",
+ r, dev->irq);
goto err_unuse_clocks;
}
r = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) & 0xff;
@@ -604,10 +605,11 @@ omap_i2c_probe(struct platform_device *p
adap->algo = &omap_i2c_algo;
adap->class_dev.dev = &pdev->dev;
- /* i2c device drivers may be active on return from add_adapter() */
- r = i2c_add_adapter(adap);
+ /* i2c device drivers may be active on return from register_adapter() */
+ adap->nr = pdev->id;
+ r = i2c_register_adapter(adap);
if (r) {
- dev_err(dev->dev, "failure adding adapter\n");
+ dev_dbg(dev->dev, "failure %d registering adapter\n", r);
goto err_free_irq;
}
More information about the i2c
mailing list