From: Bin Meng <bmeng.cn@gmail.com>
Date: Mon, 15 Oct 2018 09:21:09 +0000 (-0700)
Subject: blk: Make blk_next_free_devnum() public
X-Git-Tag: v2025.01-rc5-pxa1908~3276^2~36
X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-logo.png?a=commitdiff_plain;h=c879eeb7aa95d753d4d9e39f43004943ed9d93b7;p=u-boot.git

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>
---

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)
 	return max_devnum;
 }
 
-static int blk_next_free_devnum(enum if_type if_type)
+int blk_next_free_devnum(enum if_type if_type)
 {
 	int ret;
 
diff --git a/include/blk.h b/include/blk.h
index c243179ebb..5e94f0e096 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -378,6 +378,17 @@ int blk_unbind_all(int if_type);
  */
 int blk_find_max_devnum(enum if_type if_type);
 
+/**
+ * blk_next_free_devnum() - get the next device number for an interface type
+ *
+ * Finds the next number that is safe to use for a newly allocated device for
+ * an interface type @if_type.
+ *
+ * @if_type:	Interface type to scan
+ * @return next device number safe to use, or -ve on error
+ */
+int blk_next_free_devnum(enum if_type if_type);
+
 /**
  * blk_select_hwpart() - select a hardware partition
  *