On 2026-05-13T08:02:45, Weijie Gao <[email protected]> wrote: > cmd: ubi: reorganize command messages > > This patch moves normal subcommand messages into the main command function. > This will allow current and potential api functions being called with clean > output on success. > > A new function ubi_require_volume() is added for finding and printing error > message if volume not found. The original ubi_find_volume() will be silent > for being an api function. > > To avoid ubi_require_volume() being called twice for volume read/remove, > some changes are required: > - The parameter of ubi_remove_vol() is changed to accept > 'struct ubi_volume *' directly. > - The original ubi_volume_read() is renamed to __ubi_volume_read, with its > first parameter changed to accept also 'struct ubi_volume *' directly. > - A new ubi_volume_read() is added to wraps __ubi_volume_read() to accept > volume name as its first parameter. > > Signed-off-by: Weijie Gao <[email protected]> > > cmd/ubi.c | 118 ++++++++++++++++++++++++++++++++++++++++++-------------------- > 1 file changed, 80 insertions(+), 38 deletions(-)
Reviewed-by: Simon Glass <[email protected]>

