/* Erase the specified block of the device, retrying several time if it fails.  */
uint32_t nand_flash_raw_erase_block(const struct nand_flash_raw *raw, uint16_t block)
/* Erase the specified block of the device, retrying several time if it fails.  */
uint32_t nand_flash_raw_erase_block(const struct nand_flash_raw *raw, uint16_t block)
{
	uint32_t num_try = CONF_NF_ERASE_NUM_TRY;
	while (num_try > 0) {
		if (!erase_block(raw, block)) {
			return 0;
		}
		num_try--;
	}
	return NAND_COMMON_ERROR_BADBLOCK;
}