On Thu, Aug 29, 2024 at 06:05:44PM -0700, Guenter Roeck wrote: > 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. > > Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx> Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>