mtd: spi-nor: simplify write loop
authorMichal Suchanek <hramrach@gmail.com>
Fri, 6 May 2016 00:31:54 +0000 (17:31 -0700)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 2 Jun 2016 00:22:57 +0000 (17:22 -0700)
commite5d05cbd6d8b01f08c95c427a36c66aac769af4f
tree1f7a9f10bbbf61fc2c6d64adddc0a12072e31bae
parent2dd087b16946cf168f401526adf26afa771bb740
mtd: spi-nor: simplify write loop

The spi-nor write loop assumes that what is passed to the hardware
driver write() is what gets written.

When write() writes less than page size at once data is dropped on the
floor. Check the amount of data writen and exit if it does not match
requested amount.

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Tested-by Cyrille Pitchen <cyrille.pitchen@atmel.com>
Acked-by: Michal Suchanek <hramrach@gmail.com>
Tested-by: Michal Suchanek <hramrach@gmail.com>
drivers/mtd/spi-nor/spi-nor.c