diff options
| author | Steve French <sfrench@us.ibm.com> | 2007-07-19 00:38:57 +0000 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2007-07-19 00:38:57 +0000 |
| commit | 1ff8392c32a2645d2665ca779ecb91bb29361c13 (patch) | |
| tree | 860b95e9a499ade4060848740fc6ce1fbb4e4e8d /drivers/i2c/busses/i2c-gpio.c | |
| parent | 70b315b0dd3879cb3ab8aadffb14f10b2d19b9c3 (diff) | |
| parent | 5bae7ac9feba925fd0099057f6b23d7be80b7b41 (diff) | |
| download | lwn-1ff8392c32a2645d2665ca779ecb91bb29361c13.tar.gz lwn-1ff8392c32a2645d2665ca779ecb91bb29361c13.zip | |
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
fs/cifs/export.c
Diffstat (limited to 'drivers/i2c/busses/i2c-gpio.c')
| -rw-r--r-- | drivers/i2c/busses/i2c-gpio.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index a7dd54654a9a..025f19423faf 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c @@ -63,14 +63,14 @@ static void i2c_gpio_setscl_val(void *data, int state) gpio_set_value(pdata->scl_pin, state); } -int i2c_gpio_getsda(void *data) +static int i2c_gpio_getsda(void *data) { struct i2c_gpio_platform_data *pdata = data; return gpio_get_value(pdata->sda_pin); } -int i2c_gpio_getscl(void *data) +static int i2c_gpio_getscl(void *data) { struct i2c_gpio_platform_data *pdata = data; @@ -142,7 +142,13 @@ static int __init i2c_gpio_probe(struct platform_device *pdev) adap->algo_data = bit_data; adap->dev.parent = &pdev->dev; - ret = i2c_bit_add_bus(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. + */ + adap->nr = pdev->id >= 0 ? pdev->id : 0; + ret = i2c_bit_add_numbered_bus(adap); if (ret) goto err_add_bus; |
