Lines Matching refs:erase
341 static int concat_dev_erase(struct mtd_info *mtd, struct erase_info *erase) in concat_dev_erase() argument
352 erase->mtd = mtd; in concat_dev_erase()
353 erase->callback = concat_erase_callback; in concat_dev_erase()
354 erase->priv = (unsigned long) &waitq; in concat_dev_erase()
360 err = mtd_erase(mtd, erase); in concat_dev_erase()
364 if (erase->state != MTD_ERASE_DONE in concat_dev_erase()
365 && erase->state != MTD_ERASE_FAILED) in concat_dev_erase()
370 err = (erase->state == MTD_ERASE_FAILED) ? -EIO : 0; in concat_dev_erase()
381 struct erase_info *erase; in concat_erase() local
431 erase = kmalloc(sizeof (struct erase_info), GFP_KERNEL); in concat_erase()
433 if (!erase) in concat_erase()
436 *erase = *instr; in concat_erase()
445 if (subdev->size <= erase->addr) { in concat_erase()
446 erase->addr -= subdev->size; in concat_erase()
463 if (erase->addr + length > subdev->size) in concat_erase()
464 erase->len = subdev->size - erase->addr; in concat_erase()
466 erase->len = length; in concat_erase()
468 length -= erase->len; in concat_erase()
469 if ((err = concat_dev_erase(subdev, erase))) { in concat_erase()
473 if (erase->fail_addr != MTD_FAIL_ADDR_UNKNOWN) in concat_erase()
474 instr->fail_addr = erase->fail_addr + offset; in concat_erase()
485 erase->addr = 0; in concat_erase()
488 instr->state = erase->state; in concat_erase()
489 kfree(erase); in concat_erase()