diff options
author | Bin Meng | 2023-09-26 16:43:41 +0800 |
---|---|---|
committer | Tom Rini | 2023-10-10 16:25:48 -0400 |
commit | a9bf25cb93b96502da814f22cd2fbb284272a800 (patch) | |
tree | c3ac4a3350f793801881296895ba6eb4206786f2 /include/blk.h | |
parent | 8ccc948f4079b291052a509e5da41a27153ffa00 (diff) |
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>
Diffstat (limited to 'include/blk.h')
-rw-r--r-- | include/blk.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/blk.h b/include/blk.h index bbff057aed4..b453b5a6026 100644 --- a/include/blk.h +++ b/include/blk.h @@ -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> /* |