* [PATCH] hwmon: (ad7414) Return proper error code for ad7414_probe()
@ 2010-11-09 1:40 Axel Lin
2010-11-09 2:41 ` Sean MacLennan
2010-11-09 2:44 ` [lm-sensors] " Guenter Roeck
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2010-11-09 1:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Jean Delvare, Sean MacLennan, lm-sensors
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>
---
drivers/hwmon/ad7414.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/ad7414.c b/drivers/hwmon/ad7414.c
index 1e4c21f..86d822a 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) {
--
1.7.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] hwmon: (ad7414) Return proper error code for ad7414_probe()
2010-11-09 1:40 [PATCH] hwmon: (ad7414) Return proper error code for ad7414_probe() Axel Lin
@ 2010-11-09 2:41 ` Sean MacLennan
2010-11-09 2:44 ` [lm-sensors] " Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Sean MacLennan @ 2010-11-09 2:41 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Jean Delvare, lm-sensors
On Mon, 8 Nov 2010 20:40:34 -0500
"Axel Lin" <axel.lin@gmail.com> wrote:
> [PATCH] 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>
> ---
> drivers/hwmon/ad7414.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwmon/ad7414.c b/drivers/hwmon/ad7414.c
> index 1e4c21f..86d822a 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;
I wouldn't mind if this was "int conf, err;", but I don't mind the way
it is.
Cheers,
Sean
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [lm-sensors] [PATCH] hwmon: (ad7414) Return proper error code for ad7414_probe()
2010-11-09 1:40 [PATCH] hwmon: (ad7414) Return proper error code for ad7414_probe() Axel Lin
2010-11-09 2:41 ` Sean MacLennan
@ 2010-11-09 2:44 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2010-11-09 2:44 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, lm-sensors@lm-sensors.org, Sean MacLennan
On Mon, Nov 08, 2010 at 08:40:34PM -0500, Axel Lin wrote:
> 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>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-09 2:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09 1:40 [PATCH] hwmon: (ad7414) Return proper error code for ad7414_probe() Axel Lin
2010-11-09 2:41 ` Sean MacLennan
2010-11-09 2:44 ` [lm-sensors] " Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox