All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Petr Štetiar" <ynezz@true.cz>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Alban Bedel <albeu@free.fr>
Subject: Re: [PATCH v2 3/4] net: macb: Drop nvmem_get_mac_address usage
Date: Sun, 28 Apr 2019 18:56:37 +0200	[thread overview]
Message-ID: <20190428165637.GJ23059@lunn.ch> (raw)
In-Reply-To: <1556456002-13430-4-git-send-email-ynezz@true.cz>

On Sun, Apr 28, 2019 at 02:53:21PM +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@true.cz>
> ---
>  drivers/net/ethernet/cadence/macb_main.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 3da2795..1b98bc8 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4172,16 +4172,10 @@ static int macb_probe(struct platform_device *pdev)
>  		bp->rx_intr_mask |= MACB_BIT(RXUBR);
>  
>  	mac = of_get_mac_address(np);
> -	if (mac) {
> +	if (mac)
>  		ether_addr_copy(bp->dev->dev_addr, mac);
> -	} else {
> -		err = nvmem_get_mac_address(&pdev->dev, bp->dev->dev_addr);
> -		if (err) {
> -			if (err == -EPROBE_DEFER)

The EPRODE_DEFER is interesting here. your change to
of_get_mac_address() does not seem to handle that case. It probably
should. We don't want it to fail and end up with a random MAC
addresses etc, because the NVMEM has not probed yet.

	  Andrew

  reply	other threads:[~2019-04-28 16:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-28 12:53 [PATCH v2 0/4] of_net: Add NVMEM support to of_get_mac_address Petr Štetiar
2019-04-28 12:53 ` Petr Štetiar
2019-04-28 12:53 ` [PATCH v2 1/4] " Petr Štetiar
2019-05-01 20:19   ` Rob Herring
2019-05-02  9:05     ` Petr Štetiar
2019-05-07 16:06       ` Rob Herring
2019-05-08  9:02         ` Petr Štetiar
2019-04-28 12:53 ` [PATCH v2 2/4] dt-bindings: doc: Reflect new NVMEM of_get_mac_address behaviour Petr Štetiar
2019-04-28 12:53   ` Petr Štetiar
2019-04-28 16:53   ` Andrew Lunn
2019-04-28 16:53     ` Andrew Lunn
2019-04-28 16:53     ` Andrew Lunn
2019-05-01 20:22     ` Rob Herring
2019-05-01 20:22       ` Rob Herring
2019-05-01 20:22       ` Rob Herring
2019-04-28 12:53 ` [PATCH v2 3/4] net: macb: Drop nvmem_get_mac_address usage Petr Štetiar
2019-04-28 16:56   ` Andrew Lunn [this message]
2019-04-28 21:08     ` Petr Štetiar
2019-04-28 21:36       ` Andrew Lunn
2019-04-29  7:55         ` Petr Štetiar
2019-04-29 13:02           ` Andrew Lunn
2019-04-30 14:13             ` Handling of EPROBE_DEFER in of_get_mac_address [Was: Re: [PATCH v2 3/4] net: macb: Drop nvmem_get_mac_address usage] Petr Štetiar
2019-05-01 13:54               ` Andrew Lunn
2019-04-28 12:53 ` [PATCH v2 4/4] net: davinci_emac: Drop nvmem_get_mac_address usage Petr Štetiar
2019-04-28 16:58   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190428165637.GJ23059@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=albeu@free.fr \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=ynezz@true.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.