[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9b1b2f17-0489-4adb-8e17-594a813c2dc9@lunn.ch>
Date: Wed, 24 May 2023 19:03:38 +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>,
Vladimir Oltean <vladimir.oltean@....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 2/5] net: dsa: microchip: add an enum for
regmap widths
On Wed, May 24, 2023 at 02:32:17PM +0200, Oleksij Rempel wrote:
> From: Vladimir Oltean <vladimir.oltean@....com>
>
> 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.
Given the patches in this series, it is not obvious why the wrapper is
needed.
dev->regmap[KSZ_REGMAP_8] is just as readable as ksz_regmap_8(dev).
Do future changes add extra parameters to ksz_regmap_8()?
Andrew
Powered by blists - more mailing lists