diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-09-09 16:29:13 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2007-09-09 16:29:13 -0400 |
commit | 51e5709ad46127da9476f31336113b5401f94dba (patch) | |
tree | b5ac346545ef80576843143108060125f9c6bbd2 /drivers | |
parent | 9a3180e70e35ff69586ada5421b5e7bad52f60e4 (diff) |
i2c-pxa: Fix adapter number
It turns out that platform_device.id is a "u32" so testing it for being
nonnegative is useless when setting up an i2c adapte. Instead,
do what the platform_bus code does and test it against the value "-1".
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 9d6b790d4321..bb5466b27b59 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -926,7 +926,7 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
926 | * The reason to do so is to avoid sysfs names that only make | 926 | * The reason to do so is to avoid sysfs names that only make |
927 | * sense when there are multiple adapters. | 927 | * sense when there are multiple adapters. |
928 | */ | 928 | */ |
929 | i2c->adap.nr = dev->id >= 0 ? dev->id : 0; | 929 | i2c->adap.nr = dev->id != -1 ? dev->id : 0; |
930 | 930 | ||
931 | ret = i2c_add_numbered_adapter(&i2c->adap); | 931 | ret = i2c_add_numbered_adapter(&i2c->adap); |
932 | if (ret < 0) { | 932 | if (ret < 0) { |