Skip to content

Commit

Permalink
staging: fsl-dpaa2/eth: Defer probing if no MC portal available
Browse files Browse the repository at this point in the history
MC portals may not be available at the initial probing attempt
due to dependencies on other modules.

Check the return value of the MC portal allocation function and
defer probing in case it's not available yet. For all other error
cases the behaviour stays the same.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Suggested-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ioana Radulescu authored and Greg Kroah-Hartman committed Mar 22, 2018
1 parent d59578d commit 8c36961
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,10 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
err = fsl_mc_portal_allocate(dpni_dev, FSL_MC_IO_ATOMIC_CONTEXT_PORTAL,
&priv->mc_io);
if (err) {
dev_err(dev, "MC portal allocation failed\n");
if (err == -ENXIO)
err = -EPROBE_DEFER;
else
dev_err(dev, "MC portal allocation failed\n");
goto err_portal_alloc;
}

Expand Down

0 comments on commit 8c36961

Please sign in to comment.