]> git.baikalelectronics.ru Git - uboot.git/commit
common: command: Rework the 'cmd is repeatable' logic
authorBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 3 Dec 2018 21:54:20 +0000 (22:54 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Jan 2019 20:28:54 +0000 (15:28 -0500)
commit6e37bb8f7a21084eea386fb7328cb1f008786dbd
treea31c7ac2e2b5f238dd127b8b7c86c199452d2adb
parent2228caa2fa3bb815447dffec4fa81aebd800aba3
common: command: Rework the 'cmd is repeatable' logic

The repeatable property is currently attached to the main command and
sub-commands have no way to change the repeatable value (the
->repeatable field in sub-command entries is ignored).

Replace the ->repeatable field by an extended ->cmd() hook (called
->cmd_rep()) which takes a new int pointer to store the repeatable cap
of the command being executed.

With this trick, we can let sub-commands decide whether they are
repeatable or not.

We also patch mmc and dtimg who are testing the ->repeatable field
directly (they now use cmd_is_repeatable() instead), and fix the help
entry manually since it doesn't use the U_BOOT_CMD() macro.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
cmd/dtimg.c
cmd/help.c
cmd/mmc.c
common/command.c
include/command.h