diff options
author | Frank Crawford <frank@crawford.emu.id.au> | 2023-07-07 22:29:51 +1000 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2023-08-21 06:04:29 -0700 |
commit | 2f60e5932942d923258b37d24d147cb7d765df3d (patch) | |
tree | 8ff9cf1d8866e4b68b0ce1cc30c69db1f2d52b1f /drivers/hwmon | |
parent | 4018e0a9c00131d8514015749f45f0578cc59c64 (diff) | |
download | linux-stable-2f60e5932942d923258b37d24d147cb7d765df3d.tar.gz linux-stable-2f60e5932942d923258b37d24d147cb7d765df3d.tar.bz2 linux-stable-2f60e5932942d923258b37d24d147cb7d765df3d.zip |
hwmon: (it87) Improve temperature reporting support
Add test if thermistor sensor type attribute should be visible, i.e.
test if the attribute is defined.
Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
Link: https://lore.kernel.org/r/20230707123005.956415-3-frank@crawford.emu.id.au
[groeck: Dropped unnecessary 'type' variable in it87_temp_is_visible()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/it87.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index f9703c4e3a9d..36cc7a2b56b5 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -2328,6 +2328,12 @@ static umode_t it87_temp_is_visible(struct kobject *kobj, if (!(data->has_temp & BIT(i))) return 0; + if (a == 3) { + if (get_temp_type(data, i) == 0) + return 0; + return attr->mode; + } + if (a == 5 && !has_temp_offset(data)) return 0; |