Skip to contentSkip to conversation

staging: fsl-dpaa2/eth: Defer probing if no MC portal available

PATCH New Ioana Radulescu 1 participant 1 message Mar 20, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: fsl-dpaa2/eth: Defer probing if no MC portal available

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.

---
v2: rebase on latest driver code

 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +4 -1
index f013af6..ac1a750 100644
@@ -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;
 	}
 
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel