aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0001.c54
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c94
-rw-r--r--drivers/mtd/chips/cfi_util.c2
-rw-r--r--drivers/mtd/chips/fwh_lock.h2
-rw-r--r--include/linux/mtd/cfi.h3
5 files changed, 77 insertions, 78 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index ad9268b44416..44cbfc093ecc 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -162,7 +162,7 @@ static void cfi_tell_features(struct cfi_pri_intelext *extp)
162#endif 162#endif
163 163
164/* Atmel chips don't use the same PRI format as Intel chips */ 164/* Atmel chips don't use the same PRI format as Intel chips */
165static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param) 165static void fixup_convert_atmel_pri(struct mtd_info *mtd)
166{ 166{
167 struct map_info *map = mtd->priv; 167 struct map_info *map = mtd->priv;
168 struct cfi_private *cfi = map->fldrv_priv; 168 struct cfi_private *cfi = map->fldrv_priv;
@@ -202,7 +202,7 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param)
202 cfi->cfiq->BufWriteTimeoutMax = 0; 202 cfi->cfiq->BufWriteTimeoutMax = 0;
203} 203}
204 204
205static void fixup_at49bv640dx_lock(struct mtd_info *mtd, void *param) 205static void fixup_at49bv640dx_lock(struct mtd_info *mtd)
206{ 206{
207 struct map_info *map = mtd->priv; 207 struct map_info *map = mtd->priv;
208 struct cfi_private *cfi = map->fldrv_priv; 208 struct cfi_private *cfi = map->fldrv_priv;
@@ -214,7 +214,7 @@ static void fixup_at49bv640dx_lock(struct mtd_info *mtd, void *param)
214 214
215#ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE 215#ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE
216/* Some Intel Strata Flash prior to FPO revision C has bugs in this area */ 216/* Some Intel Strata Flash prior to FPO revision C has bugs in this area */
217static void fixup_intel_strataflash(struct mtd_info *mtd, void* param) 217static void fixup_intel_strataflash(struct mtd_info *mtd)
218{ 218{
219 struct map_info *map = mtd->priv; 219 struct map_info *map = mtd->priv;
220 struct cfi_private *cfi = map->fldrv_priv; 220 struct cfi_private *cfi = map->fldrv_priv;
@@ -227,7 +227,7 @@ static void fixup_intel_strataflash(struct mtd_info *mtd, void* param)
227#endif 227#endif
228 228
229#ifdef CMDSET0001_DISABLE_WRITE_SUSPEND 229#ifdef CMDSET0001_DISABLE_WRITE_SUSPEND
230static void fixup_no_write_suspend(struct mtd_info *mtd, void* param) 230static void fixup_no_write_suspend(struct mtd_info *mtd)
231{ 231{
232 struct map_info *map = mtd->priv; 232 struct map_info *map = mtd->priv;
233 struct cfi_private *cfi = map->fldrv_priv; 233 struct cfi_private *cfi = map->fldrv_priv;
@@ -240,7 +240,7 @@ static void fixup_no_write_suspend(struct mtd_info *mtd, void* param)
240} 240}
241#endif 241#endif
242 242
243static void fixup_st_m28w320ct(struct mtd_info *mtd, void* param) 243static void fixup_st_m28w320ct(struct mtd_info *mtd)
244{ 244{
245 struct map_info *map = mtd->priv; 245 struct map_info *map = mtd->priv;
246 struct cfi_private *cfi = map->fldrv_priv; 246 struct cfi_private *cfi = map->fldrv_priv;
@@ -249,7 +249,7 @@ static void fixup_st_m28w320ct(struct mtd_info *mtd, void* param)
249 cfi->cfiq->BufWriteTimeoutMax = 0; /* Not supported */ 249 cfi->cfiq->BufWriteTimeoutMax = 0; /* Not supported */
250} 250}
251 251
252static void fixup_st_m28w320cb(struct mtd_info *mtd, void* param) 252static void fixup_st_m28w320cb(struct mtd_info *mtd)
253{ 253{
254 struct map_info *map = mtd->priv; 254 struct map_info *map = mtd->priv;
255 struct cfi_private *cfi = map->fldrv_priv; 255 struct cfi_private *cfi = map->fldrv_priv;
@@ -259,7 +259,7 @@ static void fixup_st_m28w320cb(struct mtd_info *mtd, void* param)
259 (cfi->cfiq->EraseRegionInfo[1] & 0xffff0000) | 0x3e; 259 (cfi->cfiq->EraseRegionInfo[1] & 0xffff0000) | 0x3e;
260}; 260};
261 261
262static void fixup_use_point(struct mtd_info *mtd, void *param) 262static void fixup_use_point(struct mtd_info *mtd)
263{ 263{
264 struct map_info *map = mtd->priv; 264 struct map_info *map = mtd->priv;
265 if (!mtd->point && map_is_linear(map)) { 265 if (!mtd->point && map_is_linear(map)) {
@@ -268,7 +268,7 @@ static void fixup_use_point(struct mtd_info *mtd, void *param)
268 } 268 }
269} 269}
270 270
271static void fixup_use_write_buffers(struct mtd_info *mtd, void *param) 271static void fixup_use_write_buffers(struct mtd_info *mtd)
272{ 272{
273 struct map_info *map = mtd->priv; 273 struct map_info *map = mtd->priv;
274 struct cfi_private *cfi = map->fldrv_priv; 274 struct cfi_private *cfi = map->fldrv_priv;
@@ -282,7 +282,7 @@ static void fixup_use_write_buffers(struct mtd_info *mtd, void *param)
282/* 282/*
283 * Some chips power-up with all sectors locked by default. 283 * Some chips power-up with all sectors locked by default.
284 */ 284 */
285static void fixup_unlock_powerup_lock(struct mtd_info *mtd, void *param) 285static void fixup_unlock_powerup_lock(struct mtd_info *mtd)
286{ 286{
287 struct map_info *map = mtd->priv; 287 struct map_info *map = mtd->priv;
288 struct cfi_private *cfi = map->fldrv_priv; 288 struct cfi_private *cfi = map->fldrv_priv;
@@ -295,31 +295,31 @@ static void fixup_unlock_powerup_lock(struct mtd_info *mtd, void *param)
295} 295}
296 296
297static struct cfi_fixup cfi_fixup_table[] = { 297static struct cfi_fixup cfi_fixup_table[] = {
298 { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, 298 { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri },
299 { CFI_MFR_ATMEL, AT49BV640D, fixup_at49bv640dx_lock, NULL }, 299 { CFI_MFR_ATMEL, AT49BV640D, fixup_at49bv640dx_lock },
300 { CFI_MFR_ATMEL, AT49BV640DT, fixup_at49bv640dx_lock, NULL }, 300 { CFI_MFR_ATMEL, AT49BV640DT, fixup_at49bv640dx_lock },
301#ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE 301#ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE
302 { CFI_MFR_ANY, CFI_ID_ANY, fixup_intel_strataflash, NULL }, 302 { CFI_MFR_ANY, CFI_ID_ANY, fixup_intel_strataflash },
303#endif 303#endif
304#ifdef CMDSET0001_DISABLE_WRITE_SUSPEND 304#ifdef CMDSET0001_DISABLE_WRITE_SUSPEND
305 { CFI_MFR_ANY, CFI_ID_ANY, fixup_no_write_suspend, NULL }, 305 { CFI_MFR_ANY, CFI_ID_ANY, fixup_no_write_suspend },
306#endif 306#endif
307#if !FORCE_WORD_WRITE 307#if !FORCE_WORD_WRITE
308 { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL }, 308 { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers },
309#endif 309#endif
310 { CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct, NULL }, 310 { CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct },
311 { CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb, NULL }, 311 { CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb },
312 { CFI_MFR_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock, NULL, }, 312 { CFI_MFR_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock },
313 { 0, 0, NULL, NULL } 313 { 0, 0, NULL }
314}; 314};
315 315
316static struct cfi_fixup jedec_fixup_table[] = { 316static struct cfi_fixup jedec_fixup_table[] = {
317 { CFI_MFR_INTEL, I82802AB, fixup_use_fwh_lock, NULL, }, 317 { CFI_MFR_INTEL, I82802AB, fixup_use_fwh_lock },
318 { CFI_MFR_INTEL, I82802AC, fixup_use_fwh_lock, NULL, }, 318 { CFI_MFR_INTEL, I82802AC, fixup_use_fwh_lock },
319 { CFI_MFR_ST, M50LPW080, fixup_use_fwh_lock, NULL, }, 319 { CFI_MFR_ST, M50LPW080, fixup_use_fwh_lock },
320 { CFI_MFR_ST, M50FLW080A, fixup_use_fwh_lock, NULL, }, 320 { CFI_MFR_ST, M50FLW080A, fixup_use_fwh_lock },
321 { CFI_MFR_ST, M50FLW080B, fixup_use_fwh_lock, NULL, }, 321 { CFI_MFR_ST, M50FLW080B, fixup_use_fwh_lock },
322 { 0, 0, NULL, NULL } 322 { 0, 0, NULL }
323}; 323};
324static struct cfi_fixup fixup_table[] = { 324static struct cfi_fixup fixup_table[] = {
325 /* The CFI vendor ids and the JEDEC vendor IDs appear 325 /* The CFI vendor ids and the JEDEC vendor IDs appear
@@ -327,8 +327,8 @@ static struct cfi_fixup fixup_table[] = {
327 * well. This table is to pick all cases where 327 * well. This table is to pick all cases where
328 * we know that is the case. 328 * we know that is the case.
329 */ 329 */
330 { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_point, NULL }, 330 { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_point },
331 { 0, 0, NULL, NULL } 331 { 0, 0, NULL }
332}; 332};
333 333
334static void cfi_fixup_major_minor(struct cfi_private *cfi, 334static void cfi_fixup_major_minor(struct cfi_private *cfi,
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 3b8e32d87977..9d68ab919f31 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -134,7 +134,7 @@ static void cfi_tell_features(struct cfi_pri_amdstd *extp)
134 134
135#ifdef AMD_BOOTLOC_BUG 135#ifdef AMD_BOOTLOC_BUG
136/* Wheee. Bring me the head of someone at AMD. */ 136/* Wheee. Bring me the head of someone at AMD. */
137static void fixup_amd_bootblock(struct mtd_info *mtd, void* param) 137static void fixup_amd_bootblock(struct mtd_info *mtd)
138{ 138{
139 struct map_info *map = mtd->priv; 139 struct map_info *map = mtd->priv;
140 struct cfi_private *cfi = map->fldrv_priv; 140 struct cfi_private *cfi = map->fldrv_priv;
@@ -186,7 +186,7 @@ static void fixup_amd_bootblock(struct mtd_info *mtd, void* param)
186} 186}
187#endif 187#endif
188 188
189static void fixup_use_write_buffers(struct mtd_info *mtd, void *param) 189static void fixup_use_write_buffers(struct mtd_info *mtd)
190{ 190{
191 struct map_info *map = mtd->priv; 191 struct map_info *map = mtd->priv;
192 struct cfi_private *cfi = map->fldrv_priv; 192 struct cfi_private *cfi = map->fldrv_priv;
@@ -197,7 +197,7 @@ static void fixup_use_write_buffers(struct mtd_info *mtd, void *param)
197} 197}
198 198
199/* Atmel chips don't use the same PRI format as AMD chips */ 199/* Atmel chips don't use the same PRI format as AMD chips */
200static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param) 200static void fixup_convert_atmel_pri(struct mtd_info *mtd)
201{ 201{
202 struct map_info *map = mtd->priv; 202 struct map_info *map = mtd->priv;
203 struct cfi_private *cfi = map->fldrv_priv; 203 struct cfi_private *cfi = map->fldrv_priv;
@@ -228,14 +228,14 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param)
228 cfi->cfiq->BufWriteTimeoutMax = 0; 228 cfi->cfiq->BufWriteTimeoutMax = 0;
229} 229}
230 230
231static void fixup_use_secsi(struct mtd_info *mtd, void *param) 231static void fixup_use_secsi(struct mtd_info *mtd)
232{ 232{
233 /* Setup for chips with a secsi area */ 233 /* Setup for chips with a secsi area */
234 mtd->read_user_prot_reg = cfi_amdstd_secsi_read; 234 mtd->read_user_prot_reg = cfi_amdstd_secsi_read;
235 mtd->read_fact_prot_reg = cfi_amdstd_secsi_read; 235 mtd->read_fact_prot_reg = cfi_amdstd_secsi_read;
236} 236}
237 237
238static void fixup_use_erase_chip(struct mtd_info *mtd, void *param) 238static void fixup_use_erase_chip(struct mtd_info *mtd)
239{ 239{
240 struct map_info *map = mtd->priv; 240 struct map_info *map = mtd->priv;
241 struct cfi_private *cfi = map->fldrv_priv; 241 struct cfi_private *cfi = map->fldrv_priv;
@@ -250,7 +250,7 @@ static void fixup_use_erase_chip(struct mtd_info *mtd, void *param)
250 * Some Atmel chips (e.g. the AT49BV6416) power-up with all sectors 250 * Some Atmel chips (e.g. the AT49BV6416) power-up with all sectors
251 * locked by default. 251 * locked by default.
252 */ 252 */
253static void fixup_use_atmel_lock(struct mtd_info *mtd, void *param) 253static void fixup_use_atmel_lock(struct mtd_info *mtd)
254{ 254{
255 mtd->lock = cfi_atmel_lock; 255 mtd->lock = cfi_atmel_lock;
256 mtd->unlock = cfi_atmel_unlock; 256 mtd->unlock = cfi_atmel_unlock;
@@ -271,7 +271,7 @@ static void fixup_old_sst_eraseregion(struct mtd_info *mtd)
271 cfi->cfiq->NumEraseRegions = 1; 271 cfi->cfiq->NumEraseRegions = 1;
272} 272}
273 273
274static void fixup_sst39vf(struct mtd_info *mtd, void *param) 274static void fixup_sst39vf(struct mtd_info *mtd)
275{ 275{
276 struct map_info *map = mtd->priv; 276 struct map_info *map = mtd->priv;
277 struct cfi_private *cfi = map->fldrv_priv; 277 struct cfi_private *cfi = map->fldrv_priv;
@@ -282,7 +282,7 @@ static void fixup_sst39vf(struct mtd_info *mtd, void *param)
282 cfi->addr_unlock2 = 0x2AAA; 282 cfi->addr_unlock2 = 0x2AAA;
283} 283}
284 284
285static void fixup_sst39vf_rev_b(struct mtd_info *mtd, void *param) 285static void fixup_sst39vf_rev_b(struct mtd_info *mtd)
286{ 286{
287 struct map_info *map = mtd->priv; 287 struct map_info *map = mtd->priv;
288 struct cfi_private *cfi = map->fldrv_priv; 288 struct cfi_private *cfi = map->fldrv_priv;
@@ -295,12 +295,12 @@ static void fixup_sst39vf_rev_b(struct mtd_info *mtd, void *param)
295 cfi->sector_erase_cmd = CMD(0x50); 295 cfi->sector_erase_cmd = CMD(0x50);
296} 296}
297 297
298static void fixup_sst38vf640x_sectorsize(struct mtd_info *mtd, void *param) 298static void fixup_sst38vf640x_sectorsize(struct mtd_info *mtd)
299{ 299{
300 struct map_info *map = mtd->priv; 300 struct map_info *map = mtd->priv;
301 struct cfi_private *cfi = map->fldrv_priv; 301 struct cfi_private *cfi = map->fldrv_priv;
302 302
303 fixup_sst39vf_rev_b(mtd, param); 303 fixup_sst39vf_rev_b(mtd);
304 304
305 /* 305 /*
306 * CFI reports 1024 sectors (0x03ff+1) of 64KBytes (0x0100*256) where 306 * CFI reports 1024 sectors (0x03ff+1) of 64KBytes (0x0100*256) where
@@ -310,7 +310,7 @@ static void fixup_sst38vf640x_sectorsize(struct mtd_info *mtd, void *param)
310 pr_warning("%s: Bad 38VF640x CFI data; adjusting sector size from 64 to 8KiB\n", mtd->name); 310 pr_warning("%s: Bad 38VF640x CFI data; adjusting sector size from 64 to 8KiB\n", mtd->name);
311} 311}
312 312
313static void fixup_s29gl064n_sectors(struct mtd_info *mtd, void *param) 313static void fixup_s29gl064n_sectors(struct mtd_info *mtd)
314{ 314{
315 struct map_info *map = mtd->priv; 315 struct map_info *map = mtd->priv;
316 struct cfi_private *cfi = map->fldrv_priv; 316 struct cfi_private *cfi = map->fldrv_priv;
@@ -321,7 +321,7 @@ static void fixup_s29gl064n_sectors(struct mtd_info *mtd, void *param)
321 } 321 }
322} 322}
323 323
324static void fixup_s29gl032n_sectors(struct mtd_info *mtd, void *param) 324static void fixup_s29gl032n_sectors(struct mtd_info *mtd)
325{ 325{
326 struct map_info *map = mtd->priv; 326 struct map_info *map = mtd->priv;
327 struct cfi_private *cfi = map->fldrv_priv; 327 struct cfi_private *cfi = map->fldrv_priv;
@@ -334,47 +334,47 @@ static void fixup_s29gl032n_sectors(struct mtd_info *mtd, void *param)
334 334
335/* Used to fix CFI-Tables of chips without Extended Query Tables */ 335/* Used to fix CFI-Tables of chips without Extended Query Tables */
336static struct cfi_fixup cfi_nopri_fixup_table[] = { 336static struct cfi_fixup cfi_nopri_fixup_table[] = {
337 { CFI_MFR_SST, 0x234A, fixup_sst39vf, NULL, }, /* SST39VF1602 */ 337 { CFI_MFR_SST, 0x234a, fixup_sst39vf }, /* SST39VF1602 */
338 { CFI_MFR_SST, 0x234B, fixup_sst39vf, NULL, }, /* SST39VF1601 */ 338 { CFI_MFR_SST, 0x234b, fixup_sst39vf }, /* SST39VF1601 */
339 { CFI_MFR_SST, 0x235A, fixup_sst39vf, NULL, }, /* SST39VF3202 */ 339 { CFI_MFR_SST, 0x235a, fixup_sst39vf }, /* SST39VF3202 */
340 { CFI_MFR_SST, 0x235B, fixup_sst39vf, NULL, }, /* SST39VF3201 */ 340 { CFI_MFR_SST, 0x235b, fixup_sst39vf }, /* SST39VF3201 */
341 { CFI_MFR_SST, 0x235C, fixup_sst39vf_rev_b, NULL, }, /* SST39VF3202B */ 341 { CFI_MFR_SST, 0x235c, fixup_sst39vf_rev_b }, /* SST39VF3202B */
342 { CFI_MFR_SST, 0x235D, fixup_sst39vf_rev_b, NULL, }, /* SST39VF3201B */ 342 { CFI_MFR_SST, 0x235d, fixup_sst39vf_rev_b }, /* SST39VF3201B */
343 { CFI_MFR_SST, 0x236C, fixup_sst39vf_rev_b, NULL, }, /* SST39VF6402B */ 343 { CFI_MFR_SST, 0x236c, fixup_sst39vf_rev_b }, /* SST39VF6402B */
344 { CFI_MFR_SST, 0x236D, fixup_sst39vf_rev_b, NULL, }, /* SST39VF6401B */ 344 { CFI_MFR_SST, 0x236d, fixup_sst39vf_rev_b }, /* SST39VF6401B */
345 { 0, 0, NULL, NULL } 345 { 0, 0, NULL }
346}; 346};
347 347
348static struct cfi_fixup cfi_fixup_table[] = { 348static struct cfi_fixup cfi_fixup_table[] = {
349 { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, 349 { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri },
350#ifdef AMD_BOOTLOC_BUG 350#ifdef AMD_BOOTLOC_BUG
351 { CFI_MFR_AMD, CFI_ID_ANY, fixup_amd_bootblock, NULL }, 351 { CFI_MFR_AMD, CFI_ID_ANY, fixup_amd_bootblock },
352 { CFI_MFR_MACRONIX, CFI_ID_ANY, fixup_amd_bootblock, NULL }, 352 { CFI_MFR_MACRONIX, CFI_ID_ANY, fixup_amd_bootblock },
353#endif 353#endif
354 { CFI_MFR_AMD, 0x0050, fixup_use_secsi, NULL, }, 354 { CFI_MFR_AMD, 0x0050, fixup_use_secsi },
355 { CFI_MFR_AMD, 0x0053, fixup_use_secsi, NULL, }, 355 { CFI_MFR_AMD, 0x0053, fixup_use_secsi },
356 { CFI_MFR_AMD, 0x0055, fixup_use_secsi, NULL, }, 356 { CFI_MFR_AMD, 0x0055, fixup_use_secsi },
357 { CFI_MFR_AMD, 0x0056, fixup_use_secsi, NULL, }, 357 { CFI_MFR_AMD, 0x0056, fixup_use_secsi },
358 { CFI_MFR_AMD, 0x005C, fixup_use_secsi, NULL, }, 358 { CFI_MFR_AMD, 0x005C, fixup_use_secsi },
359 { CFI_MFR_AMD, 0x005F, fixup_use_secsi, NULL, }, 359 { CFI_MFR_AMD, 0x005F, fixup_use_secsi },
360 { CFI_MFR_AMD, 0x0c01, fixup_s29gl064n_sectors, NULL, }, 360 { CFI_MFR_AMD, 0x0c01, fixup_s29gl064n_sectors },
361 { CFI_MFR_AMD, 0x1301, fixup_s29gl064n_sectors, NULL, }, 361 { CFI_MFR_AMD, 0x1301, fixup_s29gl064n_sectors },
362 { CFI_MFR_AMD, 0x1a00, fixup_s29gl032n_sectors, NULL, }, 362 { CFI_MFR_AMD, 0x1a00, fixup_s29gl032n_sectors },
363 { CFI_MFR_AMD, 0x1a01, fixup_s29gl032n_sectors, NULL, }, 363 { CFI_MFR_AMD, 0x1a01, fixup_s29gl032n_sectors },
364 { CFI_MFR_SST, 0x536A, fixup_sst38vf640x_sectorsize, NULL, }, /* SST38VF6402 */ 364 { CFI_MFR_SST, 0x536a, fixup_sst38vf640x_sectorsize }, /* SST38VF6402 */
365 { CFI_MFR_SST, 0x536B, fixup_sst38vf640x_sectorsize, NULL, }, /* SST38VF6401 */ 365 { CFI_MFR_SST, 0x536b, fixup_sst38vf640x_sectorsize }, /* SST38VF6401 */
366 { CFI_MFR_SST, 0x536C, fixup_sst38vf640x_sectorsize, NULL, }, /* SST38VF6404 */ 366 { CFI_MFR_SST, 0x536c, fixup_sst38vf640x_sectorsize }, /* SST38VF6404 */
367 { CFI_MFR_SST, 0x536D, fixup_sst38vf640x_sectorsize, NULL, }, /* SST38VF6403 */ 367 { CFI_MFR_SST, 0x536d, fixup_sst38vf640x_sectorsize }, /* SST38VF6403 */
368#if !FORCE_WORD_WRITE 368#if !FORCE_WORD_WRITE
369 { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL, }, 369 { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers },
370#endif 370#endif
371 { 0, 0, NULL, NULL } 371 { 0, 0, NULL }
372}; 372};
373static struct cfi_fixup jedec_fixup_table[] = { 373static struct cfi_fixup jedec_fixup_table[] = {
374 { CFI_MFR_SST, SST49LF004B, fixup_use_fwh_lock, NULL, }, 374 { CFI_MFR_SST, SST49LF004B, fixup_use_fwh_lock },
375 { CFI_MFR_SST, SST49LF040B, fixup_use_fwh_lock, NULL, }, 375 { CFI_MFR_SST, SST49LF040B, fixup_use_fwh_lock },
376 { CFI_MFR_SST, SST49LF008A, fixup_use_fwh_lock, NULL, }, 376 { CFI_MFR_SST, SST49LF008A, fixup_use_fwh_lock },
377 { 0, 0, NULL, NULL } 377 { 0, 0, NULL }
378}; 378};
379 379
380static struct cfi_fixup fixup_table[] = { 380static struct cfi_fixup fixup_table[] = {
@@ -383,9 +383,9 @@ static struct cfi_fixup fixup_table[] = {
383 * well. This table is to pick all cases where 383 * well. This table is to pick all cases where
384 * we know that is the case. 384 * we know that is the case.
385 */ 385 */
386 { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_erase_chip, NULL }, 386 { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_erase_chip },
387 { CFI_MFR_ATMEL, AT49BV6416, fixup_use_atmel_lock, NULL }, 387 { CFI_MFR_ATMEL, AT49BV6416, fixup_use_atmel_lock },
388 { 0, 0, NULL, NULL } 388 { 0, 0, NULL }
389}; 389};
390 390
391 391
diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c
index 360525c637d2..6ae3d111e1e7 100644
--- a/drivers/mtd/chips/cfi_util.c
+++ b/drivers/mtd/chips/cfi_util.c
@@ -156,7 +156,7 @@ void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup *fixups)
156 for (f=fixups; f->fixup; f++) { 156 for (f=fixups; f->fixup; f++) {
157 if (((f->mfr == CFI_MFR_ANY) || (f->mfr == cfi->mfr)) && 157 if (((f->mfr == CFI_MFR_ANY) || (f->mfr == cfi->mfr)) &&
158 ((f->id == CFI_ID_ANY) || (f->id == cfi->id))) { 158 ((f->id == CFI_ID_ANY) || (f->id == cfi->id))) {
159 f->fixup(mtd, f->param); 159 f->fixup(mtd);
160 } 160 }
161 } 161 }
162} 162}
diff --git a/drivers/mtd/chips/fwh_lock.h b/drivers/mtd/chips/fwh_lock.h
index d18064977192..5e3cc80128aa 100644
--- a/drivers/mtd/chips/fwh_lock.h
+++ b/drivers/mtd/chips/fwh_lock.h
@@ -98,7 +98,7 @@ static int fwh_unlock_varsize(struct mtd_info *mtd, loff_t ofs, uint64_t len)
98 return ret; 98 return ret;
99} 99}
100 100
101static void fixup_use_fwh_lock(struct mtd_info *mtd, void *param) 101static void fixup_use_fwh_lock(struct mtd_info *mtd)
102{ 102{
103 printk(KERN_NOTICE "using fwh lock/unlock method\n"); 103 printk(KERN_NOTICE "using fwh lock/unlock method\n");
104 /* Setup for the chips with the fwh lock method */ 104 /* Setup for the chips with the fwh lock method */
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 4dd0c2cd7659..a9baee6864af 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -527,8 +527,7 @@ struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t s
527struct cfi_fixup { 527struct cfi_fixup {
528 uint16_t mfr; 528 uint16_t mfr;
529 uint16_t id; 529 uint16_t id;
530 void (*fixup)(struct mtd_info *mtd, void* param); 530 void (*fixup)(struct mtd_info *mtd);
531 void* param;
532}; 531};
533 532
534#define CFI_MFR_ANY 0xFFFF 533#define CFI_MFR_ANY 0xFFFF