Patchwork [U-Boot] nand: constify id/manu tables

login
register
mail settings
Submitter Mike Frysinger
Date Oct. 20, 2010, 11:15 a.m.
Message ID <1287573321-6213-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/71897/
State Accepted
Commit 0bdecd82dda4f0c60220cbd3932a3012b3611fc9
Delegated to: Scott Wood
Headers show

Comments

Mike Frysinger - Oct. 20, 2010, 11:15 a.m.
These id tables need not be writable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/mtd/nand/nand_base.c |    6 +++---
 drivers/mtd/nand/nand_ids.c  |    4 ++--
 include/linux/mtd/nand.h     |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
Mike Frysinger - Dec. 7, 2010, 10:14 p.m.
On Wednesday, October 20, 2010 07:15:21 Mike Frysinger wrote:
> These id tables need not be writable.

was this missed ?  or is something pending ?
-mike
Scott Wood - Dec. 7, 2010, 10:23 p.m.
On Tue, 7 Dec 2010 17:14:14 -0500
Mike Frysinger <vapier@gentoo.org> wrote:

> On Wednesday, October 20, 2010 07:15:21 Mike Frysinger wrote:
> > These id tables need not be writable.
> 
> was this missed ?  or is something pending ?

Current batch was fixes for the imminent release; this looked like a
cleanup which I'll stick in -next shortly.

-Scott
Scott Wood - Dec. 10, 2010, 11:45 p.m.
On Wed, Oct 20, 2010 at 01:15:21AM -0000, Mike Frysinger wrote:
> These id tables need not be writable.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> 
> ---
> drivers/mtd/nand/nand_base.c |    6 +++---
>  drivers/mtd/nand/nand_ids.c  |    4 ++--
>  include/linux/mtd/nand.h     |    4 ++--
>  3 files changed, 7 insertions(+), 7 deletions(-)

Applied to u-boot-nand-flash next.

-Scott

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 21cc5a3..b74d040 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -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;
diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
index 25b22ec..8d7ea76 100644
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -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"},
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 94ad0c0..519f47e 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -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);