rtc: pcf2127: fix error code in pcf2127_enable_ts()
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 31 Jul 2023 14:09:30 +0000 (17:09 +0300)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 16 Aug 2023 22:58:35 +0000 (00:58 +0200)
This error path accidentally returns success.  Return -EINVAL instead.

Fixes: 420cc9e850db ("rtc: pcf2127: add support for multiple TS functions")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Reviewed-by: Hugo Villeneuve <hugo@hugovil.com>
Reviewed-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/55b9c84b-9d21-444f-b91a-cf9316b65833@moroto.mountain
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-pcf2127.c

index 78141bb..988cad1 100644 (file)
@@ -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;
        }
 
        /*