mtd: spi: Replace ad-hoc default implementation with spi_mem_op
authorMarek Vasut <marek.vasut@gmail.com>
Tue, 2 Apr 2019 00:52:53 +0000 (02:52 +0200)
committerJagan Teki <jagan@amarulasolutions.com>
Fri, 12 Apr 2019 06:12:48 +0000 (11:42 +0530)
commitf909ddb3e1770a5ef18606b46000e0d3eaf63b2e
tree12e1bdaac619b8b6674b58804bf67e65e39c04dc
parent40264c0ca89a6953e05e89b6abe491f4b6e4a149
mtd: spi: Replace ad-hoc default implementation with spi_mem_op

Replace the ad-hoc erase operation implementation with a simple spi_mem_op
implementation of the same functionality. This is a minor optimization and
removal of the ad-hoc code.

This however also changes the behavior of the execution of the erase
opcode from two separate transfer requests to the SPI NOR driver to
one transfer request to the SPI NOR driver. The former was how U-Boot
behaved before the SPI NOR framework was imported and the later was
introduced by the SPI NOR framework. The former is more optimal, so
keep that.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: Jagan Teki <jagan@openedev.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Vignesh R <vigneshr@ti.com>
Tested-by: Ashish Kumar <Ashish.kumar@nxp.com>
drivers/mtd/spi/spi-nor-core.c