diff options
author | Ben Gardner <gardner.ben@gmail.com> | 2006-07-01 11:22:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-07-12 18:43:07 -0400 |
commit | 50436a47c6b10c6e4e84e24ea44c5cb85bbcd290 (patch) | |
tree | 5271b0ec88589406debc578148f946da82f8aca4 /drivers/i2c | |
parent | 5313775f18f22f1dac2b548b598d47d65f90e6b0 (diff) |
[PATCH] pca9539: Honor the force parameter
The pca9539 driver doesn't honor the force parameter; it always does
detection. This patch will skip detection if forced.
Signed-off-by: Ben Gardner <gardner.ben@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/chips/pca9539.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/i2c/chips/pca9539.c b/drivers/i2c/chips/pca9539.c index 54b6e6a4beed..cb22280cdd27 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) | |||
134 | new_client->driver = &pca9539_driver; | 134 | new_client->driver = &pca9539_driver; |
135 | new_client->flags = 0; | 135 | new_client->flags = 0; |
136 | 136 | ||
137 | /* Detection: the pca9539 only has 8 registers (0-7). | 137 | if (kind < 0) { |
138 | A read of 7 should succeed, but a read of 8 should fail. */ | 138 | /* Detection: the pca9539 only has 8 registers (0-7). |
139 | if ((i2c_smbus_read_byte_data(new_client, 7) < 0) || | 139 | A read of 7 should succeed, but a read of 8 should fail. */ |
140 | (i2c_smbus_read_byte_data(new_client, 8) >= 0)) | 140 | if ((i2c_smbus_read_byte_data(new_client, 7) < 0) || |
141 | goto exit_kfree; | 141 | (i2c_smbus_read_byte_data(new_client, 8) >= 0)) |
142 | goto exit_kfree; | ||
143 | } | ||
142 | 144 | ||
143 | strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE); | 145 | strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE); |
144 | 146 | ||