summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device-internal.h38
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