Skip to content

Commit

Permalink
[PATCH] mtd onenand driver: check correct manufacturer
Browse files Browse the repository at this point in the history
This (and the three subsequent patches) is working well on OMAP H4 with
2.6.15-rc4 kernel and passes the LTP fs test.

Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kyungmin-park authored and Linus Torvalds committed Dec 19, 2005
1 parent ee219e5 commit 37b1cc3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 10 additions & 6 deletions drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,6 @@ static void onenand_print_device_info(int device)

static const struct onenand_manufacturers onenand_manuf_ids[] = {
{ONENAND_MFR_SAMSUNG, "Samsung"},
{ONENAND_MFR_UNKNOWN, "Unknown"}
};

/**
Expand All @@ -1357,17 +1356,22 @@ static const struct onenand_manufacturers onenand_manuf_ids[] = {
*/
static int onenand_check_maf(int manuf)
{
int size = ARRAY_SIZE(onenand_manuf_ids);
char *name;
int i;

for (i = 0; onenand_manuf_ids[i].id; i++) {
for (i = 0; i < size; i++)
if (manuf == onenand_manuf_ids[i].id)
break;
}

printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n",
onenand_manuf_ids[i].name, manuf);
if (i < size)
name = onenand_manuf_ids[i].name;
else
name = "Unknown";

printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", name, manuf);

return (i != ONENAND_MFR_UNKNOWN);
return (i == size);
}

/**
Expand Down
1 change: 0 additions & 1 deletion include/linux/mtd/onenand.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ struct onenand_chip {
* OneNAND Flash Manufacturer ID Codes
*/
#define ONENAND_MFR_SAMSUNG 0xec
#define ONENAND_MFR_UNKNOWN 0x00

/**
* struct nand_manufacturers - NAND Flash Manufacturer ID Structure
Expand Down

0 comments on commit 37b1cc3

Please sign in to comment.