From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 03/15] mtd: nand: prefix enum nand_ecc_algo constants with NAND_ECC_ALGO_
Date: Wed, 11 Jan 2023 18:40:11 +0100 [thread overview]
Message-ID: <20230111174023.1719129-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230111174023.1719129-1-a.fatoum@pengutronix.de>
This aligns us with how Linux now names these constants.
No functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/mtd/nand/nand_base.c | 26 +++++++++++++-------------
drivers/mtd/nand/nand_fsl_ifc.c | 2 +-
drivers/mtd/nand/nand_micron.c | 2 +-
include/linux/mtd/rawnand.h | 8 ++++----
4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c3cd22935bb2..b686cef79bc6 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -4936,9 +4936,9 @@ free_detect_allocation:
}
static const char * const nand_ecc_algos[] = {
- [NAND_ECC_HAMMING] = "hamming",
- [NAND_ECC_BCH] = "bch",
- [NAND_ECC_RS] = "rs",
+ [NAND_ECC_ALGO_HAMMING] = "hamming",
+ [NAND_ECC_ALGO_BCH] = "bch",
+ [NAND_ECC_ALGO_RS] = "rs",
};
static enum nand_ecc_algo of_get_nand_ecc_algo(struct device_node *np)
@@ -4949,7 +4949,7 @@ static enum nand_ecc_algo of_get_nand_ecc_algo(struct device_node *np)
err = of_property_read_string(np, "nand-ecc-algo", &pm);
if (!err) {
- for (ecc_algo = NAND_ECC_HAMMING;
+ for (ecc_algo = NAND_ECC_ALGO_HAMMING;
ecc_algo < ARRAY_SIZE(nand_ecc_algos);
ecc_algo++) {
if (!strcasecmp(pm, nand_ecc_algos[ecc_algo]))
@@ -4964,12 +4964,12 @@ static enum nand_ecc_algo of_get_nand_ecc_algo(struct device_node *np)
err = of_property_read_string(np, "nand-ecc-mode", &pm);
if (!err) {
if (!strcasecmp(pm, "soft"))
- return NAND_ECC_HAMMING;
+ return NAND_ECC_ALGO_HAMMING;
else if (!strcasecmp(pm, "soft_bch"))
- return NAND_ECC_BCH;
+ return NAND_ECC_ALGO_BCH;
}
- return NAND_ECC_UNKNOWN;
+ return NAND_ECC_ALGO_UNKNOWN;
}
static int nand_dt_init(struct nand_chip *chip)
@@ -4998,7 +4998,7 @@ static int nand_dt_init(struct nand_chip *chip)
if (ecc_mode >= 0)
chip->ecc.mode = ecc_mode;
- if (ecc_algo != NAND_ECC_UNKNOWN)
+ if (ecc_algo != NAND_ECC_ALGO_UNKNOWN)
chip->ecc.algo = ecc_algo;
if (ecc_strength >= 0)
@@ -5127,7 +5127,7 @@ static int nand_set_ecc_soft_ops(struct nand_chip *chip)
return -EINVAL;
switch (ecc->algo) {
- case NAND_ECC_HAMMING:
+ case NAND_ECC_ALGO_HAMMING:
ecc->calculate = nand_calculate_ecc;
ecc->correct = nand_correct_data;
ecc->read_page = nand_read_page_swecc;
@@ -5148,7 +5148,7 @@ static int nand_set_ecc_soft_ops(struct nand_chip *chip)
ecc->options |= NAND_ECC_SOFT_HAMMING_SM_ORDER;
return 0;
- case NAND_ECC_BCH:
+ case NAND_ECC_ALGO_BCH:
if (!mtd_nand_has_bch()) {
WARN(1, "CONFIG_MTD_NAND_ECC_SW_BCH not enabled\n");
return -EINVAL;
@@ -5588,7 +5588,7 @@ int nand_scan_tail(struct nand_chip *chip)
* If no default placement scheme is given, select an appropriate one.
*/
if (!mtd->ooblayout &&
- !(ecc->mode == NAND_ECC_SOFT && ecc->algo == NAND_ECC_BCH)) {
+ !(ecc->mode == NAND_ECC_SOFT && ecc->algo == NAND_ECC_ALGO_BCH)) {
switch (mtd->oobsize) {
case 8:
case 16:
@@ -5684,7 +5684,7 @@ int nand_scan_tail(struct nand_chip *chip)
pr_warn("%d byte HW ECC not possible on %d byte page size, fallback to SW ECC\n",
ecc->size, mtd->writesize);
ecc->mode = NAND_ECC_SOFT;
- ecc->algo = NAND_ECC_HAMMING;
+ ecc->algo = NAND_ECC_ALGO_HAMMING;
case NAND_ECC_SOFT:
ret = nand_set_ecc_soft_ops(chip);
if (ret) {
@@ -5935,7 +5935,7 @@ EXPORT_SYMBOL(nand_scan_with_ids);
void nand_cleanup(struct nand_chip *chip)
{
if (chip->ecc.mode == NAND_ECC_SOFT &&
- chip->ecc.algo == NAND_ECC_BCH)
+ chip->ecc.algo == NAND_ECC_ALGO_BCH)
nand_bch_free((struct nand_bch_control *)chip->ecc.priv);
nanddev_cleanup(&chip->base);
diff --git a/drivers/mtd/nand/nand_fsl_ifc.c b/drivers/mtd/nand/nand_fsl_ifc.c
index 74bc9fe1edfd..8eef77e93c2f 100644
--- a/drivers/mtd/nand/nand_fsl_ifc.c
+++ b/drivers/mtd/nand/nand_fsl_ifc.c
@@ -964,7 +964,7 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
mtd_set_ooblayout(mtd, &fsl_ifc_ooblayout_ops);
} else {
nand->ecc.mode = NAND_ECC_SOFT;
- nand->ecc.algo = NAND_ECC_HAMMING;
+ nand->ecc.algo = NAND_ECC_ALGO_HAMMING;
}
if (ctrl->version >= FSL_IFC_V1_1_0) {
diff --git a/drivers/mtd/nand/nand_micron.c b/drivers/mtd/nand/nand_micron.c
index d59be7ca7b02..4401a55886b2 100644
--- a/drivers/mtd/nand/nand_micron.c
+++ b/drivers/mtd/nand/nand_micron.c
@@ -544,7 +544,7 @@ static int micron_nand_init(struct nand_chip *chip)
chip->ecc.bytes = chip->base.eccreq.strength * 2;
chip->ecc.size = 512;
chip->ecc.strength = chip->base.eccreq.strength;
- chip->ecc.algo = NAND_ECC_BCH;
+ chip->ecc.algo = NAND_ECC_ALGO_BCH;
chip->ecc.read_page = micron_nand_read_page_on_die_ecc;
chip->ecc.write_page = micron_nand_write_page_on_die_ecc;
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index a05c67e1404b..87e37fa9a349 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -96,10 +96,10 @@ enum nand_ecc_mode {
};
enum nand_ecc_algo {
- NAND_ECC_UNKNOWN,
- NAND_ECC_HAMMING,
- NAND_ECC_BCH,
- NAND_ECC_RS,
+ NAND_ECC_ALGO_UNKNOWN,
+ NAND_ECC_ALGO_HAMMING,
+ NAND_ECC_ALGO_BCH,
+ NAND_ECC_ALGO_RS,
};
/*
--
2.30.2
next prev parent reply other threads:[~2023-01-11 17:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 17:40 [PATCH 00/15] mtd: nand: atmel: import Linux NAND controller driver Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 01/15] asm-generic: io.h: sync with Linux Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 02/15] mtd: nand: base: implement nand_gpio_waitrdy Ahmad Fatoum
2023-01-11 17:40 ` Ahmad Fatoum [this message]
2023-01-11 17:40 ` [PATCH 04/15] mtd: nand: rename nand_device::eccreq to Linux' ecc.requirements Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 05/15] mtd: nand: define nand_get_(small|large)_page_ooblayout Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 06/15] mtd: nand: define nand_interface_is_sdr Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 07/15] mtd: nand: provide Linux' struct nand_ecc_ctrl::engine_type Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 08/15] driver: implement dev_request_resource Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 09/15] lib: provide stub Linux "generic" allocator API Ahmad Fatoum
2023-01-12 13:26 ` Sascha Hauer
2023-01-11 17:40 ` [PATCH 10/15] memory: add Atmel EBI driver Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 11/15] mfd: add atmel-smc driver Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 12/15] mtd: nand: atmel: import Linux NAND controller driver Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 13/15] ARM: AT91: sama5d3_xplained: switch to upstream binding Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 14/15] mtd: nand: drop DT support in legacy driver Ahmad Fatoum
2023-01-11 17:40 ` [PATCH 15/15] ARM: AT91: sama5d3: always read memory size from controller Ahmad Fatoum
2023-01-12 14:22 ` [PATCH 00/15] mtd: nand: atmel: import Linux NAND controller driver Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230111174023.1719129-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox