Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1147457pxv; Fri, 9 Jul 2021 19:31:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBB+y4anOMI5iOc1D3gCT1PQuKx8Y3RdxWxt2wZAk0uhR11muzE04RS6qQrO1OFmLXLctD X-Received: by 2002:a17:907:2d2a:: with SMTP id gs42mr36118618ejc.371.1625884290330; Fri, 09 Jul 2021 19:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884290; cv=none; d=google.com; s=arc-20160816; b=fi7pRSEYI3GmSOHNcTlcqOHuLW5ktIgiX76jJqo+g0VCtM65iK2+JJQwQJVlAs0e9S qgi/oCq6zUYbP7wtRk/abRURzYiSs5FyUSfqENrxvSxnlYm0w8Etwf986uU9PReptjuG YRMmJ6BApl+umOtm+BfZp1lsmNpKO/GcGaSP+RyFmJ1HyTPOC5XvYM2bGv7dB0dP/M9J ukFliAd2wxP+o2BOHX5lXFPnVP06+7xuSetrFKkJbwCXA65yoRwCe4yy6G557ad8OyXr 3xy4JiMMPTrfnmcm6Oa+4SRRTuM7Hlb1fnIWb3T9Jv56SnEe2IPvWw++AgaFGIaDLXHB jcuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yIRm+WFsM5kCPwHasJJrp4dX9iz+zZtGsrKCBIr+lFU=; b=Ti4JgK9DYnXIBoPOrI7KcpPyH22FNIfYOqTLMJNREl6Z3VDRmKzvcp2pDTdMoU0qsi goLoS+4BMPGx9j6MtCtK6iY0WUmM/bPA2b0l91mPMs55Ioag1mGx1xeDypX8w8WrJ9ta T2woN965gXBnX0Xe0bGb5KlDx9OUTCHXDaHofgMjVH2eF1R9iFqbkH2YBcl+rzlYznlW Lqn450/gTQfc7ymZoqx+6hI++1FivmX6E/hPYzaBIwiRMyhagELiMlmLpz7OPnByF/8t CIvFLkol6cuJUMne0YyYGGyFBouB6GQO/Yj7oo7L+ocirxEfX/Ps2LKZY7zFQ9HN635v FEnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYPlpj7F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si9748431edo.404.2021.07.09.19.31.07; Fri, 09 Jul 2021 19:31:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYPlpj7F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233978AbhGJCay (ORCPT + 99 others); Fri, 9 Jul 2021 22:30:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:42926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233969AbhGJC2G (ORCPT ); Fri, 9 Jul 2021 22:28:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 83ECA61413; Sat, 10 Jul 2021 02:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883897; bh=O9+YOua0G9KnyA2M8OLH87WPhPFNQl5D35Y7gWGQ2s4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oYPlpj7FZUOeJO5SAraCWxPnjgrhshiBwmA21+bZflvo5pFtd5ZP0Mj08tmpKLEMX ScxhztHACFiApp/3IQ/teks8R2QZglYHsl9E4RNU4JxH40YvE6K2ZUTtzxAfXLDA3g CmMxm/pJbWBKJHrIP9uAx8+JuLk+ypmcOZKepB/lTIDSdOjLaenEkHaTEy1dsgefAX m5ZJulaqHn7tqLYpCsL6MITUDEooXxeXr0vlD3AvCuvsDI4Ia3WEG0xG56z2B1x99A LY1k2EJXtbwt93eieqK2jboTbkKmaw5883Yp/vqHnJjOE1WXQNikBcnT3TZkNyOIqB Lwys+O2ceqbRQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luiz Sampaio , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 5.10 21/93] w1: ds2438: fixing bug that would always get page0 Date: Fri, 9 Jul 2021 22:23:15 -0400 Message-Id: <20210710022428.3169839-21-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luiz Sampaio [ 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 Link: https://lore.kernel.org/r/20210519223046.13798-5-sampaio.ime@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 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); -- 2.30.2