linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Questions about adt7470 driver
@ 2020-05-26  9:22 Jean Delvare
  2020-05-27 22:42 ` Guenter Roeck
  0 siblings, 1 reply; 9+ messages in thread
From: Jean Delvare @ 2020-05-26  9:22 UTC (permalink / raw)
  To: linux-hwmon; +Cc: Joshua Scott, Axel Lin, Darrick J. Wong

Hi all,

In the context of bug #207771, I got to look into the adt7470 driver.
I'm slowing understanding the logic of the background temperature
registers update thread, still there are 2 things I do not understand:

1* Function adt7470_read_temperatures() sets data->num_temp_sensors,
however this value seems to be only used to limit the wait time of
future calls to the same function. In the general update function we
still read ALL temperature sensors regardless of its value:

		for (i = 0; i < ADT7470_TEMP_COUNT; i++)
			data->temp[i] = i2c_smbus_read_byte_data(client,
						ADT7470_TEMP_REG(i));

Shouldn't this loop be bounded with data->num_temp_sensors instead of
ADT7470_TEMP_COUNT?

2* Function adt7470_read_temperatures() also sets
data->temperatures_probed to 1, and this boolean is then used to skip
further calls to that function. But do we really need a separate
variable for this, given that num_temp_sensors >= 0 matches the same
condition as far as I can see?

Thanks,
-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-02 18:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-26  9:22 Questions about adt7470 driver Jean Delvare
2020-05-27 22:42 ` Guenter Roeck
2020-05-27 23:33   ` Darrick J. Wong
2020-05-28 10:02     ` Jean Delvare
2020-05-28 13:52       ` Guenter Roeck
2020-05-29  0:18         ` Darrick J. Wong
2020-05-29 13:41           ` Jean Delvare
2020-06-02 18:36             ` Darrick J. Wong
2020-05-29 13:29         ` Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).