]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/prodrive/alpr/nand.c
mtd, ubi, ubifs: resync with Linux-3.14
[karo-tx-uboot.git] / board / prodrive / alpr / nand.c
index b18c96b297746fc0d053861b09bbe20fef1c8dad..5427de5634213ba427257ff07fd18cff79949a69 100644 (file)
@@ -5,23 +5,7 @@
  * (C) Copyright 2006
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -109,6 +93,7 @@ static void alpr_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
        }
 }
 
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
 static int alpr_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
 {
        int i;
@@ -119,15 +104,14 @@ static int alpr_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len
 
        return 0;
 }
+#endif
 
 static int alpr_nand_dev_ready(struct mtd_info *mtd)
 {
-       volatile u_char val;
-
        /*
         * Blocking read to wait for NAND to be ready
         */
-       val = readb(&(alpr_ndfc->addr_wait));
+       (void)readb(&(alpr_ndfc->addr_wait));
 
        /*
         * Return always true
@@ -146,7 +130,9 @@ int board_nand_init(struct nand_chip *nand)
        nand->read_byte  = alpr_nand_read_byte;
        nand->write_buf  = alpr_nand_write_buf;
        nand->read_buf   = alpr_nand_read_buf;
+#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
        nand->verify_buf = alpr_nand_verify_buf;
+#endif
        nand->dev_ready  = alpr_nand_dev_ready;
 
        return 0;