From: Axel Lin Date: Tue, 9 Nov 2010 01:40:34 +0000 (-0500) Subject: hwmon: (ad7414) Return proper error code for ad7414_probe() X-Git-Tag: MMI-PSA29.97-13-9~21775^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f0030d87be3cb2eb9eac633d09cb5d9f107ed0c6;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Acked-by: Sean MacLennan Signed-off-by: Guenter Roeck --- 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, { struct ad7414_data *data; int conf; - int err = 0; + int err; if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA | - I2C_FUNC_SMBUS_READ_WORD_DATA)) + I2C_FUNC_SMBUS_READ_WORD_DATA)) { + err = -EOPNOTSUPP; goto exit; + } data = kzalloc(sizeof(struct ad7414_data), GFP_KERNEL); if (!data) {