aboutsummaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorSean Anderson <sean.anderson@seco.com>2021-02-05 09:38:56 -0500
committerMarek Vasut <marex@denx.de>2021-02-26 15:30:55 +0100
commit9f7bb2825b81680c0bc3cb4b0376e6a230501242 (patch)
treed6ebad803137613c37508f340a22059a0bb9e366 /disk
parent59715754e1d1d9279f38d70df1c3c2949a5e5203 (diff)
downloadu-boot-9f7bb2825b81680c0bc3cb4b0376e6a230501242.zip
u-boot-9f7bb2825b81680c0bc3cb4b0376e6a230501242.tar.gz
u-boot-9f7bb2825b81680c0bc3cb4b0376e6a230501242.tar.bz2
part: Support getting whole disk from part_get_info_by_dev_and_name_or_num
This adds an option to part_get_info_by_dev_and_name_or_num to allow callers to specify whether whole-disk partitions are fine. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'disk')
-rw-r--r--disk/part.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/disk/part.c b/disk/part.c
index 2a6b85e..03f2833 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -737,7 +737,8 @@ static int part_get_info_by_dev_and_name(const char *dev_iface,
int part_get_info_by_dev_and_name_or_num(const char *dev_iface,
const char *dev_part_str,
struct blk_desc **dev_desc,
- struct disk_partition *part_info)
+ struct disk_partition *part_info,
+ int allow_whole_dev)
{
int ret;
@@ -751,7 +752,7 @@ int part_get_info_by_dev_and_name_or_num(const char *dev_iface,
* directly.
*/
ret = blk_get_device_part_str(dev_iface, dev_part_str,
- dev_desc, part_info, 1);
+ dev_desc, part_info, allow_whole_dev);
if (ret < 0)
printf("Couldn't find partition %s %s\n",
dev_iface, dev_part_str);