regmap: mdio: Clean up invalid clause-22 addresses
authorSander Vanheule <sander@svanheule.net>
Thu, 3 Jun 2021 18:25:09 +0000 (20:25 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 8 Jun 2021 12:37:42 +0000 (13:37 +0100)
commitdff404deb8493e6154ad75a62ce7c4e37ff8fccd
treefea5ed0f2acaec8ff44603a8fc8d165ad3bb3fbe
parentbcd23f93d3984a94d64ce0b6bbfa3789c0e8ebaf
regmap: mdio: Clean up invalid clause-22 addresses

Currently a regmap configuration for regmap-mdio must have a register
address width of 5 bits (cf. clause-22 register access). This is not
enforced on the provided register addresses, which would enable
clause-45 MDIO bus access, if the right bit packing is used.

Prevent clause-45 access, and other invalid addresses, by masking the
provided register address.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
Link: https://lore.kernel.org/r/f7013f67e6d6ff56ec98660f18320f6ffcc1a777.1622743333.git.sander@svanheule.net
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-mdio.c