DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] drivers/bus: fill driver reference after NXP probing
@ 2018-09-25 19:22 Thomas Monjalon
  2018-09-26  8:12 ` Shreyansh Jain
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2018-09-25 19:22 UTC (permalink / raw)
  To: hemant.agrawal, shreyansh.jain; +Cc: dev

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.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/dpaa/dpaa_bus.c   | 6 +++++-
 drivers/bus/fslmc/fslmc_bus.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 16fabd1be..49cd04dbb 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -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;
 		}
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index d2900edc5..bfe81e236 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -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;
 		}
-- 
2.19.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-28 12:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-25 19:22 [dpdk-dev] [PATCH] drivers/bus: fill driver reference after NXP probing Thomas Monjalon
2018-09-26  8:12 ` Shreyansh Jain
2018-09-27 12:40   ` Thomas Monjalon
2018-09-28 12:27     ` Shreyansh Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).