aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-pxa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-pxa.c')
-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;