[PATCH] cmd: mmc: allow 'mmc rst-function' to show the current value

Simon Glass sjg at chromium.org
Mon Apr 13 15:35:22 CEST 2026


Hi Rasmus,

On 2026-04-13T08:13:22, Rasmus Villemoes <ravi at prevas.dk> wrote:
> cmd: mmc: allow 'mmc rst-function' to show the current value
>
> Extend the 'mmc rst-function' subcommand so that lacking a value to
> set, it simply prints the current value, and its interpretation.
>
> Signed-off-by: Rasmus Villemoes <ravi at prevas.dk>
>
> cmd/mmc.c             | 36 +++++++++++++++++++++++++++---------
>  doc/usage/cmd/mmc.rst |  4 ++--
>  2 files changed, 29 insertions(+), 11 deletions(-)

> diff --git a/cmd/mmc.c b/cmd/mmc.c
> @@ -1032,6 +1026,30 @@ static int do_mmc_rst_func(...)
> +             switch (ext_csd[EXT_CSD_RST_N_FUNCTION]) {
> +             case 0x0: puts("(temporarily disabled)\n"); break;
> +             case 0x1: puts("(permanently enabled)\n"); break;
> +             case 0x2: puts("(permanently disabled)\n"); break;
> +             default: puts("(unknown)\n");
> +             }

We normally put case/default on their own line, as elsewhere in this file.

I'd even suggest putting this code in its own function.

Regards,
Simon


More information about the U-Boot mailing list