Skip to content

Commit 4665d9f

Browse files
committed
Revert "[FIO internal] arm64: zynqmp: bootslot: clean-up after spi ops"
This reverts commit 3fe566f. Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
1 parent ea1096e commit 4665d9f

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

arch/arm/mach-zynqmp/cmd_bootslot.c

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -216,22 +216,18 @@ static int do_bootslot(struct cmd_tbl *cmdtp, int flag,
216216

217217
ret = init_spi_flash(&flash);
218218
if (ret) {
219-
printf("Can't init spi flash\n");
219+
printf("Can't init spi flash");
220220
return CMD_RET_FAILURE;
221221
}
222222

223223
ret = read_persistent_info(flash);
224-
if (ret) {
225-
printf("Can't read spi flash\n");
226-
ret = CMD_RET_FAILURE;
227-
goto free_spi;
228-
}
224+
if (ret)
225+
return CMD_RET_FAILURE;
229226

230227
/* If we just want to retrieve current persistent data info */
231228
if (argc == 1) {
232229
print_persistent_info();
233-
ret = CMD_RET_SUCCESS;
234-
goto free_spi;
230+
return CMD_RET_SUCCESS;
235231
}
236232

237233
slot_a = simple_strtoul(argv[1], NULL, 10);
@@ -240,24 +236,17 @@ static int do_bootslot(struct cmd_tbl *cmdtp, int flag,
240236

241237
if ((slot_a != 0 && slot_a != 1) ||
242238
(slot_b != 0 && slot_b != 1) ||
243-
(requested_slot != 0 && requested_slot != 1)) {
244-
ret = CMD_RET_USAGE;
245-
goto free_spi;
246-
}
239+
(requested_slot != 0 && requested_slot != 1))
240+
return CMD_RET_USAGE;
247241

248242
ret = update_persistent_info(flash, slot_a, slot_b, requested_slot);
249243
if (ret) {
250244
printf("Update of persistent registers failed\n");
251-
ret = CMD_RET_FAILURE;
252-
goto free_spi;
245+
return CMD_RET_FAILURE;
253246
}
254-
255247
print_persistent_info();
256248

257-
free_spi:
258-
spi_flash_free(flash);
259-
260-
return ret;
249+
return CMD_RET_SUCCESS;
261250
}
262251

263252
U_BOOT_CMD(

0 commit comments

Comments
 (0)