diff mbox series

[API-NEXT,15/21] drv: adding driver remove function

Message ID 1487768164-43184-16-git-send-email-christophe.milard@linaro.org
State Superseded
Headers show
Series driver items registration and probing | expand

Commit Message

Christophe Milard Feb. 22, 2017, 12:55 p.m. UTC
The remove function, as for other driver items (such as enumeratos...) is
called before the driver is to be removed, i.e. after all devices have been
been unboud 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

Comments

Bill Fischofer Feb. 22, 2017, 10:56 p.m. UTC | #1
On Wed, Feb 22, 2017 at 6:55 AM, Christophe Milard <
christophe.milard@linaro.org> wrote:

> The remove function, as for other driver items (such as enumeratos...) is

>


Typo: enumerators


> called before the driver is to be removed, i.e. after all devices have been

> been unboud from the driver. remove() should release any resource held

>


unbound


> by the driver.

>

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

> ---

>  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 0b62c1b..221a6ce 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 */

> --

> 2.7.4

>

>
Christophe Milard Feb. 27, 2017, 1:58 p.m. UTC | #2
On 22 February 2017 at 23:56, Bill Fischofer <bill.fischofer@linaro.org> wrote:
>

>

> On Wed, Feb 22, 2017 at 6:55 AM, Christophe Milard

> <christophe.milard@linaro.org> wrote:

>>

>> The remove function, as for other driver items (such as enumeratos...) is

>

>

> Typo: enumerators


=> V2

>

>>

>> called before the driver is to be removed, i.e. after all devices have

>> been

>> been unboud from the driver. remove() should release any resource held

>

>

> unbound


=> V2

Christophe

>

>>

>> by the driver.

>>

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

>> ---

>>  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 0b62c1b..221a6ce 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 */

>> --

>> 2.7.4

>>

>
diff mbox series

Patch

diff --git a/include/odp/drv/spec/driver.h b/include/odp/drv/spec/driver.h
index 0b62c1b..221a6ce 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 */