]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
nand: constify id/manu tables
authorMike Frysinger <vapier@gentoo.org>
Wed, 20 Oct 2010 01:15:21 +0000 (01:15 +0000)
committerScott Wood <scottwood@freescale.com>
Fri, 17 Dec 2010 20:32:11 +0000 (14:32 -0600)
These id tables need not be writable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_ids.c
include/linux/mtd/nand.h

index 21cc5a39407d29f74ddb987f6d0373632fa6afba..b74d04029ae0cde2860170e9f4dc609abc42b0ba 100644 (file)
@@ -2409,11 +2409,11 @@ static void nand_set_defaults(struct nand_chip *chip, int busw)
 /*
  * Get the flash and manufacturer id and lookup if the type is supported
  */
-static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
+static const struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
                                                  struct nand_chip *chip,
                                                  int busw, int *maf_id)
 {
-       struct nand_flash_dev *type = NULL;
+       const struct nand_flash_dev *type = NULL;
        int i, dev_id, maf_idx;
        int tmp_id, tmp_manf;
 
@@ -2587,7 +2587,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips)
 {
        int i, busw, nand_maf_id;
        struct nand_chip *chip = mtd->priv;
-       struct nand_flash_dev *type;
+       const struct nand_flash_dev *type;
 
        /* Get buswidth to select the correct functions */
        busw = chip->options & NAND_BUSWIDTH_16;
index 25b22ecc926cfe869bb1809e9f61803529238cb0..8d7ea767dd5aa47537a8571dd7c1f59aeaa1daab 100644 (file)
@@ -22,7 +22,7 @@
 +      256     256 Byte page size
 *      512     512 Byte page size
 */
-struct nand_flash_dev nand_flash_ids[] = {
+const struct nand_flash_dev nand_flash_ids[] = {
 
 #ifdef CONFIG_MTD_NAND_MUSEUM_IDS
        {"NAND 1MiB 5V 8-bit",          0x6e, 256, 1, 0x1000, 0},
@@ -132,7 +132,7 @@ struct nand_flash_dev nand_flash_ids[] = {
 /*
 *      Manufacturer ID list
 */
-struct nand_manufacturers nand_manuf_ids[] = {
+const struct nand_manufacturers nand_manuf_ids[] = {
        {NAND_MFR_TOSHIBA, "Toshiba"},
        {NAND_MFR_SAMSUNG, "Samsung"},
        {NAND_MFR_FUJITSU, "Fujitsu"},
index 94ad0c0e36aba8d4e7c3d1f283ece0c429cd0c04..519f47e4d370d46730a97df7180d9f1eaf0d9cd0 100644 (file)
@@ -470,8 +470,8 @@ struct nand_manufacturers {
        char * name;
 };
 
-extern struct nand_flash_dev nand_flash_ids[];
-extern struct nand_manufacturers nand_manuf_ids[];
+extern const struct nand_flash_dev nand_flash_ids[];
+extern const struct nand_manufacturers nand_manuf_ids[];
 
 extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
 extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs);