[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190427165423.GE9816@lunn.ch>
Date: Sat, 27 Apr 2019 18:54:23 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Petr Štetiar <ynezz@...e.cz>
Cc: netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Grygorii Strashko <grygorii.strashko@...com>,
"David S. Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Alban Bedel <albeu@...e.fr>, linux-omap@...r.kernel.org
Subject: Re: [PATCH 4/4] net: davinci_emac: Drop nvmem_get_mac_address usage
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@...e.cz>
> ---
> 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
Powered by blists - more mailing lists