Re: [PATCH 1/4] net: phy: at803x: fix incorrect use of FIELD_PREP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 24, 2021 at 01:22:44PM +0100, Ahmad Fatoum wrote:
> FIELD_PREP expects mask datatype to be a constant unsigned long.
> The mask constant already has the correct datatype, so pass it directly.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
> ---
>  drivers/net/phy/at803x.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> index e0e147b1913e..93a8bb9df10e 100644
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -141,13 +141,12 @@ static int at803x_parse_dt(struct phy_device *phydev)
>  	const struct device_d *dev = &phydev->dev;
>  	const struct device_node *node = dev->device_node;
>  	struct at803x_priv *priv = phydev->priv;
> -	unsigned int sel, mask;
> +	unsigned int sel;
>  	u32 freq, strength;
>  	int ret;
>  
>  	ret = of_property_read_u32(node, "qca,clk-out-frequency", &freq);
>  	if (!ret) {
> -		mask = AT803X_CLK_OUT_MASK;
>  		switch (freq) {
>  		case 25000000:
>  			sel = AT803X_CLK_OUT_25MHZ_XTAL;
> @@ -166,8 +165,8 @@ static int at803x_parse_dt(struct phy_device *phydev)
>  			return -EINVAL;
>  		}
>  
> -		priv->clk_25m_reg |= FIELD_PREP(mask, sel);
> -		priv->clk_25m_mask |= mask;
> +		priv->clk_25m_reg |= FIELD_PREP(AT803X_CLK_OUT_MASK, sel);
> +		priv->clk_25m_mask |= AT803X_CLK_OUT_MASK;
>  
>  		/* Fixup for the AR8030/AR8035. This chip has another mask and
>  		 * doesn't support the DSP reference. Eg. the lowest bit of the
> -- 
> 2.29.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux