Free the SPI resources by calling spi_flash_free() in each env sf
function to avoid issue for other SPI users.
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
printf("Valid environment: %d\n", (int)gd->env_valid);
done:
+ spi_flash_free(env_flash);
+ env_flash = NULL;
+
if (saved_buffer)
free(saved_buffer);
puts("done\n");
done:
+ spi_flash_free(env_flash);
+ env_flash = NULL;
+
if (saved_buffer)
free(saved_buffer);
gd->env_addr = (unsigned long)&tmp_env1->data;
}
+ spi_flash_free(env_flash);
+ env_flash = NULL;
+
return 0;
err_read:
spi_flash_free(env_flash);