diff options
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0001.c | 6 | ||||
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 20 |
2 files changed, 9 insertions, 17 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index 5fbf29e1e64f..92530433c11c 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -615,10 +615,8 @@ static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd) | |||
615 | return mtd; | 615 | return mtd; |
616 | 616 | ||
617 | setup_err: | 617 | setup_err: |
618 | if(mtd) { | 618 | kfree(mtd->eraseregions); |
619 | kfree(mtd->eraseregions); | 619 | kfree(mtd); |
620 | kfree(mtd); | ||
621 | } | ||
622 | kfree(cfi->cmdset_priv); | 620 | kfree(cfi->cmdset_priv); |
623 | return NULL; | 621 | return NULL; |
624 | } | 622 | } |
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index f3600e8d5382..ea2a7f66ddf9 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -43,10 +43,6 @@ | |||
43 | 43 | ||
44 | #define MAX_WORD_RETRIES 3 | 44 | #define MAX_WORD_RETRIES 3 |
45 | 45 | ||
46 | #define MANUFACTURER_AMD 0x0001 | ||
47 | #define MANUFACTURER_ATMEL 0x001F | ||
48 | #define MANUFACTURER_MACRONIX 0x00C2 | ||
49 | #define MANUFACTURER_SST 0x00BF | ||
50 | #define SST49LF004B 0x0060 | 46 | #define SST49LF004B 0x0060 |
51 | #define SST49LF040B 0x0050 | 47 | #define SST49LF040B 0x0050 |
52 | #define SST49LF008A 0x005a | 48 | #define SST49LF008A 0x005a |
@@ -168,7 +164,7 @@ static void fixup_amd_bootblock(struct mtd_info *mtd, void* param) | |||
168 | * This reduces the risk of false detection due to | 164 | * This reduces the risk of false detection due to |
169 | * the 8-bit device ID. | 165 | * the 8-bit device ID. |
170 | */ | 166 | */ |
171 | (cfi->mfr == MANUFACTURER_MACRONIX)) { | 167 | (cfi->mfr == CFI_MFR_MACRONIX)) { |
172 | DEBUG(MTD_DEBUG_LEVEL1, | 168 | DEBUG(MTD_DEBUG_LEVEL1, |
173 | "%s: Macronix MX29LV400C with bottom boot block" | 169 | "%s: Macronix MX29LV400C with bottom boot block" |
174 | " detected\n", map->name); | 170 | " detected\n", map->name); |
@@ -286,7 +282,7 @@ static struct cfi_fixup cfi_fixup_table[] = { | |||
286 | { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, | 282 | { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, |
287 | #ifdef AMD_BOOTLOC_BUG | 283 | #ifdef AMD_BOOTLOC_BUG |
288 | { CFI_MFR_AMD, CFI_ID_ANY, fixup_amd_bootblock, NULL }, | 284 | { CFI_MFR_AMD, CFI_ID_ANY, fixup_amd_bootblock, NULL }, |
289 | { MANUFACTURER_MACRONIX, CFI_ID_ANY, fixup_amd_bootblock, NULL }, | 285 | { CFI_MFR_MACRONIX, CFI_ID_ANY, fixup_amd_bootblock, NULL }, |
290 | #endif | 286 | #endif |
291 | { CFI_MFR_AMD, 0x0050, fixup_use_secsi, NULL, }, | 287 | { CFI_MFR_AMD, 0x0050, fixup_use_secsi, NULL, }, |
292 | { CFI_MFR_AMD, 0x0053, fixup_use_secsi, NULL, }, | 288 | { CFI_MFR_AMD, 0x0053, fixup_use_secsi, NULL, }, |
@@ -304,9 +300,9 @@ static struct cfi_fixup cfi_fixup_table[] = { | |||
304 | { 0, 0, NULL, NULL } | 300 | { 0, 0, NULL, NULL } |
305 | }; | 301 | }; |
306 | static struct cfi_fixup jedec_fixup_table[] = { | 302 | static struct cfi_fixup jedec_fixup_table[] = { |
307 | { MANUFACTURER_SST, SST49LF004B, fixup_use_fwh_lock, NULL, }, | 303 | { CFI_MFR_SST, SST49LF004B, fixup_use_fwh_lock, NULL, }, |
308 | { MANUFACTURER_SST, SST49LF040B, fixup_use_fwh_lock, NULL, }, | 304 | { CFI_MFR_SST, SST49LF040B, fixup_use_fwh_lock, NULL, }, |
309 | { MANUFACTURER_SST, SST49LF008A, fixup_use_fwh_lock, NULL, }, | 305 | { CFI_MFR_SST, SST49LF008A, fixup_use_fwh_lock, NULL, }, |
310 | { 0, 0, NULL, NULL } | 306 | { 0, 0, NULL, NULL } |
311 | }; | 307 | }; |
312 | 308 | ||
@@ -494,10 +490,8 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd) | |||
494 | return mtd; | 490 | return mtd; |
495 | 491 | ||
496 | setup_err: | 492 | setup_err: |
497 | if(mtd) { | 493 | kfree(mtd->eraseregions); |
498 | kfree(mtd->eraseregions); | 494 | kfree(mtd); |
499 | kfree(mtd); | ||
500 | } | ||
501 | kfree(cfi->cmdset_priv); | 495 | kfree(cfi->cmdset_priv); |
502 | kfree(cfi->cfiq); | 496 | kfree(cfi->cfiq); |
503 | return NULL; | 497 | return NULL; |