• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/mtd/

Lines Matching defs:erase

351 static int concat_dev_erase(struct mtd_info *mtd, struct erase_info *erase)
362 erase->mtd = mtd;
363 erase->callback = concat_erase_callback;
364 erase->priv = (unsigned long) &waitq;
366 err = mtd->erase(mtd, erase);
370 if (erase->state != MTD_ERASE_DONE
371 && erase->state != MTD_ERASE_FAILED)
376 err = (erase->state == MTD_ERASE_FAILED) ? -EIO : 0;
387 struct erase_info *erase;
399 * Check for proper erase block alignment of the to-be-erased area.
400 * It is easier to do this based on the super device's erase
405 /* the easy case: device has uniform erase block size */
411 /* device has variable erase size */
416 * Find the erase region where the to-be-erased area begins:
425 * offset is aligned to this region's erase size:
431 * now find the erase region where the to-be-erased area ends:
438 * check if the ending offset is aligned to this region's erase size
448 erase = kmalloc(sizeof (struct erase_info), GFP_KERNEL);
450 if (!erase)
453 *erase = *instr;
462 if (subdev->size <= erase->addr) {
463 erase->addr -= subdev->size;
473 /* now do the erase: */
480 if (erase->addr + length > subdev->size)
481 erase->len = subdev->size - erase->addr;
483 erase->len = length;
489 length -= erase->len;
490 if ((err = concat_dev_erase(subdev, erase))) {
494 if (erase->fail_addr != 0xffffffff)
495 instr->fail_addr = erase->fail_addr + offset;
499 * erase->addr specifies the offset of the area to be
506 erase->addr = 0;
509 instr->state = erase->state;
510 kfree(erase);
788 concat->mtd.erase = concat_erase;
798 * Combine the erase block size info of the subdevices:
801 * many changes in erase size we have
807 /* current subdevice has uniform erase size */
809 /* if it differs from the last subdevice's erase size, count it */
816 /* current subdevice has variable erase size */
820 /* walk the list of erase regions, count any changes */
836 * All subdevices have the same uniform erase size.
843 * erase block size varies across the subdevices: allocate
844 * space to store the data describing the variable erase regions
857 ("memory allocation error while creating erase region list"
864 * in erase region info:
870 /* current subdevice has uniform erase size */
888 /* current subdevice has variable erase size */
891 /* walk the list of erase regions, count any changes */