mtd: spi-nor: Add a ->convert_addr() method
authorBoris Brezillon <boris.brezillon@bootlin.com>
Sat, 24 Aug 2019 07:17:20 +0000 (10:17 +0300)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Wed, 28 Aug 2019 09:40:29 +0000 (12:40 +0300)
commit36499596280359d34a0663afe0abbf34d80862e8
tree53eb5f588a93d341d4589e1dc570104a17409d70
parent92094ebc385ef52d45e27d23e9a7c32abf8df44e
mtd: spi-nor: Add a ->convert_addr() method

In order to separate manufacturer quirks from the core we need to get
rid of all the manufacturer specific flags, like the
SNOR_F_S3AN_ADDR_DEFAULT one.

This can easily be replaced by a ->convert_addr() hook, which when
implemented will provide the core with an easy way to convert an
absolute address into something the flash understands.

Right now the only user are the S3AN chips, but other manufacturers
can implement it if needed.

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