]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
pinctrl: pinconf-generic: perform basic checks on pincfg properties
authorConor Dooley <conor.dooley@microchip.com>
Tue, 24 Feb 2026 13:39:04 +0000 (13:39 +0000)
committerLinus Walleij <linusw@kernel.org>
Fri, 27 Feb 2026 00:18:43 +0000 (01:18 +0100)
commit9c105255108b57f0b0241ee488e5b84d6196789c
tree7b08fea19672a32235fcc97fef3ff0511b812112
parent41c78b33e96f9ac4abb618d36625e6e7f7e7aeb7
pinctrl: pinconf-generic: perform basic checks on pincfg properties

Some pinconf properties are mutually exclusive, either because they
convey the same information in different units or represent incompatible
configurations of the same pin. Attempt, in two ways, to prevent these
situations.

Firstly, for enable/disable properties, produce an error if both are
set. Since enable/disable properties share the same enum value, they can
be trivially checked via the newly added bitmap. Having both enable and
disable for the same config makes no sense at all, so produce an error
in this case.

For interactions between properties, doing them outside the loop makes
more sense as it can be evaluated once. In case there are some edge
cases that would be broken by producing an error, only warn for now.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/pinconf-generic.c