clean_bar() function selecting bank zero but not setting the flash current bank to zero. After erase operation, bank zero is selected but the flash current bank is pointing to bank one. So, during write operation, while trying to write bank one, it actually writes in bank zero. This patch fixed this issue by setting the current bank of flash to zero after doing clear_bar() after erase, write and read operations. Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com> Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>