mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
cmd: fs: Use part_get_info_by_dev_and_name_or_num to parse partitions
This allows using dev#partlabel syntax. Signed-off-by: Sean Anderson <sean.anderson@seco.com>
This commit is contained in:
parent
fe3a2808bb
commit
7194527b6a
2 changed files with 13 additions and 3 deletions
4
fs/fs.c
4
fs/fs.c
|
@ -385,8 +385,8 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
part = blk_get_device_part_str(ifname, dev_part_str, &fs_dev_desc,
|
part = part_get_info_by_dev_and_name_or_num(ifname, dev_part_str, &fs_dev_desc,
|
||||||
&fs_partition, 1);
|
&fs_partition, 1);
|
||||||
if (part < 0)
|
if (part < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ int part_get_info_by_name(struct blk_desc *dev_desc,
|
||||||
* @param[in] allow_whole_dev true to allow the user to select partition 0
|
* @param[in] allow_whole_dev true to allow the user to select partition 0
|
||||||
* (which means the whole device), false to require a valid
|
* (which means the whole device), false to require a valid
|
||||||
* partition number >= 1
|
* partition number >= 1
|
||||||
* @return 0 on success, or a negative on error
|
* @return the partition number on success, or negative errno on error
|
||||||
*/
|
*/
|
||||||
int part_get_info_by_dev_and_name_or_num(const char *dev_iface,
|
int part_get_info_by_dev_and_name_or_num(const char *dev_iface,
|
||||||
const char *dev_part_str,
|
const char *dev_part_str,
|
||||||
|
@ -275,6 +275,16 @@ static inline int blk_get_device_part_str(const char *ifname,
|
||||||
struct disk_partition *info,
|
struct disk_partition *info,
|
||||||
int allow_whole_dev)
|
int allow_whole_dev)
|
||||||
{ *dev_desc = NULL; return -1; }
|
{ *dev_desc = NULL; return -1; }
|
||||||
|
static inline 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,
|
||||||
|
int allow_whole_dev)
|
||||||
|
{
|
||||||
|
*dev_desc = NULL;
|
||||||
|
return -ENOSYS;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue