mtd: rawnand: cadence: fix the calculation of the avaialble OOB size
authorPiotr Sroka <piotrs@cadence.com>
Mon, 10 Feb 2020 09:55:26 +0000 (10:55 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 11 Mar 2020 15:17:55 +0000 (16:17 +0100)
commite4578af0354176ff6b4ae78b9998b4f479f7c31c
tree6eb4f6b858cf40efc636432aee5f065058f331f6
parent397deafc02e1b91668fa1ee95fdd52d14fa82135
mtd: rawnand: cadence: fix the calculation of the avaialble OOB size

The value of cdns_chip->sector_count is not known at the moment
of the derivation of ecc_size, leading to a zero value. Fix
this by assigning ecc_size later in the code.

Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Cc: stable@vger.kernel.org
Signed-off-by: Piotr Sroka <piotrs@cadence.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/1581328530-29966-2-git-send-email-piotrs@cadence.com
drivers/mtd/nand/raw/cadence-nand-controller.c