Lines Matching defs:erase

369 	struct erase_info *erase;
372 * Check for proper erase block alignment of the to-be-erased area.
373 * It is easier to do this based on the super device's erase
378 /* the easy case: device has uniform erase block size */
384 /* device has variable erase size */
389 * Find the erase region where the to-be-erased area begins:
398 * offset is aligned to this region's erase size:
404 * now find the erase region where the to-be-erased area ends:
411 * check if the ending offset is aligned to this region's erase size
419 erase = kmalloc(sizeof (struct erase_info), GFP_KERNEL);
421 if (!erase)
424 *erase = *instr;
433 if (subdev->size <= erase->addr) {
434 erase->addr -= subdev->size;
444 /* now do the erase: */
451 if (erase->addr + length > subdev->size)
452 erase->len = subdev->size - erase->addr;
454 erase->len = length;
456 length -= erase->len;
457 if ((err = mtd_erase(subdev, erase))) {
461 if (erase->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
462 instr->fail_addr = erase->fail_addr + offset;
466 * erase->addr specifies the offset of the area to be
473 erase->addr = 0;
476 kfree(erase);
770 * Combine the erase block size info of the subdevices:
773 * many changes in erase size we have
779 /* current subdevice has uniform erase size */
781 /* if it differs from the last subdevice's erase size, count it */
788 /* current subdevice has variable erase size */
792 /* walk the list of erase regions, count any changes */
808 * All subdevices have the same uniform erase size.
817 * erase block size varies across the subdevices: allocate
818 * space to store the data describing the variable erase regions
832 ("memory allocation error while creating erase region list"
839 * erase region info:
845 /* current subdevice has uniform erase size */
864 /* current subdevice has variable erase size */
867 /* walk the list of erase regions, count any changes */