[API-NEXT,PATCHv2,18/23] drv: complement parameters to the driver probe() function

Message ID 1490194110-40168-19-git-send-email-christophe.milard@linaro.org
State New
Headers show
Series
  • driver items registration and probing
Related show

Commit Message

Christophe Milard March 22, 2017, 2:48 p.m.
Of course, when probing a driver, the latter should be given the devio
handle to be used. This is what this patch adds. It also adds the index
of the devio, hence telling the driver which of the possible
ODPDRV_MAX_DEVIOS devios was selected, as this is going to be the first
thing the driver needs to know.

Signed-off-by: Christophe Milard <christophe.milard@linaro.org>

---
 include/odp/drv/spec/driver.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.7.4

Patch

diff --git a/include/odp/drv/spec/driver.h b/include/odp/drv/spec/driver.h
index 394aa92..ad2b8db 100644
--- a/include/odp/drv/spec/driver.h
+++ b/include/odp/drv/spec/driver.h
@@ -314,9 +314,12 @@  struct odpdrv_driver_param_t {
 
 	/** Probe function:
 	 * Called by ODP to see if the driver can drive a given device
-	 *
+	 * -dev the device to be probed
+	 * -devio is the devio to be used.
+	 * -devio_idx actually tells which devio was selected: it is the
+	 * index in the devios array above.
 	 */
-	int (*probe)(odpdrv_device_t *dev);
+	int (*probe)(odpdrv_device_t dev, odpdrv_devio_t devio, int devio_idx);
 
 	/** unbind function:
 	 * Only called with devices whose probe() returned true