[Letux-kernel] [PATCH 4/5] w1: omap-hdq: fix return value to be -1 if there is a timeout

H. Nikolaus Schaller hns at goldelico.com
Fri May 8 16:28:19 CEST 2020


omap_w1_read_byte() should return -1 (or 0xff) in case of
error.

could be squashed but is a completely independent bug.

Signed-off-by: H. Nikolaus Schaller <hns at goldelico.com>
---
 drivers/w1/masters/omap_hdq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 64fe32e74bed0..ffcd6630f00d1 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -486,7 +486,7 @@ static u8 omap_w1_read_byte(void *_hdq)
 
 	ret = hdq_read_byte(hdq_data, &val);
 	if (ret)
-		ret = -1;
+		val = -1;
 
 	pm_runtime_mark_last_busy(hdq_data->dev);
 	pm_runtime_put_autosuspend(hdq_data->dev);
-- 
2.26.2



More information about the Letux-kernel mailing list