From 8c099cd381aa36373593d4efc92493c1345c73da Mon Sep 17 00:00:00 2001 From: Camel Guo Date: Mon, 25 Apr 2022 12:00:19 +0200 Subject: [PATCH] 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. Signed-off-by: Camel Guo Link: https://lore.kernel.org/r/20220425100019.562781-1-camel.guo@axis.com Signed-off-by: Guenter Roeck --- 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 63e53c8..cc0a1c2 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.7.4