lkml.org 
[lkml]   [2022]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@gmail.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);
> +}

\
 
 \ /
  Last update: 2022-07-26 02:14    [W:0.146 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site