mtd: rawnand: meson: always use OOB bytes during write
authorArseniy Krasnov <avkrasnov@salutedevices.com>
Sun, 22 Dec 2024 21:23:29 +0000 (00:23 +0300)
committerMichael Trimarchi <michael@amarulasolutions.com>
Sun, 16 Mar 2025 13:02:05 +0000 (14:02 +0100)
commit448d27f6adf6de576860fdb9c3c4ecbe51819e33
tree941e5758919265074ac17684f7dc48d822ab9e9a
parente8741c9339be82931e18e6fb71fe65ab76a4ac07
mtd: rawnand: meson: always use OOB bytes during write

If 'oob_required' is not set by the caller (for example 'oobbuf' is NULL),
then driver doesn't copy OOB data from 'oob_poi' to special controller
structures, so zeroes will be written as OOB. But, generic raw NAND logic
in 'nand_base.c' already handles case when OOB is not required to write by
filling 'oob_poi' with 0xFF's. So let's remove 'oob_required' check to
always read 'oob_poi' data for OOB.

Kernel driver (drivers/mtd/nand/raw/meson_nand.c) works in the same way,
so need to keep same behaviour here.

Fixes: c2e8c4d09a7a ("mtd: rawnand: Meson NAND controller support")
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
drivers/mtd/nand/raw/meson_nand.c