mtd: spi-nor: Rework hwcaps selection for the spi-mem case
authorBoris Brezillon <boris.brezillon@bootlin.com>
Tue, 6 Aug 2019 05:10:41 +0000 (10:40 +0530)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Mon, 12 Aug 2019 08:02:54 +0000 (11:02 +0300)
commitc76f5089796a948e8daaeda348040a3f98b18748
tree02836de86b0732548952b8dc7dabec721deb44c8
parentb35b9a10362d203451d920d01ab8d6cd55cbaf2a
mtd: spi-nor: Rework hwcaps selection for the spi-mem case

The spi-mem layer provides a spi_mem_supports_op() function to check
whether a specific operation is supported by the controller or not.
This is much more accurate than the hwcaps selection logic based on
SPI_{RX,TX}_ flags.

Rework the hwcaps selection logic to use spi_mem_supports_op() when
nor->spimem != NULL.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
drivers/mtd/spi-nor/spi-nor.c
include/linux/mtd/spi-nor.h