summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-12-05 09:47:15 +0100
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-12-14 13:34:19 +0100
commit8b311ead8bff9b56e512e3e544c488042ad0e7e7 (patch)
treed9f46b05201c9847e55013f61a5198868e4513e3 /drivers/mtd/nand/nand_base.c
parentmtd: nand: cafe: remove use of NAND_OWN_BUFFERS (diff)
downloadlinux-8b311ead8bff9b56e512e3e544c488042ad0e7e7.tar.xz
linux-8b311ead8bff9b56e512e3e544c488042ad0e7e7.zip
mtd: nand: remove unused NAND_OWN_BUFFERS flag
The last/only user of NAND_OWN_BUFFERS (cafe_nand.c) has been reworked. This flag is no longer needed. Suggested-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 215c52a3b9ad..b63cc95e9179 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -5319,35 +5319,30 @@ int nand_scan_tail(struct mtd_info *mtd)
return -EINVAL;
}
- if (!(chip->options & NAND_OWN_BUFFERS)) {
- nbuf = kzalloc(sizeof(*nbuf), GFP_KERNEL);
- if (!nbuf)
- return -ENOMEM;
-
- nbuf->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL);
- if (!nbuf->ecccalc) {
- ret = -ENOMEM;
- goto err_free_nbuf;
- }
+ nbuf = kzalloc(sizeof(*nbuf), GFP_KERNEL);
+ if (!nbuf)
+ return -ENOMEM;
- nbuf->ecccode = kmalloc(mtd->oobsize, GFP_KERNEL);
- if (!nbuf->ecccode) {
- ret = -ENOMEM;
- goto err_free_nbuf;
- }
+ nbuf->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL);
+ if (!nbuf->ecccalc) {
+ ret = -ENOMEM;
+ goto err_free_nbuf;
+ }
- nbuf->databuf = kmalloc(mtd->writesize + mtd->oobsize,
- GFP_KERNEL);
- if (!nbuf->databuf) {
- ret = -ENOMEM;
- goto err_free_nbuf;
- }
+ nbuf->ecccode = kmalloc(mtd->oobsize, GFP_KERNEL);
+ if (!nbuf->ecccode) {
+ ret = -ENOMEM;
+ goto err_free_nbuf;
+ }
- chip->buffers = nbuf;
- } else if (!chip->buffers) {
- return -ENOMEM;
+ nbuf->databuf = kmalloc(mtd->writesize + mtd->oobsize, GFP_KERNEL);
+ if (!nbuf->databuf) {
+ ret = -ENOMEM;
+ goto err_free_nbuf;
}
+ chip->buffers = nbuf;
+
/*
* FIXME: some NAND manufacturer drivers expect the first die to be
* selected when manufacturer->init() is called. They should be fixed
@@ -5701,7 +5696,7 @@ void nand_cleanup(struct nand_chip *chip)
/* Free bad block table memory */
kfree(chip->bbt);
- if (!(chip->options & NAND_OWN_BUFFERS) && chip->buffers) {
+ if (chip->buffers) {
kfree(chip->buffers->databuf);
kfree(chip->buffers->ecccode);
kfree(chip->buffers->ecccalc);