[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <584bb123-28c7-4d56-bad7-efcc2c343ecb@lunn.ch>
Date: Wed, 24 May 2023 18:59:28 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Florian Fainelli <f.fainelli@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Vladimir Oltean <olteanv@...il.com>,
Woojung Huh <woojung.huh@...rochip.com>,
Arun Ramadoss <arun.ramadoss@...rochip.com>,
kernel@...gutronix.de, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, UNGLinuxDriver@...rochip.com,
"Russell King (Oracle)" <linux@...linux.org.uk>
Subject: Re: [PATCH net-next v1 4/5] net: dsa: microchip: ksz8: Prepare
ksz8863_smi for regmap register access validation
On Wed, May 24, 2023 at 02:32:19PM +0200, Oleksij Rempel wrote:
> This patch prepares the ksz8863_smi part of ksz8 driver to utilize the
> regmap register access validation feature.
>
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> ---
> drivers/net/dsa/microchip/ksz8863_smi.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/dsa/microchip/ksz8863_smi.c b/drivers/net/dsa/microchip/ksz8863_smi.c
> index 2af807db0b45..303a4707c759 100644
> --- a/drivers/net/dsa/microchip/ksz8863_smi.c
> +++ b/drivers/net/dsa/microchip/ksz8863_smi.c
> @@ -104,6 +104,7 @@ static const struct regmap_config ksz8863_regmap_config[] = {
> .cache_type = REGCACHE_NONE,
> .lock = ksz_regmap_lock,
> .unlock = ksz_regmap_unlock,
> + .max_register = BIT(8) - 1,
Maybe SZ_256 - 1 is more readable?
> },
> {
> .name = "#16",
> @@ -113,6 +114,7 @@ static const struct regmap_config ksz8863_regmap_config[] = {
> .cache_type = REGCACHE_NONE,
> .lock = ksz_regmap_lock,
> .unlock = ksz_regmap_unlock,
> + .max_register = BIT(8) - 2,
- 2?
Is this the 16 bit regmap? So it has 1/2 the number of registers of
the 8 bit regmap? So i would of thought it should be BIT(7)-1, or
SZ_128-1 ?
Andrew
Powered by blists - more mailing lists