mtd: jedec_probe: Change variable name from cfi_p to cfi
In the following commit, we'll need to use the CMD() macro in order to fix the initialisation of the sector_erase_cmd field. That requires the local variable to be called 'cfi', so change it first in a simple patch. Signed-off-by: Antony Pavlov <antony@niisi.msk.ru> Acked-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> CC: stable@kernel.org
This commit is contained in:
Родитель
1bae4ce27c
Коммит
efba2e313e
|
@ -1935,14 +1935,14 @@ static void jedec_reset(u32 base, struct map_info *map, struct cfi_private *cfi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
|
static int cfi_jedec_setup(struct cfi_private *cfi, int index)
|
||||||
{
|
{
|
||||||
int i,num_erase_regions;
|
int i,num_erase_regions;
|
||||||
uint8_t uaddr;
|
uint8_t uaddr;
|
||||||
|
|
||||||
if (! (jedec_table[index].devtypes & p_cfi->device_type)) {
|
if (!(jedec_table[index].devtypes & cfi->device_type)) {
|
||||||
DEBUG(MTD_DEBUG_LEVEL1, "Rejecting potential %s with incompatible %d-bit device type\n",
|
DEBUG(MTD_DEBUG_LEVEL1, "Rejecting potential %s with incompatible %d-bit device type\n",
|
||||||
jedec_table[index].name, 4 * (1<<p_cfi->device_type));
|
jedec_table[index].name, 4 * (1<<cfi->device_type));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1950,27 +1950,27 @@ static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
|
||||||
|
|
||||||
num_erase_regions = jedec_table[index].nr_regions;
|
num_erase_regions = jedec_table[index].nr_regions;
|
||||||
|
|
||||||
p_cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
|
cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
|
||||||
if (!p_cfi->cfiq) {
|
if (!cfi->cfiq) {
|
||||||
//xx printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name);
|
//xx printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(p_cfi->cfiq,0,sizeof(struct cfi_ident));
|
memset(cfi->cfiq, 0, sizeof(struct cfi_ident));
|
||||||
|
|
||||||
p_cfi->cfiq->P_ID = jedec_table[index].cmd_set;
|
cfi->cfiq->P_ID = jedec_table[index].cmd_set;
|
||||||
p_cfi->cfiq->NumEraseRegions = jedec_table[index].nr_regions;
|
cfi->cfiq->NumEraseRegions = jedec_table[index].nr_regions;
|
||||||
p_cfi->cfiq->DevSize = jedec_table[index].dev_size;
|
cfi->cfiq->DevSize = jedec_table[index].dev_size;
|
||||||
p_cfi->cfi_mode = CFI_MODE_JEDEC;
|
cfi->cfi_mode = CFI_MODE_JEDEC;
|
||||||
|
|
||||||
for (i=0; i<num_erase_regions; i++){
|
for (i=0; i<num_erase_regions; i++){
|
||||||
p_cfi->cfiq->EraseRegionInfo[i] = jedec_table[index].regions[i];
|
cfi->cfiq->EraseRegionInfo[i] = jedec_table[index].regions[i];
|
||||||
}
|
}
|
||||||
p_cfi->cmdset_priv = NULL;
|
cfi->cmdset_priv = NULL;
|
||||||
|
|
||||||
/* This may be redundant for some cases, but it doesn't hurt */
|
/* This may be redundant for some cases, but it doesn't hurt */
|
||||||
p_cfi->mfr = jedec_table[index].mfr_id;
|
cfi->mfr = jedec_table[index].mfr_id;
|
||||||
p_cfi->id = jedec_table[index].dev_id;
|
cfi->id = jedec_table[index].dev_id;
|
||||||
|
|
||||||
uaddr = jedec_table[index].uaddr;
|
uaddr = jedec_table[index].uaddr;
|
||||||
|
|
||||||
|
@ -1978,8 +1978,8 @@ static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
|
||||||
our brains explode when we see the datasheets talking about address
|
our brains explode when we see the datasheets talking about address
|
||||||
lines numbered from A-1 to A18. The CFI table has unlock addresses
|
lines numbered from A-1 to A18. The CFI table has unlock addresses
|
||||||
in device-words according to the mode the device is connected in */
|
in device-words according to the mode the device is connected in */
|
||||||
p_cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 / p_cfi->device_type;
|
cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 / cfi->device_type;
|
||||||
p_cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 / p_cfi->device_type;
|
cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 / cfi->device_type;
|
||||||
|
|
||||||
return 1; /* ok */
|
return 1; /* ok */
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче