diff options
author | Wolfram Sang <wsa@kernel.org> | 2020-12-07 07:57:42 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2020-12-07 07:57:42 +0100 |
commit | 1e04538c751bfc572bfa9995996c7f4af098a625 (patch) | |
tree | 40aa603803f857af4a5a5f25f81b6fb31b8e0152 /drivers/mtd/nand/raw/cs553x_nand.c | |
parent | 5e9a97b1f4491b8b65874901ad084348fcaba327 (diff) | |
parent | 0477e92881850d44910a7e94fc2c46f96faa131f (diff) |
Merge branch 'i2c/for-current' into i2c/for-5.11
Diffstat (limited to 'drivers/mtd/nand/raw/cs553x_nand.c')
-rw-r--r-- | drivers/mtd/nand/raw/cs553x_nand.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c index b7f3f6347761..282203debd0c 100644 --- a/drivers/mtd/nand/raw/cs553x_nand.c +++ b/drivers/mtd/nand/raw/cs553x_nand.c @@ -243,8 +243,24 @@ static int cs_calculate_ecc(struct nand_chip *this, const u_char *dat, static struct cs553x_nand_controller *controllers[4]; +static int cs553x_attach_chip(struct nand_chip *chip) +{ + if (chip->ecc.engine_type != NAND_ECC_ENGINE_TYPE_ON_HOST) + return 0; + + chip->ecc.size = 256; + chip->ecc.bytes = 3; + chip->ecc.hwctl = cs_enable_hwecc; + chip->ecc.calculate = cs_calculate_ecc; + chip->ecc.correct = nand_correct_data; + chip->ecc.strength = 1; + + return 0; +} + static const struct nand_controller_ops cs553x_nand_controller_ops = { .exec_op = cs553x_exec_op, + .attach_chip = cs553x_attach_chip, }; static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) @@ -286,14 +302,6 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) goto out_mtd; } - this->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST; - this->ecc.size = 256; - this->ecc.bytes = 3; - this->ecc.hwctl = cs_enable_hwecc; - this->ecc.calculate = cs_calculate_ecc; - this->ecc.correct = nand_correct_data; - this->ecc.strength = 1; - /* Enable the following for a flash based bad block table */ this->bbt_options = NAND_BBT_USE_FLASH; |