Skip to content
Commit 03a0e8a7 authored by Boris BREZILLON's avatar Boris BREZILLON Committed by Brian Norris
Browse files

mtd: nand: sunxi: fix OOB handling in ->write_xxx() functions



The USER_DATA register cannot be accessed using byte accessors on A13
SoCs, thus triggering a bug when using memcpy_toio on this register.
Declare an helper macros to convert an OOB buffer into a suitable
USER_DATA value and vice-versa.

This patch also fixes an error in the oob_required logic (some OOB data
are not written even if the user required it) by removing the
oob_required condition, which is perfectly valid since the core already
fill ->oob_poi with FFs when oob_required is false.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Cc: <stable@vger.kernel.org> # 3.19+
Fixes: 1fef62c1

 ("mtd: nand: add sunxi NAND flash controller support")
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 6ff33f39
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment