Skip to content

Commit

Permalink
hwmon: (it87) Improve temperature reporting support
Browse files Browse the repository at this point in the history
Add test if thermistor sensor type attribute should be visible, i.e.
test if the attribute is defined.

Signed-off-by: Frank Crawford <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[groeck: Dropped unnecessary 'type' variable in it87_temp_is_visible()]
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
frankcrawford authored and groeck committed Aug 21, 2023
1 parent 4018e0a commit 2f60e59
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/hwmon/it87.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2f60e59

Please sign in to comment.