Lines Matching refs:erase
269 static void erase_callback(struct erase_info *erase) in erase_callback() argument
276 part = (struct partition*)erase->priv; in erase_callback()
278 i = (u32)erase->addr / part->block_size; in erase_callback()
279 if (i >= part->total_blocks || part->blocks[i].offset != erase->addr || in erase_callback()
280 erase->addr > UINT_MAX) { in erase_callback()
282 "on '%s'\n", (unsigned long long)erase->addr, part->mbd.mtd->name); in erase_callback()
286 if (erase->state != MTD_ERASE_DONE) { in erase_callback()
288 "state %d\n", (unsigned long long)erase->addr, in erase_callback()
289 part->mbd.mtd->name, erase->state); in erase_callback()
295 kfree(erase); in erase_callback()
323 kfree(erase); in erase_callback()
328 struct erase_info *erase; in erase_block() local
331 erase = kmalloc(sizeof(struct erase_info), GFP_KERNEL); in erase_block()
332 if (!erase) in erase_block()
335 erase->mtd = part->mbd.mtd; in erase_block()
336 erase->callback = erase_callback; in erase_block()
337 erase->addr = part->blocks[block].offset; in erase_block()
338 erase->len = part->block_size; in erase_block()
339 erase->priv = (u_long)part; in erase_block()
344 rc = mtd_erase(part->mbd.mtd, erase); in erase_block()
348 "failed\n", (unsigned long long)erase->addr, in erase_block()
349 (unsigned long long)erase->len, part->mbd.mtd->name); in erase_block()
350 kfree(erase); in erase_block()