[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220613093116.2gc3mc5uvzoy5jrf@skbuf>
Date: Mon, 13 Jun 2022 12:31:16 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Arun Ramadoss <arun.ramadoss@...rochip.com>
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Woojung Huh <woojung.huh@...rochip.com>,
UNGLinuxDriver@...rochip.com, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Russell King <linux@...linux.org.uk>
Subject: Re: [RFC Patch net-next v2 06/15] net: dsa: microchip: get
P_STP_CTRL in ksz_port_stp_state by ksz_dev_ops
On Mon, May 30, 2022 at 04:12:48PM +0530, Arun Ramadoss wrote:
> At present, P_STP_CTRL register value is passed as parameter to
> ksz_port_stp_state from the individual dsa_switch_ops hooks. This patch
> update the function to retrieve the register value through the
> ksz_dev_ops function pointer.
> And add the static to ksz_update_port_member since it is not called
> outside the ksz_common.
>
> Signed-off-by: Arun Ramadoss <arun.ramadoss@...rochip.com>
> ---
> drivers/net/dsa/microchip/ksz8795.c | 9 +++++----
> drivers/net/dsa/microchip/ksz9477.c | 10 +++++-----
> drivers/net/dsa/microchip/ksz_common.c | 9 +++++----
> drivers/net/dsa/microchip/ksz_common.h | 5 ++---
> 4 files changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
> index 8657b520b336..e6982fa9d382 100644
> --- a/drivers/net/dsa/microchip/ksz8795.c
> +++ b/drivers/net/dsa/microchip/ksz8795.c
> @@ -920,9 +920,9 @@ static void ksz8_cfg_port_member(struct ksz_device *dev, int port, u8 member)
> ksz_pwrite8(dev, port, P_MIRROR_CTRL, data);
> }
>
> -static void ksz8_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
> +static int ksz8_get_stp_reg(void)
> {
> - ksz_port_stp_state_set(ds, port, state, P_STP_CTRL);
> + return P_STP_CTRL;
> }
Since there's nothing dynamic about get_stp_reg(), can the STP register
location stay in struct ksz_chip_data?
Powered by blists - more mailing lists