Home
last modified time | relevance | path

Searched hist:"2 bb476524c61f43e6e89aeacaee6599ce5dd3505" (Results 1 – 1 of 1) sorted by relevance

/linux/drivers/hwmon/
H A Dina2xx.cdiff 2bb476524c61f43e6e89aeacaee6599ce5dd3505 Fri Aug 02 01:43:03 CEST 2024 Guenter Roeck <linux@roeck-us.net> hwmon: (ina2xx) Mark regmap_config as const

Recent versions of checkpatch complain that struct regmap_config
should be declared as const.

WARNING: struct regmap_config should normally be const

Doing so reveals a potential problem in the driver: If both supported
chips are present in a single system, the maximum number of registers
may race when devices are instantiated since max_registers is updated
in the probe function. Solve the problem by setting .max_registers to the
maximum register address of all supported chips. This does not make a
practical difference while fixing the potential race condition and reducing
code complexity.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>