Lines Matching full:erase

346 static int concat_dev_erase(struct mtd_info *mtd, struct erase_info *erase)  in concat_dev_erase()  argument
357 erase->mtd = mtd; in concat_dev_erase()
358 erase->callback = concat_erase_callback; in concat_dev_erase()
359 erase->priv = (unsigned long) &waitq; in concat_dev_erase()
365 err = mtd_erase(mtd, erase); in concat_dev_erase()
369 if (erase->state != MTD_ERASE_DONE in concat_dev_erase()
370 && erase->state != MTD_ERASE_FAILED) in concat_dev_erase()
375 err = (erase->state == MTD_ERASE_FAILED) ? -EIO : 0; in concat_dev_erase()
386 struct erase_info *erase; in concat_erase() local
389 * Check for proper erase block alignment of the to-be-erased area. in concat_erase()
390 * It is easier to do this based on the super device's erase in concat_erase()
395 /* the easy case: device has uniform erase block size */ in concat_erase()
401 /* device has variable erase size */ in concat_erase()
406 * Find the erase region where the to-be-erased area begins: in concat_erase()
415 * offset is aligned to this region's erase size: in concat_erase()
421 * now find the erase region where the to-be-erased area ends: in concat_erase()
428 * check if the ending offset is aligned to this region's erase size in concat_erase()
436 erase = kmalloc(sizeof (struct erase_info), GFP_KERNEL); in concat_erase()
438 if (!erase) in concat_erase()
441 *erase = *instr; in concat_erase()
450 if (subdev->size <= erase->addr) { in concat_erase()
451 erase->addr -= subdev->size; in concat_erase()
461 /* now do the erase: */ in concat_erase()
468 if (erase->addr + length > subdev->size) in concat_erase()
469 erase->len = subdev->size - erase->addr; in concat_erase()
471 erase->len = length; in concat_erase()
473 length -= erase->len; in concat_erase()
474 if ((err = concat_dev_erase(subdev, erase))) { in concat_erase()
478 if (erase->fail_addr != MTD_FAIL_ADDR_UNKNOWN) in concat_erase()
479 instr->fail_addr = erase->fail_addr + offset; in concat_erase()
483 * erase->addr specifies the offset of the area to be in concat_erase()
490 erase->addr = 0; in concat_erase()
493 instr->state = erase->state; in concat_erase()
494 kfree(erase); in concat_erase()
825 * Combine the erase block size info of the subdevices: in mtd_concat_create()
828 * many changes in erase size we have in mtd_concat_create()
834 /* current subdevice has uniform erase size */ in mtd_concat_create()
836 /* if it differs from the last subdevice's erase size, count it */ in mtd_concat_create()
843 /* current subdevice has variable erase size */ in mtd_concat_create()
847 /* walk the list of erase regions, count any changes */ in mtd_concat_create()
863 * All subdevices have the same uniform erase size. in mtd_concat_create()
872 * erase block size varies across the subdevices: allocate in mtd_concat_create()
873 * space to store the data describing the variable erase regions in mtd_concat_create()
886 ("memory allocation error while creating erase region list" in mtd_concat_create()
893 * in erase region info: in mtd_concat_create()
899 /* current subdevice has uniform erase size */ in mtd_concat_create()
918 /* current subdevice has variable erase size */ in mtd_concat_create()
921 /* walk the list of erase regions, count any changes */ in mtd_concat_create()