From: Patrick Delaunay Date: Tue, 6 Sep 2022 16:53:17 +0000 (+0200) Subject: stm32mp: stm32prog: support empty flashlayout X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=4d7df7f7666a2bc6b0b8980969b69c8008b90af6;p=u-boot.git stm32mp: stm32prog: support empty flashlayout When the STM32CubeProgrammer sent a empty flashlayout.tsv file, the command stm32prog correctly parse the file but data->dev_nb = 0 and the stm32prog_devices_init operations should be skipped. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index a720d0ba71..7067605d49 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -1884,6 +1884,10 @@ static void stm32prog_devices_init(struct stm32prog_data *data) if (ret) goto error; + /* empty flashlayout */ + if (!data->dev_nb) + return; + /* initialize the selected device */ for (i = 0; i < data->dev_nb; i++) { ret = init_device(data, &data->dev[i]);