hwmon: (ad7414) Return proper error code for ad7414_probe()
PATCH 1/1 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.
--- drivers/hwmon/ad7414.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/ad7414.c +4 -2
@@ -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) {
Signature · 1 line
1.7.2
Quoted 8 lines · On Mon, 8 Nov 2010 20:40:34 -0500 "Axel Lin" <[email protected]> wrote:
[PATCH] hwmon: (ad7414) Return proper error code for
ad7414_probe()Return proper error if
i2c_check_functionalityreports the adapter does not support the capability we need.Also remove unneeded initialization for err variable.
Signed-off-by Axel Lin <[email protected]>
Quoted 9 lines
--- drivers/hwmon/ad7414.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)drivers/hwmon/ad7414.c +0
-0
drivers/hwmon/ad7414.c static int ad7414_probe(struct i2c_client · line 181
Quoted 5 lines
drivers/hwmon/ad7414.c +1
-1@@ -178,11 +178,13 @@ static int ad7414_probe(struct i2c_client *client, {struct ad7414_data *data;int conf; -int err =0 ; +int err;
I wouldn't mind if this was "int conf, err;", but I don't mind the way it is.
Cheers,
Sean
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
AppliedQuoted 6 lines · Axel Lin
Return proper error if
i2c_check_functionalityreports the adapter does not support the capability we need.Also remove unneeded initialization for err variable.
Signed-off-by Axel Lin <[email protected]>
Applied.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors