/* Get size of the sector (in bytes), which covers the address specified  */
static u32 spansion_sec_size(struct spansion_spi_flash *spsn, u32 addr)
/* Get size of the sector (in bytes), which covers the address specified  */
static u32 spansion_sec_size(struct spansion_spi_flash *spsn, u32 addr)
{
	struct spansion_spi_flash_params	*p = spsn->params;
	u32					size = 0, i;
	for (i = 0; i < DIF_SEC_SIZE_NUM; i++) {
		if (!(addr < p->end[i]))
			continue;
		size = p->page_size * p->pages_per_sector[i];
		break;
	}
	return size;
}