diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2023-05-26 10:34:42 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-05-30 10:48:17 +0300 |
commit | b8311f46c6f5a2030f43c764e742015867293493 (patch) | |
tree | 6c8d5a1d10169c86f79593a5d21ea73d9e0436c8 /drivers/net/dsa/microchip/ksz_spi.c | |
parent | 2f0d579956e87a67c43e225c85488ff7a13bc3b8 (diff) | |
download | linux-b8311f46c6f5a2030f43c764e742015867293493.tar.xz |
net: dsa: microchip: add an enum for regmap widths
It is not immediately obvious that this driver allocates, via the
KSZ_REGMAP_TABLE() macro, 3 regmaps for register access: dev->regmap[0]
for 8-bit access, dev->regmap[1] for 16-bit and dev->regmap[2] for
32-bit access.
In future changes that add support for reg_fields, each field will have
to specify through which of the 3 regmaps it's going to go. Add an enum
now, to denote one of the 3 register access widths, and make the code go
through some wrapper functions for easier review and further
modification.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz_spi.c')
-rw-r--r-- | drivers/net/dsa/microchip/ksz_spi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz_spi.c index 96c52e8fb51b..279338451621 100644 --- a/drivers/net/dsa/microchip/ksz_spi.c +++ b/drivers/net/dsa/microchip/ksz_spi.c @@ -63,7 +63,7 @@ static int ksz_spi_probe(struct spi_device *spi) else regmap_config = ksz9477_regmap_config; - for (i = 0; i < ARRAY_SIZE(ksz8795_regmap_config); i++) { + for (i = 0; i < __KSZ_NUM_REGMAPS; i++) { rc = regmap_config[i]; rc.lock_arg = &dev->regmap_mutex; rc.wr_table = chip->wr_table; |