Re: [PATCH] regulator: max597x: Align for simple_mfd_i2c driver

From: Mark Brown
Date: Wed Feb 15 2023 - 09:02:32 EST


On Tue, Feb 14, 2023 at 11:13:20AM +0100, Naresh Solanki wrote:

> + if (of_device_is_compatible(i2c->dev.of_node, "maxim,max5978"))
> + max597x->num_switches = MAX597x_TYPE_MAX5978;
> + else
> + max597x->num_switches = MAX597x_TYPE_MAX5970;

It looks like this will break if there's any more variants, it
looks like it should be checking each compatible in turn and
erroring out if nothing matches somehow.

Attachment: signature.asc
Description: PGP signature