Lines Matching refs:idx
156 int idx = 0, ret = 0; in init_tqm_mtd() local
170 for(idx = 0 ; idx < FLASH_BANK_MAX ; idx++) in init_tqm_mtd()
175 printk("%s: chip probing count %d\n", __FUNCTION__, idx); in init_tqm_mtd()
177 map_banks[idx] = (struct map_info *)kmalloc(sizeof(struct map_info), GFP_KERNEL); in init_tqm_mtd()
178 if(map_banks[idx] == NULL) in init_tqm_mtd()
184 memset((void *)map_banks[idx], 0, sizeof(struct map_info)); in init_tqm_mtd()
185 map_banks[idx]->name = (char *)kmalloc(16, GFP_KERNEL); in init_tqm_mtd()
186 if(map_banks[idx]->name == NULL) in init_tqm_mtd()
192 memset((void *)map_banks[idx]->name, 0, 16); in init_tqm_mtd()
194 sprintf(map_banks[idx]->name, "TQM8xxL%d", idx); in init_tqm_mtd()
195 map_banks[idx]->size = flash_size; in init_tqm_mtd()
196 map_banks[idx]->buswidth = 4; in init_tqm_mtd()
197 map_banks[idx]->read8 = tqm8xxl_read8; in init_tqm_mtd()
198 map_banks[idx]->read16 = tqm8xxl_read16; in init_tqm_mtd()
199 map_banks[idx]->read32 = tqm8xxl_read32; in init_tqm_mtd()
200 map_banks[idx]->copy_from = tqm8xxl_copy_from; in init_tqm_mtd()
201 map_banks[idx]->write8 = tqm8xxl_write8; in init_tqm_mtd()
202 map_banks[idx]->write16 = tqm8xxl_write16; in init_tqm_mtd()
203 map_banks[idx]->write32 = tqm8xxl_write32; in init_tqm_mtd()
204 map_banks[idx]->copy_to = tqm8xxl_copy_to; in init_tqm_mtd()
205 map_banks[idx]->map_priv_1 = in init_tqm_mtd()
206 start_scan_addr + ((idx > 0) ? in init_tqm_mtd()
207 (mtd_banks[idx-1] ? mtd_banks[idx-1]->size : 0) : 0); in init_tqm_mtd()
209 mtd_banks[idx] = do_map_probe("cfi_probe", map_banks[idx]); in init_tqm_mtd()
210 if(mtd_banks[idx]) in init_tqm_mtd()
212 mtd_banks[idx]->module = THIS_MODULE; in init_tqm_mtd()
213 mtd_size += mtd_banks[idx]->size; in init_tqm_mtd()
216 mtd_banks[idx]->name, mtd_banks[idx]->size); in init_tqm_mtd()
238 for(idx = 0; idx < num_banks ; idx++) in init_tqm_mtd()
240 if (part_banks[idx].nums == 0) { in init_tqm_mtd()
241 …tk(KERN_NOTICE "TQM flash%d: no partition info available, registering whole flash at once\n", idx); in init_tqm_mtd()
242 add_mtd_device(mtd_banks[idx]); in init_tqm_mtd()
245 idx, part_banks[idx].type); in init_tqm_mtd()
246 add_mtd_partitions(mtd_banks[idx], part_banks[idx].mtd_part, in init_tqm_mtd()
247 part_banks[idx].nums); in init_tqm_mtd()
252 for(idx = 0 ; idx < num_banks ; idx++) in init_tqm_mtd()
253 add_mtd_device(mtd_banks[idx]); in init_tqm_mtd()
257 for(idx = 0 ; idx < FLASH_BANK_MAX ; idx++) in init_tqm_mtd()
259 if(map_banks[idx] != NULL) in init_tqm_mtd()
261 if(map_banks[idx]->name != NULL) in init_tqm_mtd()
263 kfree(map_banks[idx]->name); in init_tqm_mtd()
264 map_banks[idx]->name = NULL; in init_tqm_mtd()
266 kfree(map_banks[idx]); in init_tqm_mtd()
267 map_banks[idx] = NULL; in init_tqm_mtd()
279 unsigned int idx = 0; in cleanup_tqm_mtd() local
280 for(idx = 0 ; idx < num_banks ; idx++) in cleanup_tqm_mtd()
283 if (mtd_banks[idx]) { in cleanup_tqm_mtd()
284 del_mtd_partitions(mtd_banks[idx]); in cleanup_tqm_mtd()
285 map_destroy(mtd_banks[idx]); in cleanup_tqm_mtd()
288 kfree(map_banks[idx]->name); in cleanup_tqm_mtd()
289 kfree(map_banks[idx]); in cleanup_tqm_mtd()