[API-NEXT,PATCHv2,17/23] drv: adding driver remove function

Message ID 1490194110-40168-18-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.
The remove function, as for other driver items (such as enumerators...) is
called before the driver is to be removed, i.e. after all devices have been
been unbound from the driver. remove() should release any resource held
by the driver.

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

---
 include/odp/drv/spec/driver.h | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.7.4

Patch

diff --git a/include/odp/drv/spec/driver.h b/include/odp/drv/spec/driver.h
index f89c282..394aa92 100644
--- a/include/odp/drv/spec/driver.h
+++ b/include/odp/drv/spec/driver.h
@@ -336,6 +336,14 @@  struct odpdrv_driver_param_t {
 	int (*unbind)(odpdrv_device_t dev,
 		      void (*callback)(odpdrv_device_t dev),
 		      uint32_t flags);
+
+	/** remove function:
+	 * remove any resource taken by the driver. Called when the driver
+	 * itself is to be removed, i.e. after all devices are unbound
+	 * Can be set to NULL if the driver has nothing to release.
+	 *
+	 */
+	int (*remove)(void);
 };
 
 /** The callback function must be called mmediately by the current ODP thread */