On Tue, 27 Nov 2018 at 13:09, Simon Goldschmidt <simon.k.r.goldschm...@gmail.com> wrote: > > In spi_flash.c, if CONFIG_SPI_FLASH_BAR is enabled, the function > 'clean_bar' makes sure that the Bank Address Register is reset at the > end of functions using it. > > However, if this is enabled, those functions may return zero (success) > when they should return an error. This is because after e.g. > 'spi_flash_read_common' fails, the return value in 'ret' is overwritten > with the return value of 'clean_bar'. > > Fix this by changing 'clean_bar' to take the outer error code into > account and returning its own return value only if the outer error code > is 0. > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschm...@gmail.com> > --- > > drivers/mtd/spi/spi_flash.c | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-)
Reviewed-by: Simon Glass <s...@chromium.org> _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot