return ops->get_bootflow(dev, iter, bflow);
}
-void bootdev_clear_bootflows(struct udevice *dev)
-{
- struct bootdev_uc_plat *ucp = dev_get_uclass_plat(dev);
-
- while (!list_empty(&ucp->bootflow_head)) {
- struct bootflow *bflow;
-
- bflow = list_first_entry(&ucp->bootflow_head, struct bootflow,
- bm_node);
- bootflow_remove(bflow);
- }
-}
-
int bootdev_next_label(struct bootflow_iter *iter, struct udevice **devp,
int *method_flagsp)
{
static int bootdev_pre_unbind(struct udevice *dev)
{
- bootdev_clear_bootflows(dev);
+ int ret;
+
+ ret = bootstd_clear_bootflows_for_bootdev(dev);
+ if (ret)
+ return log_msg_ret("bun", ret);
return 0;
}
return 0;
}
+int bootstd_clear_bootflows_for_bootdev(struct udevice *dev)
+{
+ struct bootdev_uc_plat *ucp = dev_get_uclass_plat(dev);
+
+ while (!list_empty(&ucp->bootflow_head)) {
+ struct bootflow *bflow;
+
+ bflow = list_first_entry(&ucp->bootflow_head, struct bootflow,
+ bm_node);
+ bootflow_remove(bflow);
+ }
+
+ return 0;
+}
+
static int bootstd_remove(struct udevice *dev)
{
struct bootstd_priv *priv = dev_get_priv(dev);
show_header();
}
if (dev)
- bootdev_clear_bootflows(dev);
+ bootstd_clear_bootflows_for_bootdev(dev);
else
bootstd_clear_glob();
for (i = 0,
*/
void bootdev_list(bool probe);
-/**
- * bootdev_clear_bootflows() - Clear bootflows from a bootdev
- *
- * Each bootdev maintains a list of discovered bootflows. This provides a
- * way to clear it. These bootflows are removed from the global list too.
- *
- * @dev: bootdev device to update
- */
-void bootdev_clear_bootflows(struct udevice *dev);
-
/**
* bootdev_first_bootflow() - Get the first bootflow from a bootdev
*
*/
int bootstd_add_bootflow(struct bootflow *bflow);
+/**
+ * bootstd_clear_bootflows_for_bootdev() - Clear bootflows from a bootdev
+ *
+ * Each bootdev maintains a list of discovered bootflows. This provides a
+ * way to clear it. These bootflows are removed from the global list too.
+ *
+ * @dev: bootdev device to update
+ */
+int bootstd_clear_bootflows_for_bootdev(struct udevice *dev);
+
#endif