[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <X/d8FkhFsfnlp2hA@lunn.ch>
Date: Thu, 7 Jan 2021 22:24:38 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Ioana Ciornei <ciorneiioana@...il.com>
Cc: davem@...emloft.net, kuba@...nel.org, netdev@...r.kernel.org,
laurentiu.tudor@....com, Ioana Ciornei <ioana.ciornei@....com>
Subject: Re: [PATCH 4/6] dpaa2-eth: retry the probe when the MAC is not yet
discovered on the bus
On Thu, Jan 07, 2021 at 05:36:36PM +0200, Ioana Ciornei wrote:
> From: Ioana Ciornei <ioana.ciornei@....com>
>
> The fsl_mc_get_endpoint() function now returns -EPROBE_DEFER when the
> dpmac device was not yet discovered by the fsl-mc bus. When this
> happens, pass the error code up so that we can retry the probe at a
> later time.
>
> Signed-off-by: Ioana Ciornei <ioana.ciornei@....com>
> ---
> drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> index f3f53e36aa00..3297e390476b 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> @@ -4042,6 +4042,10 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv)
>
> dpni_dev = to_fsl_mc_device(priv->net_dev->dev.parent);
> dpmac_dev = fsl_mc_get_endpoint(dpni_dev);
> +
> + if (PTR_ERR(dpmac_dev) == -EPROBE_DEFER)
> + return PTR_ERR(dpmac_dev);
> +
> if (IS_ERR_OR_NULL(dpmac_dev) || dpmac_dev->dev.type != &fsl_mc_bus_dpmac_type)
Hi Ioana
Given the previous change, i don't think dpmac_dev can be NULL, so you
can change this to IS_ERR(). IS_ERR_OR_NULL() often triggers extra
review work because it is easy to get it wrong, so removing it is nice.
Andrew
Powered by blists - more mailing lists