summaryrefslogtreecommitdiff
path: root/target/linux/goldfish/patches-2.6.30/1000-nand_driver_fixes.patch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-12-18 17:53:53 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-12-18 17:53:53 +0000
commitdb831511d2091907eef52519ebcc47f54cfd6d33 (patch)
tree9f9c7fba156b00e4bc76030988ecf32839f622ce /target/linux/goldfish/patches-2.6.30/1000-nand_driver_fixes.patch
parent979bc5536dd4960748cc7a96426abdc8ace15131 (diff)
downloadmtk-20170518-db831511d2091907eef52519ebcc47f54cfd6d33.zip
mtk-20170518-db831511d2091907eef52519ebcc47f54cfd6d33.tar.gz
mtk-20170518-db831511d2091907eef52519ebcc47f54cfd6d33.tar.bz2
goldfish: R.I.P.
It is broken and it is not maintained by anyone since long time. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 34766
Diffstat (limited to 'target/linux/goldfish/patches-2.6.30/1000-nand_driver_fixes.patch')
-rw-r--r--target/linux/goldfish/patches-2.6.30/1000-nand_driver_fixes.patch94
1 files changed, 0 insertions, 94 deletions
diff --git a/target/linux/goldfish/patches-2.6.30/1000-nand_driver_fixes.patch b/target/linux/goldfish/patches-2.6.30/1000-nand_driver_fixes.patch
deleted file mode 100644
index 0cd366c..0000000
--- a/target/linux/goldfish/patches-2.6.30/1000-nand_driver_fixes.patch
+++ /dev/null
@@ -1,94 +0,0 @@
---- a/drivers/mtd/devices/goldfish_nand.c
-+++ b/drivers/mtd/devices/goldfish_nand.c
-@@ -65,7 +65,7 @@ static int goldfish_nand_erase(struct mt
- if(rem)
- goto invalid_arg;
- ofs *= (mtd->writesize + mtd->oobsize);
--
-+
- if(len % mtd->writesize)
- goto invalid_arg;
- len = len / mtd->writesize * (mtd->writesize + mtd->oobsize);
-@@ -94,15 +94,12 @@ static int goldfish_nand_read_oob(struct
-
- if(ofs + ops->len > mtd->size)
- goto invalid_arg;
-- if(ops->datbuf && ops->len && ops->len != mtd->writesize)
-- goto invalid_arg;
- if(ops->ooblen + ops->ooboffs > mtd->oobsize)
- goto invalid_arg;
-
- rem = do_div(ofs, mtd->writesize);
-- if(rem)
-- goto invalid_arg;
- ofs *= (mtd->writesize + mtd->oobsize);
-+ ofs += rem;
-
- if(ops->datbuf)
- ops->retlen = goldfish_nand_cmd(mtd, NAND_CMD_READ, ofs,
-@@ -131,7 +128,7 @@ static int goldfish_nand_write_oob(struc
- goto invalid_arg;
- if(ops->ooblen + ops->ooboffs > mtd->oobsize)
- goto invalid_arg;
--
-+
- rem = do_div(ofs, mtd->writesize);
- if(rem)
- goto invalid_arg;
-@@ -160,15 +157,24 @@ static int goldfish_nand_read(struct mtd
-
- if(from + len > mtd->size)
- goto invalid_arg;
-- if(len != mtd->writesize)
-- goto invalid_arg;
-+
-+ *retlen = 0;
-
- rem = do_div(from, mtd->writesize);
-- if(rem)
-- goto invalid_arg;
- from *= (mtd->writesize + mtd->oobsize);
-+ from += rem;
-
-- *retlen = goldfish_nand_cmd(mtd, NAND_CMD_READ, from, len, buf);
-+ do {
-+ *retlen += goldfish_nand_cmd(mtd, NAND_CMD_READ, from, min(len, mtd->writesize - rem), buf);
-+ if (len > mtd->writesize - rem) {
-+ len -= mtd->writesize - rem;
-+ buf += mtd->writesize - rem;
-+ from += mtd->writesize + mtd->oobsize - rem;
-+ rem = 0;
-+ } else {
-+ len = 0;
-+ }
-+ } while (len);
- return 0;
-
- invalid_arg:
-@@ -184,15 +190,23 @@ static int goldfish_nand_write(struct mt
-
- if(to + len > mtd->size)
- goto invalid_arg;
-- if(len != mtd->writesize)
-- goto invalid_arg;
-
- rem = do_div(to, mtd->writesize);
- if(rem)
- goto invalid_arg;
- to *= (mtd->writesize + mtd->oobsize);
-
-- *retlen = goldfish_nand_cmd(mtd, NAND_CMD_WRITE, to, len, (void *)buf);
-+ *retlen = 0;
-+ do {
-+ *retlen += goldfish_nand_cmd(mtd, NAND_CMD_WRITE, to, min(len, mtd->writesize), (void *)buf);
-+ if (len > mtd->writesize) {
-+ len -= mtd->writesize;
-+ buf += mtd->writesize;
-+ to += mtd->writesize + mtd->oobsize;
-+ } else {
-+ len = 0;
-+ }
-+ } while (len);
- return 0;
-
- invalid_arg: