diff options
author | Tom Rini <trini@konsulko.com> | 2018-08-24 16:11:01 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-08-24 16:11:01 -0400 |
commit | 15fd1b7903a3090a03cfe453f661822a613a91ee (patch) | |
tree | 65ab83a17440b38d1c5b61f447e309291eb2ff28 /include/dm/device-internal.h | |
parent | 8b7f04f14a1b790ff8dec0afc28a9e8477a6eb88 (diff) | |
parent | 49c752c93a785b9bad9d3fbbd52a76bec003eac5 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-usb
Diffstat (limited to 'include/dm/device-internal.h')
-rw-r--r-- | include/dm/device-internal.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index f4af15448f..02ac4c7952 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -131,6 +131,44 @@ static inline void device_free(struct udevice *dev) {} #endif /** + * device_chld_unbind() - Unbind all device's children from the device if bound + * to drv + * + * On error, the function continues to unbind all children, and reports the + * first error. + * + * @dev: The device that is to be stripped of its children + * @drv: The targeted driver + * @return 0 on success, -ve on error + */ +#if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE) +int device_chld_unbind(struct udevice *dev, struct driver *drv); +#else +static inline int device_chld_unbind(struct udevice *dev, struct driver *drv) +{ + return 0; +} +#endif + +/** + * device_chld_remove() - Stop all device's children + * @dev: The device whose children are to be removed + * @drv: The targeted driver + * @flags: Flag, if this functions is called in the pre-OS stage + * @return 0 on success, -ve on error + */ +#if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE) +int device_chld_remove(struct udevice *dev, struct driver *drv, + uint flags); +#else +static inline int device_chld_remove(struct udevice *dev, struct driver *drv, + uint flags) +{ + return 0; +} +#endif + +/** * simple_bus_translate() - translate a bus address to a system address * * This handles the 'ranges' property in a simple bus. It translates the |