summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-07-01 20:52:58 +0200
committerSimon Glass <sjg@chromium.org>2015-07-21 17:39:35 -0600
commitbb52b367f6ca4a3a918e77737f4ff6a1089912d9 (patch)
treee14909e914d066cb129c98dce725c9a87b2324d7 /include/dm
parent8802f56349eef1eedaf12238f84810d0691aaf34 (diff)
downloadu-boot-imx-bb52b367f6ca4a3a918e77737f4ff6a1089912d9.zip
u-boot-imx-bb52b367f6ca4a3a918e77737f4ff6a1089912d9.tar.gz
u-boot-imx-bb52b367f6ca4a3a918e77737f4ff6a1089912d9.tar.bz2
dm: Export device_remove_children / device_unbind_children
These functions are useful to remove all children from an usb bus before rescanning the bus. Give them a better name and export them. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device-internal.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index 687462b..402304f 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -107,6 +107,32 @@ int device_unbind(struct udevice *dev);
static inline int device_unbind(struct udevice *dev) { return 0; }
#endif
+/**
+ * device_remove_children() - Stop all device's children
+ * @dev: The device whose children are to be removed
+ * @return 0 on success, -ve on error
+ */
+#ifdef CONFIG_DM_DEVICE_REMOVE
+int device_remove_children(struct udevice *dev);
+#else
+static inline int device_remove_children(struct udevice *dev) { return 0; }
+#endif
+
+/**
+ * device_unbind_children() - Unbind all device's children from the device
+ *
+ * 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
+ * @return 0 on success, -ve on error
+ */
+#ifdef CONFIG_DM_DEVICE_REMOVE
+int device_unbind_children(struct udevice *dev);
+#else
+static inline int device_unbind_children(struct udevice *dev) { return 0; }
+#endif
+
#ifdef CONFIG_DM_DEVICE_REMOVE
void device_free(struct udevice *dev);
#else