mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 09:14:19 +08:00
hwmon: (occ) Start sequence number at one
Initialize the sequence number at one, rather than zero, in order to prevent false matches with the zero-initialized OCC SRAM buffer before the OCC is fully initialized. Signed-off-by: Eddie James <eajames@linux.ibm.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210209171235.20624-4-eajames@linux.ibm.com Signed-off-by: Joel Stanley <joel@jms.id.au>
This commit is contained in:
parent
614f0a50c9
commit
75028ef458
@ -1151,6 +1151,8 @@ int occ_setup(struct occ *occ, const char *name)
|
||||
{
|
||||
int rc;
|
||||
|
||||
/* start with 1 to avoid false match with zero-initialized SRAM buffer */
|
||||
occ->seq_no = 1;
|
||||
mutex_init(&occ->lock);
|
||||
occ->groups[0] = &occ->group;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user