Patch "w1: ds2438: fixing bug that would always get page0" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    w1: ds2438: fixing bug that would always get page0

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     w1-ds2438-fixing-bug-that-would-always-get-page0.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 760e62348ecb1e1b5d5b33c70b6a20e67845a4af
Author: Luiz Sampaio <sampaio.ime@xxxxxxxxx>
Date:   Wed May 19 19:30:44 2021 -0300

    w1: ds2438: fixing bug that would always get page0
    
    [ Upstream commit 1f5e7518f063728aee0679c5086b92d8ea429e11 ]
    
    The purpose of the w1_ds2438_get_page function is to get the register
    values at the page passed as the pageno parameter. However, the page0 was
    hardcoded, such that the function always returned the page0 contents. Fixed
    so that the function can retrieve any page.
    
    Signed-off-by: Luiz Sampaio <sampaio.ime@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20210519223046.13798-5-sampaio.ime@xxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c
index 5cfb0ae23e91..5698566b0ee0 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] = (u8)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] = (u8)pageno;
 		w1_write_block(sl->master, w1_buf, 2);
 
 		count = w1_read_block(sl->master, buf, DS2438_PAGE_SIZE + 1);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux