diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2005-04-04 14:56:32 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-05-23 07:09:10 -0400 |
commit | 22c60f5fb7b8184a2d00a607f965b54c586fb40e (patch) | |
tree | 946948f6ef7fe2483c5cadf356a42482e3fb3077 /drivers/mtd/nand/nand_base.c | |
parent | bb75ba4c442c6aa73797c35651a697b0a8006bd6 (diff) |
[MTD] NAND: Move the NULL check into the calling function
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 0da1daa51646..02e58f5ac721 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -59,7 +59,7 @@ | |||
59 | * The AG-AND chips have nice features for speed improvement, | 59 | * The AG-AND chips have nice features for speed improvement, |
60 | * which are not supported yet. Read / program 4 pages in one go. | 60 | * which are not supported yet. Read / program 4 pages in one go. |
61 | * | 61 | * |
62 | * $Id: nand_base.c,v 1.139 2005/04/04 18:02:23 dbrown Exp $ | 62 | * $Id: nand_base.c,v 1.140 2005/04/04 18:56:29 gleixner Exp $ |
63 | * | 63 | * |
64 | * This program is free software; you can redistribute it and/or modify | 64 | * This program is free software; you can redistribute it and/or modify |
65 | * it under the terms of the GNU General Public License version 2 as | 65 | * it under the terms of the GNU General Public License version 2 as |
@@ -1060,8 +1060,8 @@ out: | |||
1060 | */ | 1060 | */ |
1061 | static int nand_read (struct mtd_info *mtd, loff_t from, size_t len, size_t * retlen, u_char * buf) | 1061 | static int nand_read (struct mtd_info *mtd, loff_t from, size_t len, size_t * retlen, u_char * buf) |
1062 | { | 1062 | { |
1063 | return nand_do_read_ecc (mtd, from, len, retlen, buf, NULL, NULL, 0xff); | 1063 | return nand_do_read_ecc (mtd, from, len, retlen, buf, NULL, &mtd->oobinfo, 0xff); |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | 1066 | ||
1067 | /** | 1067 | /** |
@@ -1079,6 +1079,9 @@ static int nand_read (struct mtd_info *mtd, loff_t from, size_t len, size_t * re | |||
1079 | static int nand_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, | 1079 | static int nand_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, |
1080 | size_t * retlen, u_char * buf, u_char * oob_buf, struct nand_oobinfo *oobsel) | 1080 | size_t * retlen, u_char * buf, u_char * oob_buf, struct nand_oobinfo *oobsel) |
1081 | { | 1081 | { |
1082 | /* use userspace supplied oobinfo, if zero */ | ||
1083 | if (oobsel == NULL) | ||
1084 | oobsel = &mtd->oobinfo; | ||
1082 | return nand_do_read_ecc(mtd, from, len, retlen, buf, oob_buf, oobsel, 0xff); | 1085 | return nand_do_read_ecc(mtd, from, len, retlen, buf, oob_buf, oobsel, 0xff); |
1083 | } | 1086 | } |
1084 | 1087 | ||
@@ -1091,7 +1094,7 @@ static int nand_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, | |||
1091 | * @retlen: pointer to variable to store the number of read bytes | 1094 | * @retlen: pointer to variable to store the number of read bytes |
1092 | * @buf: the databuffer to put data | 1095 | * @buf: the databuffer to put data |
1093 | * @oob_buf: filesystem supplied oob data buffer (can be NULL) | 1096 | * @oob_buf: filesystem supplied oob data buffer (can be NULL) |
1094 | * @oobsel: oob selection structure (can be NULL) | 1097 | * @oobsel: oob selection structure |
1095 | * @flags: flag to indicate if nand_get_device/nand_release_device should be preformed | 1098 | * @flags: flag to indicate if nand_get_device/nand_release_device should be preformed |
1096 | * and how many corrected error bits are acceptable: | 1099 | * and how many corrected error bits are acceptable: |
1097 | * bits 0..7 - number of tolerable errors | 1100 | * bits 0..7 - number of tolerable errors |
@@ -1103,10 +1106,7 @@ int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, | |||
1103 | size_t * retlen, u_char * buf, u_char * oob_buf, | 1106 | size_t * retlen, u_char * buf, u_char * oob_buf, |
1104 | struct nand_oobinfo *oobsel, int flags) | 1107 | struct nand_oobinfo *oobsel, int flags) |
1105 | { | 1108 | { |
1106 | /* use userspace supplied oobinfo, if zero */ | 1109 | |
1107 | if (oobsel == NULL) | ||
1108 | oobsel = &mtd->oobinfo; | ||
1109 | |||
1110 | int i, j, col, realpage, page, end, ecc, chipnr, sndcmd = 1; | 1110 | int i, j, col, realpage, page, end, ecc, chipnr, sndcmd = 1; |
1111 | int read = 0, oob = 0, ecc_status = 0, ecc_failed = 0; | 1111 | int read = 0, oob = 0, ecc_status = 0, ecc_failed = 0; |
1112 | struct nand_chip *this = mtd->priv; | 1112 | struct nand_chip *this = mtd->priv; |