From 4e5eb7ef73c4c45e2e621eb51a76565153b63afe Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 31 Jul 2023 17:09:30 +0300 Subject: rtc: pcf2127: fix error code in pcf2127_enable_ts() This error path accidentally returns success. Return -EINVAL instead. Fixes: 420cc9e850db ("rtc: pcf2127: add support for multiple TS functions") Signed-off-by: Dan Carpenter Reviewed-by: Bruno Thomsen Reviewed-by: Hugo Villeneuve Reviewed-by: Hugo Villeneuve Link: https://lore.kernel.org/r/55b9c84b-9d21-444f-b91a-cf9316b65833@moroto.mountain Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-pcf2127.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c index 78141bb06ab0..988cad171174 100644 --- a/drivers/rtc/rtc-pcf2127.c +++ b/drivers/rtc/rtc-pcf2127.c @@ -1060,7 +1060,7 @@ static int pcf2127_enable_ts(struct device *dev, int ts_id) if (pcf2127->cfg->ts[ts_id].gnd_detect_bit == 0) { dev_err(dev, "%s: tamper detection to GND configuration invalid\n", __func__); - return ret; + return -EINVAL; } /* -- cgit v1.2.3