aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Meng2018-10-15 04:21:09 -0500
committerSimon Glass2018-11-14 11:16:27 -0600
commitc879eeb7aa95d753d4d9e39f43004943ed9d93b7 (patch)
tree585f6c8f0d60b0cacd31293686b4e22496dce24a
parentc515ee5c51618883df64ab7326fbee8911b99a97 (diff)
downloadu-boot-c879eeb7aa95d753d4d9e39f43004943ed9d93b7.tar.gz
u-boot-c879eeb7aa95d753d4d9e39f43004943ed9d93b7.tar.xz
u-boot-c879eeb7aa95d753d4d9e39f43004943ed9d93b7.zip
blk: Make blk_next_free_devnum() public
blk_next_free_devnum() can be helpful in some cases. Make it a public API. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--drivers/block/blk-uclass.c2
-rw-r--r--include/blk.h11
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index 3f00ff8ede..76ee3db80c 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -517,7 +517,7 @@ int blk_find_max_devnum(enum if_type if_type)
517 return max_devnum; 517 return max_devnum;
518} 518}
519 519
520static int blk_next_free_devnum(enum if_type if_type) 520int blk_next_free_devnum(enum if_type if_type)
521{ 521{
522 int ret; 522 int ret;
523 523
diff --git a/include/blk.h b/include/blk.h
index c243179ebb..5e94f0e096 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -379,6 +379,17 @@ int blk_unbind_all(int if_type);
379int blk_find_max_devnum(enum if_type if_type); 379int blk_find_max_devnum(enum if_type if_type);
380 380
381/** 381/**
382 * blk_next_free_devnum() - get the next device number for an interface type
383 *
384 * Finds the next number that is safe to use for a newly allocated device for
385 * an interface type @if_type.
386 *
387 * @if_type: Interface type to scan
388 * @return next device number safe to use, or -ve on error
389 */
390int blk_next_free_devnum(enum if_type if_type);
391
392/**
382 * blk_select_hwpart() - select a hardware partition 393 * blk_select_hwpart() - select a hardware partition
383 * 394 *
384 * Select a hardware partition if the device supports it (typically MMC does) 395 * Select a hardware partition if the device supports it (typically MMC does)