From: Sean Anderson Date: Tue, 9 Mar 2021 16:36:14 -0500 Subject: [PATCH] cmd: fs: Use part_get_info_by_dev_and_name_or_num to parse partitions In-Reply-To: <5F1FFCD9-B61E-47AC-AE0D-7D3FEE2D1551@gmx.de> References: <20210309205624.239253-1-sean.anderson@seco.com> <5F1FFCD9-B61E-47AC-AE0D-7D3FEE2D1551@gmx.de> Message-ID: <8847ca4f-4160-d893-8d5b-020db5473cec@seco.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 3/9/21 4:21 PM, Heinrich Schuchardt wrote: > Am 9. M?rz 2021 21:56:24 MEZ schrieb Sean Anderson : >> This allows using dev#partlabel syntax. > > Allowing more widespread use of that syntax makes sense to me. > > Unfortunately you do not mention which commands and devices are affected. I enabled it so that cmd/fs.c can use it (e.g. CMD_FS_GENERIC). It seems like I overlooked that this was in fs/fs.c and not cmd/fs.c. Affected functionality should be most filesystem commands (due to do_load), DFU, fastboot, and splash screen. I suspect this affects almost every device using U-Boot. > >> >> Signed-off-by: Sean Anderson >> --- >> >> fs/fs.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/fs/fs.c b/fs/fs.c >> index 900928c394..b7936fd4cf 100644 >> --- a/fs/fs.c >> +++ b/fs/fs.c >> @@ -385,8 +385,8 @@ int fs_set_blk_dev(const char *ifname, const char >> *dev_part_str, int fstype) >> } >> #endif >> >> - part = blk_get_device_part_str(ifname, dev_part_str, &fs_dev_desc, >> - &fs_partition, 1); >> + part = part_get_info_by_dev_and_name_or_num(ifname, dev_part_str, >> &fs_dev_desc, >> + &fs_partition, 1); >> if (part < 0) >> return -1; >> > > It would be good if we could test the new capabilities. Can we make use of sandbox_mmc.c? I suppose. There are already some tests in test/dm/fastboot.c along these lines. Fastboot calls into part_get_info_by_dev_and_name_or_num, so I think that is testing the same sort of thing. Perhaps they should be broken out into general partition tests. IMO this code path already has adequate tests. --Sean