summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorGreg Malysa <[email protected]>2025-07-17 06:19:01 -0400
committerTom Rini <[email protected]>2025-07-23 17:37:14 -0600
commit3532f1f5edfc97c9dcea723cdeb732eda44bc669 (patch)
tree90bface9a3ea9cd9e7dafca4ea85a8047362ea6c /drivers/block
parentcf13f33d3a684c12f1ef835793cd66193df00c47 (diff)
block: Remove blk_find_first/next
In [0], Andrew noted a code quality issue in the implementation of blk_find_first and blk_find_next. This led to the observation that the logic of these functions was also likely incorrect, and based on a quick check it seemed the functions were unused outside of test code, which did not exercise the potential failure case, so we felt they should be removed. In [1], a test patch which illustrates the failure in sandbox is provided for reference. Because a more thorough check agrees that these functions are unused, they are currently incorrect, and fixed/removable flags on block devices prior to probe are unreliable, just remove these functions instead of fixing them. All potential users should have used blk_first_device_err instead anyway. CI results at [2]. [0] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/ [1] https://gist.github.com/gmalysa/b05e73a5c14bc18c5741a0e0e06a2992 [2] https://gitlab.com/gmalysa/lnxdsp-u-boot/-/pipelines/1931210857 Signed-off-by: Greg Malysa <[email protected]> Reviewed-by: Andrew Goodbody <[email protected]>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/blk-uclass.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index f3ac8db9464..73c24fd9176 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -611,30 +611,6 @@ static int blk_flags_check(struct udevice *dev, enum blk_flag_t req_flags)
return flags & req_flags ? 0 : 1;
}
-int blk_find_first(enum blk_flag_t flags, struct udevice **devp)
-{
- int ret;
-
- for (ret = uclass_find_first_device(UCLASS_BLK, devp);
- *devp && !blk_flags_check(*devp, flags);
- ret = uclass_find_next_device(devp))
- return 0;
-
- return -ENODEV;
-}
-
-int blk_find_next(enum blk_flag_t flags, struct udevice **devp)
-{
- int ret;
-
- for (ret = uclass_find_next_device(devp);
- *devp && !blk_flags_check(*devp, flags);
- ret = uclass_find_next_device(devp))
- return 0;
-
- return -ENODEV;
-}
-
int blk_first_device_err(enum blk_flag_t flags, struct udevice **devp)
{
for (uclass_first_device(UCLASS_BLK, devp);