mtd: nand: cafe: remove use of NAND_OWN_BUFFERS
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 5 Dec 2017 08:47:14 +0000 (17:47 +0900)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 14 Dec 2017 12:34:18 +0000 (13:34 +0100)
commitf880b07bf155226af8491d58558a41f2cf5245dc
tree43169a666304073becee0d491e6f88567a9a5d44
parent17fa8044188c152e8a3b9493f8b8054cacbfb9ba
mtd: nand: cafe: remove use of NAND_OWN_BUFFERS

This driver is the last/only user of NAND_OWN_BUFFERS.  Boris suggested
to remove this flag.

Taking a closer look at this driver, it calls dma_alloc_coherent() for
the concatenated area for the DMA bounce buffer + struct nand_buffers,
but the latter does not need to be DMA-coherent; cafe_{write,read}_buf
simply do memcpy() between buffers when usedma==1.

Let's do dma_alloc_coherent() for the DMA bounce buffer in the front,
and leave the nand_buffers allocation to nand_scan_tail(), then rip off
NAND_OWN_BUFFERS.

The magic number, 2112, is still mysterious (hard-coded writesize +
oobsize ?), but this is not our main interest.  I am keeping it.

Suggested-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/cafe_nand.c