dm: blk: Rename get_desc() and make it externally visible

get_desc() can be useful outside blk-uclass.c. Let's change it to
an API and make it externally visible.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Bin Meng
2023-09-26 16:43:41 +08:00
committed by Tom Rini
parent 8ccc948f40
commit a9bf25cb93
2 changed files with 20 additions and 18 deletions

View File

@@ -515,6 +515,18 @@ const char *blk_get_devtype(struct udevice *dev);
*/
struct blk_desc *blk_get_by_device(struct udevice *dev);
/**
* blk_get_desc() - Get the block device descriptor for the given device number
*
* @uclass_id: Interface type
* @devnum: Device number (0 = first)
* @descp: Returns block device descriptor on success
* Return: 0 on success, -ENODEV if there is no such device and no device
* with a higher device number, -ENOENT if there is no such device but there
* is one with a higher number, or other -ve on other error.
*/
int blk_get_desc(enum uclass_id uclass_id, int devnum, struct blk_desc **descp);
#else
#include <errno.h>
/*