X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fi2c%2Fbusses%2Fi2c-gpio.c;h=3ca19fc234fb45122be765f517288aa419b3d516;hb=bed04a4413376265746053be2a9cfbfc80c98ec9;hp=025f19423faffee0df8e88cabf67d630e48cc52f;hpb=c2dc1ad582196208a2f990eb0230eb922046c684;p=linux-2.6-omap-h63xx.git diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index 025f19423fa..3ca19fc234f 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c @@ -140,6 +140,7 @@ static int __init i2c_gpio_probe(struct platform_device *pdev) adap->owner = THIS_MODULE; snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id); adap->algo_data = bit_data; + adap->class = I2C_CLASS_HWMON; adap->dev.parent = &pdev->dev; /* @@ -147,7 +148,7 @@ static int __init i2c_gpio_probe(struct platform_device *pdev) * 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; + adap->nr = (pdev->id != -1) ? pdev->id : 0; ret = i2c_bit_add_numbered_bus(adap); if (ret) goto err_add_bus;