aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-11-08 20:40:34 -0500
committerGuenter Roeck <guenter.roeck@ericsson.com>2010-11-11 12:32:07 -0500
commitf0030d87be3cb2eb9eac633d09cb5d9f107ed0c6 (patch)
treea75cfa0e336e81c5bfcbd958a98a153ec39c80d6 /drivers/hwmon
parentf7334b4ca9108a86b64fbd0f435f44b2113ee053 (diff)
hwmon: (ad7414) Return proper error code for ad7414_probe()
Return proper error if i2c_check_functionality reports the adapter does not support the capability we need. Also remove unneeded initialization for err variable. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sean MacLennan <smaclennan@pikatech.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/ad7414.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hwmon/ad7414.c b/drivers/hwmon/ad7414.c
index 1e4c21fc1a89..86d822aa9bbf 100644
--- a/drivers/hwmon/ad7414.c
+++ b/drivers/hwmon/ad7414.c
@@ -178,11 +178,13 @@ static int ad7414_probe(struct i2c_client *client,
178{ 178{
179 struct ad7414_data *data; 179 struct ad7414_data *data;
180 int conf; 180 int conf;
181 int err = 0; 181 int err;
182 182
183 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA | 183 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA |
184 I2C_FUNC_SMBUS_READ_WORD_DATA)) 184 I2C_FUNC_SMBUS_READ_WORD_DATA)) {
185 err = -EOPNOTSUPP;
185 goto exit; 186 goto exit;
187 }
186 188
187 data = kzalloc(sizeof(struct ad7414_data), GFP_KERNEL); 189 data = kzalloc(sizeof(struct ad7414_data), GFP_KERNEL);
188 if (!data) { 190 if (!data) {