X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fi2c%2Fchips%2Fpca9539.c;h=cb22280cdd277cb08c738abcc4064588413226a8;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=54b6e6a4beedcd5c9e8288caab01acfb90f8c0bb;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/drivers/i2c/chips/pca9539.c b/drivers/i2c/chips/pca9539.c index 54b6e6a4b..cb22280cd 100644 --- a/drivers/i2c/chips/pca9539.c +++ b/drivers/i2c/chips/pca9539.c @@ -134,11 +134,13 @@ static int pca9539_detect(struct i2c_adapter *adapter, int address, int kind) new_client->driver = &pca9539_driver; new_client->flags = 0; - /* Detection: the pca9539 only has 8 registers (0-7). - A read of 7 should succeed, but a read of 8 should fail. */ - if ((i2c_smbus_read_byte_data(new_client, 7) < 0) || - (i2c_smbus_read_byte_data(new_client, 8) >= 0)) - goto exit_kfree; + if (kind < 0) { + /* Detection: the pca9539 only has 8 registers (0-7). + A read of 7 should succeed, but a read of 8 should fail. */ + if ((i2c_smbus_read_byte_data(new_client, 7) < 0) || + (i2c_smbus_read_byte_data(new_client, 8) >= 0)) + goto exit_kfree; + } strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE);