* [PATCH] hwmon: (tmp401) Fix incorrect return value of tmp401_init_client
@ 2022-04-25 10:00 Camel Guo
2022-04-25 18:19 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Camel Guo @ 2022-04-25 10:00 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare; +Cc: Camel Guo, linux-hwmon, linux-kernel, kernel
When ti,n-factor, ti,beta-compentation are not defined in devicetree,
of_property_read_u32|s32 returns -EINVAL. In this case,
tmp401_init_client should return 0 instead of simply pass ret to its
caller.
Fixes: c825ca044988 ("hwmon: (tmp401) Add support of three advanced features")
Signed-off-by: Camel Guo <camel.guo@axis.com>
---
drivers/hwmon/tmp401.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index 8f49da997367..a58a2f31a07e 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -604,7 +604,7 @@ static int tmp401_init_client(struct tmp401_data *data)
return ret;
}
- return ret;
+ return 0;
}
static int tmp401_detect(struct i2c_client *client,
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwmon: (tmp401) Fix incorrect return value of tmp401_init_client
2022-04-25 10:00 [PATCH] hwmon: (tmp401) Fix incorrect return value of tmp401_init_client Camel Guo
@ 2022-04-25 18:19 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-04-25 18:19 UTC (permalink / raw)
To: Camel Guo; +Cc: Jean Delvare, linux-hwmon, linux-kernel, kernel
On Mon, Apr 25, 2022 at 12:00:19PM +0200, Camel Guo wrote:
> When ti,n-factor, ti,beta-compentation are not defined in devicetree,
> of_property_read_u32|s32 returns -EINVAL. In this case,
> tmp401_init_client should return 0 instead of simply pass ret to its
> caller.
>
> Fixes: c825ca044988 ("hwmon: (tmp401) Add support of three advanced features")
> Signed-off-by: Camel Guo <camel.guo@axis.com>
Good catch. Thanks, applied.
Guenter
> ---
> drivers/hwmon/tmp401.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
> index 8f49da997367..a58a2f31a07e 100644
> --- a/drivers/hwmon/tmp401.c
> +++ b/drivers/hwmon/tmp401.c
> @@ -604,7 +604,7 @@ static int tmp401_init_client(struct tmp401_data *data)
> return ret;
> }
>
> - return ret;
> + return 0;
> }
>
> static int tmp401_detect(struct i2c_client *client,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-25 18:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 10:00 [PATCH] hwmon: (tmp401) Fix incorrect return value of tmp401_init_client Camel Guo
2022-04-25 18:19 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.