Using switch/case helps make this logic more clear and more robust. With
this structure:
* it's clear that this driver only support ECC_{HW,SOFT,SOFT_BCH}; and
* we can sanely handle new ECC unsupported modes (right now, this code
makes incorrect assumptions about the possible values in the
nand_ecc_modes_t enum; e.g., what happens with NAND_ECC_HW_OOB_FIRST?)
Signed-off-by: Brian Norris <[email protected]>
Cc: Alex Smith <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Tested-by: Harvey Hunt <[email protected]>
Acked-by: Harvey Hunt <[email protected]>