From 47903aacc520c96bafae1225484e5df740a233e6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Nov 2024 16:19:08 -0700 Subject: bootstd: Move bootflow-adding to bootstd This relates to more than just the bootdev, since there is a global list of bootflows. Move the function to the bootstd file and rename it. Signed-off-by: Simon Glass --- include/bootdev.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'include/bootdev.h') diff --git a/include/bootdev.h b/include/bootdev.h index ad4af0d1310..8db198dd56b 100644 --- a/include/bootdev.h +++ b/include/bootdev.h @@ -195,21 +195,6 @@ void bootdev_list(bool probe); */ void bootdev_clear_bootflows(struct udevice *dev); -/** - * bootdev_add_bootflow() - Add a bootflow to the bootdev's list - * - * All fields in @bflow must be set up. Note that @bflow->dev is used to add the - * bootflow to that device. - * - * @dev: Bootdev device to add to - * @bflow: Bootflow to add. Note that fields within bflow must be allocated - * since this function takes over ownership of these. This functions makes - * a copy of @bflow itself (without allocating its fields again), so the - * caller must dispose of the memory used by the @bflow pointer itself - * Return: 0 if OK, -ENOMEM if out of memory - */ -int bootdev_add_bootflow(struct bootflow *bflow); - /** * bootdev_first_bootflow() - Get the first bootflow from a bootdev * -- cgit v1.2.3 From 92182257733b446f3074a8a9b0a7eafea6ea8c1c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Nov 2024 16:19:09 -0700 Subject: bootstd: Move bootflow-clearing to bootstd This relates to more than just the bootdev, since there is a global list of bootflows. Move the function to the bootstd file and rename it. Signed-off-by: Simon Glass Acked-by: Heinrich Schuchardt --- include/bootdev.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include/bootdev.h') diff --git a/include/bootdev.h b/include/bootdev.h index 8db198dd56b..f9cae2fd1fd 100644 --- a/include/bootdev.h +++ b/include/bootdev.h @@ -185,16 +185,6 @@ int bootdev_find_in_blk(struct udevice *dev, struct udevice *blk, */ 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 * -- cgit v1.2.3 From 6a3eb84b18333eb4beb7e660fa9ae8ccff07b0c4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Nov 2024 16:19:11 -0700 Subject: bootstd: Drop the bootdev-specific list of bootflows This list is only used by two functions, which can be updated to iterate through the global list. Take this approach, which allows the bootdev list to be dropped. Overall this makes the code slightly more complicated, but will allow moving the bootflow list into an alist Signed-off-by: Simon Glass --- include/bootdev.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/bootdev.h') diff --git a/include/bootdev.h b/include/bootdev.h index f9cae2fd1fd..991b6229c1c 100644 --- a/include/bootdev.h +++ b/include/bootdev.h @@ -109,11 +109,9 @@ struct bootdev_hunter { * This is attached to each device in the bootdev uclass and accessible via * dev_get_uclass_plat(dev) * - * @bootflows: List of available bootflows for this bootdev * @piro: Priority of this bootdev */ struct bootdev_uc_plat { - struct list_head bootflow_head; enum bootdev_prio_t prio; }; -- cgit v1.2.3 From a3d0fadca6b14f57477a4143334993daf52f89dc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Nov 2024 16:19:24 -0700 Subject: bootstd: Export bootdev_get_from_blk() Export this function so it can be used from other files. Signed-off-by: Simon Glass --- include/bootdev.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/bootdev.h') diff --git a/include/bootdev.h b/include/bootdev.h index 991b6229c1c..12c90c4ec1b 100644 --- a/include/bootdev.h +++ b/include/bootdev.h @@ -401,6 +401,15 @@ static int bootdev_setup_for_sibling_blk(struct udevice *blk, */ int bootdev_get_sibling_blk(struct udevice *dev, struct udevice **blkp); +/** + * bootdev_get_from_blk() - Get the bootdev given a block device + * + * @blk: Block device to check + * @bootdebp: Returns the bootdev found, if any + * Return 0 if OK, -ve on error + */ +int bootdev_get_from_blk(struct udevice *blk, struct udevice **bootdevp); + /** * bootdev_unbind_dev() - Unbind a bootdev device * -- cgit v1.2.3