Skip to content

Commit

Permalink
hwmon: (nct7802) Fix for temp6 (PECI1) processed even if PECI1 disabled
Browse files Browse the repository at this point in the history
commit 54685ab 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 <gilles.buloz@kontron.com>
Link: https://lore.kernel.org/r/DU0PR10MB62526435ADBC6A85243B90E08002A@DU0PR10MB6252.EURPRD10.PROD.OUTLOOK.COM
Fixes: fcdc573 ("hwmon: (nct7802) add temperature sensor type attribute")
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
gbuloz authored and gregkh committed Aug 3, 2023
1 parent c6790a9 commit 7665493
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/nct7802.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ static umode_t nct7802_temp_is_visible(struct kobject *kobj,
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;
Expand Down

0 comments on commit 7665493

Please sign in to comment.