spi: bcm-qspi: Remove hardcoded settings and spi-nor.h dependency
authorKamal Dasu <kdasu.kdev@gmail.com>
Wed, 26 Jul 2017 23:20:15 +0000 (19:20 -0400)
committerMark Brown <broonie@kernel.org>
Fri, 28 Jul 2017 10:11:35 +0000 (11:11 +0100)
commit054e532f8f90daaf9d70a2cf2ce31e69a4e68031
tree8d7851d73ffbcd21f94220db2ae2e0cdf2146ffd
parent5771a8c08880cdca3bfb4a3fc6d309d6bba20877
spi: bcm-qspi: Remove hardcoded settings and spi-nor.h dependency

The newly added broadcom qspi driver in drivers/spi produces a build
warning when CONFIG_MTD is disabled:
include/linux/mtd/cfi.h:76:2: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work. [-Werror=cpp]

There has been discussion on this in the link provided below. This fix in
SPI controller drivers implementing the ->spi_flash_read handler, now uses the
settings provided inside the 'struct spi_flash_read_message' parameter instead
of hardcoding them. Made changes to bcm_qspi_bspi_set_flex_mode() to set the BSPI
controller using the passed msg structure and remove the need to include
<linux/mtd/spi-nor.h> file by removing all use of SPINOR_OP_READ* macros.

Fixes: 4e3b2d236fe0 ("spi: bcm-qspi: Add BSPI spi-nor flash controller driver")
Link: https://patchwork.kernel.org/patch/9624585/
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm-qspi.c