Re: [PATCH 4/4] net: davinci_emac: Drop nvmem_get_mac_address usage

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

 



On Sat, Apr 27, 2019 at 01:06:42AM +0200, Petr Štetiar wrote:
> of_get_mac_address now uses NVMEM under the hood, so it's not necessary
> to call it manually anymore.
> 
> Signed-off-by: Petr Štetiar <ynezz@xxxxxxx>
> ---
>  drivers/net/ethernet/ti/davinci_emac.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index 57450b1..c1a5526 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -1912,15 +1912,11 @@ static int davinci_emac_probe(struct platform_device *pdev)
>  		ether_addr_copy(ndev->dev_addr, priv->mac_addr);
>  
>  	if (!is_valid_ether_addr(priv->mac_addr)) {
> -		/* Try nvmem if MAC wasn't passed over pdata or DT. */
> -		rc = nvmem_get_mac_address(&pdev->dev, priv->mac_addr);
> -		if (rc) {
> -			/* Use random MAC if still none obtained. */
> -			eth_hw_addr_random(ndev);
> -			memcpy(priv->mac_addr, ndev->dev_addr, ndev->addr_len);
> -			dev_warn(&pdev->dev, "using random MAC addr: %pM\n",
> -				 priv->mac_addr);
> -		}
> +		/* Use random MAC if still none obtained. */
> +		eth_hw_addr_random(ndev);
> +		memcpy(priv->mac_addr, ndev->dev_addr, ndev->addr_len);
> +		dev_warn(&pdev->dev, "using random MAC addr: %pM\n",
> +			 priv->mac_addr);

Hi Petr

There is the same ordering issue here as with the previous patch.

      Andrew



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux