From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CFFF1F953 for ; Tue, 1 Aug 2023 09:27:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B68DEC433C9; Tue, 1 Aug 2023 09:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690882068; bh=uGvdWJCsFNbf5m4VfhCqMqS0rCknEsFqq072qKtJ14I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T0bW3EzS69dtejm9moQh2tizugJe75xLW4xFLQy1zxi1fqDVqrZOvRxfeQSoFH5Nl ag6ZqifBKZOikuIec3+FV6HGdTSGuztCTxmnZqW+o/SKyAFgdP5kBg+e0YXwRLfrhm Cl89ZnrqJE7gCH6iaYgXPcrCp8CcABxXbfL7Notg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gilles Buloz , Guenter Roeck Subject: [PATCH 5.15 130/155] hwmon: (nct7802) Fix for temp6 (PECI1) processed even if PECI1 disabled Date: Tue, 1 Aug 2023 11:20:42 +0200 Message-ID: <20230801091914.824675703@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801091910.165050260@linuxfoundation.org> References: <20230801091910.165050260@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Gilles Buloz commit 54685abe660a59402344d5045ce08c43c6a5ac42 upstream. Because of hex value 0x46 used instead of decimal 46, the temp6 (PECI1) temperature is always declared visible and then displayed even if disabled in the chip Signed-off-by: Gilles Buloz Link: https://lore.kernel.org/r/DU0PR10MB62526435ADBC6A85243B90E08002A@DU0PR10MB6252.EURPRD10.PROD.OUTLOOK.COM Fixes: fcdc5739dce03 ("hwmon: (nct7802) add temperature sensor type attribute") Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/nct7802.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/hwmon/nct7802.c +++ b/drivers/hwmon/nct7802.c @@ -708,7 +708,7 @@ static umode_t nct7802_temp_is_visible(s if (index >= 38 && index < 46 && !(reg & 0x01)) /* PECI 0 */ return 0; - if (index >= 0x46 && (!(reg & 0x02))) /* PECI 1 */ + if (index >= 46 && !(reg & 0x02)) /* PECI 1 */ return 0; return attr->mode;