Commit 2f60e593 authored by Frank Crawford's avatar Frank Crawford Committed by Guenter Roeck
Browse files

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: default avatarFrank 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: default avatarGuenter Roeck <linux@roeck-us.net>
parent 4018e0a9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;