[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220726001359.m2sfsvyph2rufqly@skbuf>
Date: Tue, 26 Jul 2022 03:13:59 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: 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>, Jens Axboe <axboe@...nel.dk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [net-next PATCH v3 06/14] net: dsa: qca8k: move mib init
function to common code
On Sat, Jul 23, 2022 at 04:18:37PM +0200, Christian Marangi wrote:
> The same mib function is used by drivers based on qca8k family switch.
> Move it to common code to make it accessible also by other drivers.
>
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
> ---
> diff --git a/drivers/net/dsa/qca/qca8k-common.c b/drivers/net/dsa/qca/qca8k-common.c
> index 2f96f1d4b921..9e9e3f0b7179 100644
> --- a/drivers/net/dsa/qca/qca8k-common.c
> +++ b/drivers/net/dsa/qca/qca8k-common.c
> @@ -138,3 +138,39 @@ int qca8k_bulk_write(struct qca8k_priv *priv, u32 reg, u32 *val, int len)
>
> return 0;
> }
> +
> +int
> +qca8k_busy_wait(struct qca8k_priv *priv, u32 reg, u32 mask)
Can take up a single line.
> +{
> + u32 val;
> +
> + return regmap_read_poll_timeout(priv->regmap, reg, val, !(val & mask), 0,
> + QCA8K_BUSY_WAIT_TIMEOUT * USEC_PER_MSEC);
> +}
Powered by blists - more mailing lists