OSDN Git Service

nand: omap2: Remove horrible ifdefs to fix module probe
authorEzequiel García <ezequiel@vanguardiasur.com.ar>
Sat, 20 Sep 2014 16:53:12 +0000 (17:53 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Mon, 22 Sep 2014 18:37:51 +0000 (11:37 -0700)
commit93af53b8633c4cb474585158512182b21219d743
treeed913991563b48f45a45096fe535325be297ff35
parent2a960cce03d1dbd3dba54e660c479f64674eb5e3
nand: omap2: Remove horrible ifdefs to fix module probe

The current code abuses ifdefs to determine if the selected ECC scheme
is supported by the running kernel. As a result the code is hard to read,
and it also fails to load as a module.

This commit removes all the ifdefs and instead introduces a function
omap2_nand_ecc_check() to check if the ECC is supported by using
IS_ENABLED(CONFIG_xxx).

Since IS_ENABLED() is true when a config is =y or =m, this change fixes the
module so it can be loaded with no issues.

Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/omap2.c
include/linux/platform_data/elm.h