mtd: rawnand: Add nand_extract_bits()
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 19 May 2020 07:45:45 +0000 (09:45 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Sun, 24 May 2020 20:34:55 +0000 (22:34 +0200)
commitd7904619ea0636411f40fb1f34057288c0783ecf
tree4f60bc86a5fee1ebabd8c2d0eb3c2ddcb60d5d05
parent0651ed5082bc5af45be9f79cabcbc32c1cf4e599
mtd: rawnand: Add nand_extract_bits()

There are cases where ECC bytes are not byte-aligned. Indeed, BCH
implies using a number of ECC bits, which are not always a multiple of
8. We then need a helper like nand_extract_bits() to extract these
syndromes from a buffer.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-5-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/nand_base.c
include/linux/mtd/rawnand.h