Skip to content

Commit

Permalink
mtd: rawnand: txx9ndfmc: Fix external use of SW Hamming ECC helper
Browse files Browse the repository at this point in the history
Since the Hamming software ECC engine has been updated to become a
proper and independent ECC engine, it is now mandatory to either
initialize the engine before using any one of his functions or use one
of the bare helpers which only perform the calculations. As there is no
actual need for a proper ECC initialization, let's just use the bare
helper instead of the rawnand one.

Fixes: 90ccf0a ("mtd: nand: ecc-hamming: Rename the exported functions")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210413161840.345208-8-miquel.raynal@bootlin.com
  • Loading branch information
Miquel Raynal committed May 10, 2021
1 parent 6a4c5ad commit 3d227a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/mtd/nand/raw/txx9ndfmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand-ecc-sw-hamming.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/io.h>
Expand Down Expand Up @@ -193,8 +194,8 @@ static int txx9ndfmc_correct_data(struct nand_chip *chip, unsigned char *buf,
int stat;

for (eccsize = chip->ecc.size; eccsize > 0; eccsize -= 256) {
stat = rawnand_sw_hamming_correct(chip, buf, read_ecc,
calc_ecc);
stat = ecc_sw_hamming_correct(buf, read_ecc, calc_ecc,
chip->ecc.size, false);
if (stat < 0)
return stat;
corrected += stat;
Expand Down

0 comments on commit 3d227a0

Please sign in to comment.