Skip to contentSkip to conversation

drivers/bus: fill driver reference after NXP probing

PATCH In review Thomas Monjalon 2 participants 4 messages Sep 25, 2018 – Sep 28, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/bus: fill driver reference after NXP probing

The probing functions of NXP buses were missing to set the driver used for successfully probing a device.

The NXP driver and the generic rte_driver are now set in the device structures.

---
 drivers/bus/dpaa/dpaa_bus.c   | 6 +++++-
 drivers/bus/fslmc/fslmc_bus.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/bus/dpaa/dpaa_bus.c +5 -1
index 16fabd1be..49cd04dbb 100644
@@ -563,8 +563,12 @@ rte_dpaa_bus_probe(void)
 			    dev->device.devargs->policy ==
 			    RTE_DEV_WHITELISTED)) {
 				ret = drv->probe(drv, dev);
-				if (ret)
+				if (ret) {
 					DPAA_BUS_ERR("Unable to probe.\n");
+				} else {
+					dev->driver = drv;
+					dev->device.driver = &drv->driver;
+				}
 			}
 			break;
 		}
drivers/bus/fslmc/fslmc_bus.c +5 -1
index d2900edc5..bfe81e236 100644
@@ -396,8 +396,12 @@ rte_fslmc_probe(void)
 			   dev->device.devargs->policy ==
 			   RTE_DEV_WHITELISTED)) {
 				ret = drv->probe(drv, dev);
-				if (ret)
+				if (ret) {
 					DPAA2_BUS_ERR("Unable to probe");
+				} else {
+					dev->driver = drv;
+					dev->device.driver = &drv->driver;
+				}
 			}
 			break;
 		}
Signature · 1 line
2.19.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Thomas Monjalon

The probing functions of NXP buses were missing to set the driver used for successfully probing a device.

The NXP driver and the generic rte_driver are now set in the device structures.

---

A part of this was already being done in the drv->probe(), though it was
not complete (dpaa2_dev->driver = dpaa2_drv; was not being done).

--->8---net/dpaa2/dpaa2_ethdev.c--
2008
2009 eth_dev->device = &dpaa2_dev->device;
2010 eth_dev->device->driver = &dpaa2_drv->driver;
2011
--->8---

Thank you!

author Applied
#2 lore raw

26/09/2018 10:12, Shreyansh Jain:

Quoted 13 lines · Thomas Monjalon
Quoted 8 lines

The probing functions of NXP buses were missing to set the driver used for successfully probing a device.

The NXP driver and the generic rte_driver are now set in the device structures.

---

A part of this was already being done in the drv->probe(), though it was
not complete (dpaa2_dev->driver = dpaa2_drv; was not being done).

Quoted 6 lines

--->8---net/dpaa2/dpaa2_ethdev.c--
2008
2009 eth_dev->device = &dpaa2_dev->device;
2010 eth_dev->device->driver = &dpaa2_drv->driver;
2011
--->8---

I guess we could remove the driver assignment in NXP drivers, after this patch applied.

Quoted 3 lines

Thank you!

Applied

#3 lore raw
Quoted 21 lines · Thomas Monjalon

26/09/2018 10:12, Shreyansh Jain:

Quoted 13 lines · Thomas Monjalon
Quoted 8 lines

The probing functions of NXP buses were missing to set the driver used for successfully probing a device.

The NXP driver and the generic rte_driver are now set in the device structures.

---

A part of this was already being done in the drv->probe(), though it was
not complete (dpaa2_dev->driver = dpaa2_drv; was not being done).

Quoted 6 lines

--->8---net/dpaa2/dpaa2_ethdev.c--
2008
2009 eth_dev->device = &dpaa2_dev->device;
2010 eth_dev->device->driver = &dpaa2_drv->driver;
2011
--->8---

Quoted 3 lines

I guess we could remove the driver assignment in NXP drivers, after this patch applied.

Sent. I have kept fixes reference to your patch.