Commit e0a564ae authored by Miquel Raynal's avatar Miquel Raynal
Browse files

mtd: rawnand: Rename the ECC algorithm enumeration items



NAND_ECC_ is not a meaningful prefix, use NAND_ECC_ALGO_ instead.

Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200827085208.16276-3-miquel.raynal@bootlin.com
parent 2da45b8f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ static int gpio_nand_probe(struct platform_device *pdev)
	}

	this->ecc.mode = NAND_ECC_SOFT;
	this->ecc.algo = NAND_ECC_HAMMING;
	this->ecc.algo = NAND_ECC_ALGO_HAMMING;

	platform_set_drvdata(pdev, priv);

+1 −1
Original line number Diff line number Diff line
@@ -983,7 +983,7 @@ static int anfc_init_hw_ecc_controller(struct arasan_nfc *nfc,
	mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops);

	ecc->steps = mtd->writesize / ecc->size;
	ecc->algo = NAND_ECC_BCH;
	ecc->algo = NAND_ECC_ALGO_BCH;
	anand->ecc_bits = bch_gf_mag * ecc->strength;
	ecc->bytes = DIV_ROUND_UP(anand->ecc_bits, 8);
	anand->ecc_total = DIV_ROUND_UP(anand->ecc_bits * ecc->steps, 8);
+1 −1
Original line number Diff line number Diff line
@@ -1099,7 +1099,7 @@ static int atmel_nand_pmecc_init(struct nand_chip *chip)
	if (IS_ERR(nand->pmecc))
		return PTR_ERR(nand->pmecc);

	chip->ecc.algo = NAND_ECC_BCH;
	chip->ecc.algo = NAND_ECC_ALGO_BCH;
	chip->ecc.size = req.ecc.sectorsize;
	chip->ecc.bytes = req.ecc.bytes / req.ecc.nsectors;
	chip->ecc.strength = req.ecc.strength;
+1 −1
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ static int au1550nd_probe(struct platform_device *pdev)
	ctx->controller.ops = &au1550nd_ops;
	this->controller = &ctx->controller;
	this->ecc.mode = NAND_ECC_SOFT;
	this->ecc.algo = NAND_ECC_HAMMING;
	this->ecc.algo = NAND_ECC_ALGO_HAMMING;

	if (pd->devwidth)
		this->options |= NAND_BUSWIDTH_16;
+6 −6
Original line number Diff line number Diff line
@@ -2571,17 +2571,17 @@ static int brcmnand_setup_dev(struct brcmnand_host *host)
		return -EINVAL;
	}

	if (chip->ecc.algo == NAND_ECC_UNKNOWN) {
	if (chip->ecc.algo == NAND_ECC_ALGO_UNKNOWN) {
		if (chip->ecc.strength == 1 && chip->ecc.size == 512)
			/* Default to Hamming for 1-bit ECC, if unspecified */
			chip->ecc.algo = NAND_ECC_HAMMING;
			chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
		else
			/* Otherwise, BCH */
			chip->ecc.algo = NAND_ECC_BCH;
			chip->ecc.algo = NAND_ECC_ALGO_BCH;
	}

	if (chip->ecc.algo == NAND_ECC_HAMMING && (chip->ecc.strength != 1 ||
						   chip->ecc.size != 512)) {
	if (chip->ecc.algo == NAND_ECC_ALGO_HAMMING &&
	    (chip->ecc.strength != 1 || chip->ecc.size != 512)) {
		dev_err(ctrl->dev, "invalid Hamming params: %d bits per %d bytes\n",
			chip->ecc.strength, chip->ecc.size);
		return -EINVAL;
@@ -2600,7 +2600,7 @@ static int brcmnand_setup_dev(struct brcmnand_host *host)

	switch (chip->ecc.size) {
	case 512:
		if (chip->ecc.algo == NAND_ECC_HAMMING)
		if (chip->ecc.algo == NAND_ECC_ALGO_HAMMING)
			cfg->ecc_level = 15;
		else
			cfg->ecc_level = chip->ecc.strength;
Loading