Skip to content
Commit 9146cbd5 authored by Brian Norris's avatar Brian Norris
Browse files

mtd: jz4780_nand: replace if/else blocks with switch/case



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: default avatarBrian Norris <computersforpeace@gmail.com>
Cc: Alex Smith <alex@alex-smith.me.uk>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: default avatarHarvey Hunt <harvey.hunt@imgtec.com>
Acked-by: default avatarHarvey Hunt <harvey.hunt@imgtec.com>
parent 6c1207b5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment