Skip to content
Commit d86f3c9b authored by Guenter Roeck's avatar Guenter Roeck
Browse files

hwmon: (pmbus) Improve initialization of 'currpage' and 'currphase'



The 'currpage' and 'currphase' variables in struct pmbus_data are used by
the PMBus core to determine if the phase or page value has changed. Both
are initialized with values which are never expected to be set in the code
to ensure that the first page/phase write operation is actually performed.

This is not well explained and occasionally causes confusion. Change the
type of both variables to s16 and initialize with -1 to ensure that the
initial value never matches a requested value, and clarify that this
value means "unknown/unset".

Cc: Alex Qiu <xqiu@google.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 6e0498dd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment