[PATCH v4 07/10] cmd: ubi: reorganize command messages
Simon Glass
sjg at chromium.org
Fri May 15 14:56:50 CEST 2026
On 2026-05-13T08:02:45, Weijie Gao <weijie.gao at mediatek.com> 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 <weijie.gao at mediatek.com>
>
> cmd/ubi.c | 118 ++++++++++++++++++++++++++++++++++++++++++--------------------
> 1 file changed, 80 insertions(+), 38 deletions(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list