From: Christophe Milard <christophe.mil...@linaro.org>

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.mil...@linaro.org>
---
/** Email created from pull request 16 (heyi-linaro:driver-framework)
 ** https://github.com/Linaro/odp/pull/16
 ** Patch: https://github.com/Linaro/odp/pull/16.patch
 ** Base sha: bac3806356694060d30bf3c83e4133410fecd9ab
 ** Merge commit sha: 8038f288f85db54e1a242e91ded59675313317bf
 **/
 include/odp/drv/spec/driver.h | 8 ++++++++
 1 file changed, 8 insertions(+)

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 
*/

Reply via email to