Commit 127aae60 authored by Miquel Raynal's avatar Miquel Raynal

mtd: nand: ecc-bch: Drop mtd_nand_has_bch()

Like for any other compilation option, use the IS_ENABLED() macro
instead of hardcoding it.

By droping this helper we can get rid of the BCH header in nandsim.c.
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-7-miquel.raynal@bootlin.com
parent e3010bd3
...@@ -5231,7 +5231,7 @@ static int nand_set_ecc_soft_ops(struct nand_chip *chip) ...@@ -5231,7 +5231,7 @@ static int nand_set_ecc_soft_ops(struct nand_chip *chip)
return 0; return 0;
case NAND_ECC_ALGO_BCH: case NAND_ECC_ALGO_BCH:
if (!mtd_nand_has_bch()) { if (!IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_BCH)) {
WARN(1, "CONFIG_MTD_NAND_ECC_SW_BCH not enabled\n"); WARN(1, "CONFIG_MTD_NAND_ECC_SW_BCH not enabled\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h> #include <linux/mtd/rawnand.h>
#include <linux/mtd/nand-ecc-sw-bch.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/list.h> #include <linux/list.h>
...@@ -2214,7 +2213,7 @@ static int ns_attach_chip(struct nand_chip *chip) ...@@ -2214,7 +2213,7 @@ static int ns_attach_chip(struct nand_chip *chip)
if (!bch) if (!bch)
return 0; return 0;
if (!mtd_nand_has_bch()) { if (!IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_BCH)) {
NS_ERR("BCH ECC support is disabled\n"); NS_ERR("BCH ECC support is disabled\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -13,8 +13,6 @@ struct nand_chip; ...@@ -13,8 +13,6 @@ struct nand_chip;
#if IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_BCH) #if IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_BCH)
static inline int mtd_nand_has_bch(void) { return 1; }
/* /*
* Calculate BCH ecc code * Calculate BCH ecc code
*/ */
...@@ -37,8 +35,6 @@ void nand_bch_free(struct nand_chip *chip); ...@@ -37,8 +35,6 @@ void nand_bch_free(struct nand_chip *chip);
#else /* !CONFIG_MTD_NAND_ECC_SW_BCH */ #else /* !CONFIG_MTD_NAND_ECC_SW_BCH */
static inline int mtd_nand_has_bch(void) { return 0; }
static inline int static inline int
nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat, nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat,
u_char *ecc_code) u_char *ecc_code)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment