Commit c879eeb7aa95d753d4d9e39f43004943ed9d93b7

Authored by Bin Meng
Committed by Simon Glass
1 parent c515ee5c51

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>

Showing 2 changed files with 12 additions and 1 deletions Side-by-side Diff

drivers/block/blk-uclass.c
... ... @@ -517,7 +517,7 @@
517 517 return max_devnum;
518 518 }
519 519  
520   -static int blk_next_free_devnum(enum if_type if_type)
  520 +int blk_next_free_devnum(enum if_type if_type)
521 521 {
522 522 int ret;
523 523  
... ... @@ -379,6 +379,17 @@
379 379 int 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 + */
  390 +int blk_next_free_devnum(enum if_type if_type);
  391 +
  392 +/**
382 393 * blk_select_hwpart() - select a hardware partition
383 394 *
384 395 * Select a hardware partition if the device supports it (typically MMC does)