OSDN Git Service

mtd: nand: omap: ecc.correct: omap_elm_correct_data: cleanup for future enhancements
authorPekon Gupta <pekon@ti.com>
Tue, 18 Mar 2014 13:26:45 +0000 (18:56 +0530)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 20 Mar 2014 08:47:59 +0000 (01:47 -0700)
commitb08e1f632c79e9e75bf2ae58107df27d0e35b459
tree71aa976cc0bdb13dddc258f893015aca6d3c60e1
parent78f43c53835076f342133e6d2d6e577d6ae06480
mtd: nand: omap: ecc.correct: omap_elm_correct_data: cleanup for future enhancements

Current omap_elm_correct_data() code is not scalable for future ecc-schemes
due to presence of tweaks and hard-coded macros for BCH4_ECC and BCH8_ECC
ecc-schemes at multiple places.

This patch:
 - replaces 'ecc_opt' with '(info->nand.ecc.strength == BCH8_MAX_ERROR)
   used to differentiate between BCH8_HW and BCH4_SW
 - replaces macros (defining magic number for specific ecc-scheme) with
   generic variables
 - removes dependency on macros defined in elm.h (like BCHx_ECC_OOB_BYTES)

Tested-by: Stefan Roese <sr@denx.de>
Signed-off-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/omap2.c