Skip to content

Commit

Permalink
i2c-pxa: Support new-style I2C drivers
Browse files Browse the repository at this point in the history
Signed-off-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Rodolfo Giometti authored and Jean Delvare committed Jul 12, 2007
1 parent 4d6ceed commit 066af98
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/i2c/busses/i2c-pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
i2c->adap.class = plat->class;
}

ret = i2c_add_adapter(&i2c->adap);
/*
* If "dev->id" is negative we consider it as zero.
* The reason to do so is to avoid sysfs names that only make
* sense when there are multiple adapters.
*/
i2c->adap.nr = dev->id >= 0 ? dev->id : 0;

ret = i2c_add_numbered_adapter(&i2c->adap);
if (ret < 0) {
printk(KERN_INFO "I2C: Failed to add bus\n");
goto eadapt;
Expand Down

0 comments on commit 066af98

Please sign in to comment.