/* The caller will ensure that there is a node ready for the state. The node may already contain the old state, in which case it is overridden. */
static int cros_ec_write_state(void *blob, int node)
/* The caller will ensure that there is a node ready for the state. The node may already contain the old state, in which case it is overridden. */
static int cros_ec_write_state(void *blob, int node)
{
	struct ec_state *ec = g_state;
	fdt_setprop_u32(blob, node, "current-image", ec->current_image);
	fdt_setprop(blob, node, "vbnv-context", ec->vbnv_context,
		    sizeof(ec->vbnv_context));
	return state_setprop(node, "flash-data", ec->flash_data,
			     ec->ec_config.flash.length);
}