diff options
author | pekon gupta <pekon@ti.com> | 2014-04-11 12:55:35 +0530 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-06-06 17:46:00 -0400 |
commit | 3f990dc83bc3197b17bd847241671917826152cc (patch) | |
tree | 60f13c8f784a1df0d5252d8a6262f4239295ff28 /drivers/mtd/nand/omap_elm.c | |
parent | a09431da381ce8d1b4d48e1cbca5f2b4eea662f4 (diff) | |
download | u-boot-3f990dc83bc3197b17bd847241671917826152cc.tar.gz |
mtd: nand: omap: fix error-codes returned from omap-elm driver
This patch
omap-elm.c: replaces -ve integer value returned during errorneous condition,
with proper error-codes.
omap-gpmc.c: updates omap-gpmc driver to pass error-codes returned from
omap-elm driver to upper layers
Signed-off-by: Pekon Gupta <pekon@ti.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/mtd/nand/omap_elm.c')
-rw-r--r-- | drivers/mtd/nand/omap_elm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/nand/omap_elm.c b/drivers/mtd/nand/omap_elm.c index afa629a813..d963e6c07c 100644 --- a/drivers/mtd/nand/omap_elm.c +++ b/drivers/mtd/nand/omap_elm.c @@ -19,6 +19,7 @@ #include <linux/mtd/omap_elm.h> #include <asm/arch/hardware.h> +#define DRIVER_NAME "omap-elm" #define ELM_DEFAULT_POLY (0) struct elm *elm_cfg; @@ -113,8 +114,10 @@ int elm_check_error(u8 *syndrome, enum bch_level bch_type, u32 *error_count, /* check if correctable */ location_status = readl(&elm_cfg->error_location[poly].location_status); - if (!(location_status & ELM_LOCATION_STATUS_ECC_CORRECTABLE_MASK)) - return -1; + if (!(location_status & ELM_LOCATION_STATUS_ECC_CORRECTABLE_MASK)) { + printf("%s: uncorrectable ECC errors\n", DRIVER_NAME); + return -EBADMSG; + } /* get error count */ *error_count = readl(&elm_cfg->error_location[poly].location_status) & |