summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-09-21 08:10:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-09-21 08:10:47 -0700
commitb300c0fdf0045ede109a349aa9c79f81bfae086a (patch)
tree954527ac5d9c127daff3f3a5bc9f9d5169beced3 /drivers
parent42dc814987c1feb6410904e58cfd4c36c4146150 (diff)
parent2dd1d862817b850787f4755c05d55e5aeb76dd08 (diff)
downloadlinux-stable-b300c0fdf0045ede109a349aa9c79f81bfae086a.tar.gz
linux-stable-b300c0fdf0045ede109a349aa9c79f81bfae086a.tar.bz2
linux-stable-b300c0fdf0045ede109a349aa9c79f81bfae086a.zip
Merge tag 'hwmon-for-v6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fix from Guenter Roeck: "One patch to drop a non-existent alarm attribute in the nct6775 driver" * tag 'hwmon-for-v6.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (nct6775) Fix non-existent ALARM warning
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/nct6775-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 02a71244fc3b..b5b81bd83bb1 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -1910,6 +1910,10 @@ static umode_t nct6775_in_is_visible(struct kobject *kobj,
struct device *dev = kobj_to_dev(kobj);
struct nct6775_data *data = dev_get_drvdata(dev);
int in = index / 5; /* voltage index */
+ int nr = index % 5; /* attribute index */
+
+ if (nr == 1 && data->ALARM_BITS[in] == -1)
+ return 0;
if (!(data->have_in & BIT(in)))
return 0;