aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo Giometti <giometti@enneenne.com>2007-07-12 08:12:30 -0400
committerJean Delvare <khali@hyperion.delvare>2007-07-12 08:12:30 -0400
commit066af983c74162fa98e7c5ffa8a5ead4a6979b1f (patch)
tree175db335af8519db99b0c303f9906760161ee35f
parent4d6ceed4426cd85e1203a3153246334a3537f92b (diff)
i2c-pxa: Support new-style I2C drivers
Signed-off-by: Rodolfo Giometti <giometti@linux.it> Signed-off-by: Jean Delvare <khali@linux-fr.org>
-rw-r--r--drivers/i2c/busses/i2c-pxa.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 28e7b91a4553..9d6b790d4321 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -921,7 +921,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
921 i2c->adap.class = plat->class; 921 i2c->adap.class = plat->class;
922 } 922 }
923 923
924 ret = i2c_add_adapter(&i2c->adap); 924 /*
925 * If "dev->id" is negative we consider it as zero.
926 * The reason to do so is to avoid sysfs names that only make
927 * sense when there are multiple adapters.
928 */
929 i2c->adap.nr = dev->id >= 0 ? dev->id : 0;
930
931 ret = i2c_add_numbered_adapter(&i2c->adap);
925 if (ret < 0) { 932 if (ret < 0) {
926 printk(KERN_INFO "I2C: Failed to add bus\n"); 933 printk(KERN_INFO "I2C: Failed to add bus\n");
927 goto eadapt; 934 goto eadapt;