1 From b5929f91416d64afacf46c649f38cc8f0eea50d2 Mon Sep 17 00:00:00 2001
2 From: Michal Suchanek <hramrach@gmail.com>
3 Date: Wed, 2 Dec 2015 10:38:20 +0000
4 Subject: [PATCH 096/113] mtd: spi-nor: add read loop
6 mtdblock and ubi do not handle the situation when read returns less data
7 than requested. Loop in spi-nor until buffer is filled or an error is
10 Signed-off-by: Michal Suchanek <hramrach@gmail.com>
11 Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@freescale.com>
13 drivers/mtd/spi-nor/spi-nor.c | 20 ++++++++++++++------
14 1 file changed, 14 insertions(+), 6 deletions(-)
16 --- a/drivers/mtd/spi-nor/spi-nor.c
17 +++ b/drivers/mtd/spi-nor/spi-nor.c
18 @@ -920,14 +920,22 @@ static int spi_nor_read(struct mtd_info
22 - ret = nor->read(nor, from, len, buf);
24 + ret = nor->read(nor, from, len, buf);
28 - spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ);
42 + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ);
46 static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,