/* Initialize the FLASH HAL instance and hardware for callback mode.  */
int32_t flash_init(struct flash_descriptor *flash, void *const hw)
/* Initialize the FLASH HAL instance and hardware for callback mode.  */
int32_t flash_init(struct flash_descriptor *flash, void *const hw)
{
	int32_t rc;
	ASSERT(flash && hw);
	rc = _flash_init(&flash->dev, hw);
	if (rc) {
		return rc;
	}
	flash->dev.flash_cb.ready_cb = flash_ready;
	flash->dev.flash_cb.error_cb = flash_error;
	return ERR_NONE;
}