hwmon: (tmp401) Fix incorrect return value of tmp401_init_client
PATCH 1/1 hwmon: (tmp401) Fix incorrect return value of tmp401_init_client
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 <[email protected]>
--- drivers/hwmon/tmp401.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/tmp401.c +1 -1
@@ -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,
Signature · 1 line
2.30.2
Guenter Roeck
maintainerQuoted 7 lines · Camel Guo
When ti,n-factor, ti,beta-compentation are not defined in devicetree, of_property_read_u32|s32 returns
-EINVAL. In this case,tmp401_init_clientshould 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 <[email protected]>
Good catch. Thanks, applied.
Guenter
Quoted 17 lines
--- drivers/hwmon/tmp401.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/tmp401.c +1
-1@@ -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,