diff options
author | Guillaume LECERF <glecerf@gmail.com> | 2010-07-02 08:39:10 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-08-04 05:58:36 -0400 |
commit | e17f47a14b3418711d9fee5c0a77ef0b672f5eaa (patch) | |
tree | f937ca4bdbbc48c23a33859a53f6019bc3bc3262 /drivers/mtd/chips | |
parent | 9d2c4f3fe50a6d07275de91b392aaaf4773bc8b6 (diff) |
mtd: cfi_cmdset_0002: fix the check for valid primary extension versions
Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3 [1][2].
Fix the check in cfi_cmdset_0002 accordingly.
[1] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, page 19
[2] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Guillaume LECERF <glecerf@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index d81079ef91a5..749203f89b55 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -417,16 +417,25 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) | |||
417 | */ | 417 | */ |
418 | cfi_fixup_major_minor(cfi, extp); | 418 | cfi_fixup_major_minor(cfi, extp); |
419 | 419 | ||
420 | /* | ||
421 | * Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3 | ||
422 | * see: http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, page 19 and on | ||
423 | * http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf | ||
424 | */ | ||
420 | if (extp->MajorVersion != '1' || | 425 | if (extp->MajorVersion != '1' || |
421 | (extp->MinorVersion < '0' || extp->MinorVersion > '4')) { | 426 | (extp->MajorVersion == '1' && ( extp->MinorVersion < '0' || extp->MinorVersion > '3'))) { |
422 | printk(KERN_ERR " Unknown Amd/Fujitsu Extended Query " | 427 | printk(KERN_ERR " Unknown Amd/Fujitsu Extended Query " |
423 | "version %c.%c.\n", extp->MajorVersion, | 428 | "version %c.%c (%#02x/%#02x).\n", |
424 | extp->MinorVersion); | 429 | extp->MajorVersion, extp->MinorVersion, |
430 | extp->MajorVersion, extp->MinorVersion); | ||
425 | kfree(extp); | 431 | kfree(extp); |
426 | kfree(mtd); | 432 | kfree(mtd); |
427 | return NULL; | 433 | return NULL; |
428 | } | 434 | } |
429 | 435 | ||
436 | printk(KERN_INFO " Amd/Fujitsu Extended Query version %c.%c.\n", | ||
437 | extp->MajorVersion, extp->MinorVersion); | ||
438 | |||
430 | /* Install our own private info structure */ | 439 | /* Install our own private info structure */ |
431 | cfi->cmdset_priv = extp; | 440 | cfi->cmdset_priv = extp; |
432 | 441 | ||