[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210323024306.r3xwrzhckfgtsp64@LuizSampaio-PC.localdomain>
Date: Mon, 22 Mar 2021 23:43:06 -0300
From: Luiz Sampaio <sampaio.ime@...il.com>
To: zbr@...emap.net
Cc: rikard.falkeborn@...il.com, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] w1: ds2438: fixed bug in get_page function
The get_page function always returned register values from page 0.
Fixes by writing the actual page number to the bus.
Signed-off-by: Luiz Sampaio <sampaio.ime@...il.com>
---
drivers/w1/slaves/w1_ds2438.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index a9884fc8c726..08f4b451c349 100644
--- a/drivers/w1/slaves/w1_ds2438.c
+++ b/drivers/w1/slaves/w1_ds2438.c
@@ -62,13 +62,13 @@ static int w1_ds2438_get_page(struct w1_slave *sl, int pageno, u8 *buf)
if (w1_reset_select_slave(sl))
continue;
w1_buf[0] = W1_DS2438_RECALL_MEMORY;
- w1_buf[1] = 0x00;
+ w1_buf[1] = pageno;
w1_write_block(sl->master, w1_buf, 2);
if (w1_reset_select_slave(sl))
continue;
w1_buf[0] = W1_DS2438_READ_SCRATCH;
- w1_buf[1] = 0x00;
+ w1_buf[1] = pageno;
w1_write_block(sl->master, w1_buf, 2);
count = w1_read_block(sl->master, buf, DS2438_PAGE_SIZE + 1);
--
2.30.1
Powered by blists - more mailing lists