/* @blob: Pointer to device tree blob, or NULL if no data to read @node: Node offset to read from  */
static int sandbox_tpm_read_state(const void *blob, int node)
/* @blob: Pointer to device tree blob, or NULL if no data to read @node: Node offset to read from  */
static int sandbox_tpm_read_state(const void *blob, int node)
{
	const char *prop;
	int len;
	int i;
	if (!blob)
		return 0;
	for (i = 0; i < NV_SEQ_COUNT; i++) {
		char prop_name[20];
		sprintf(prop_name, "nvdata%d", i);
		prop = fdt_getprop(blob, node, prop_name, &len);
		if (prop && len == NV_DATA_SIZE) {
			memcpy(g_state.nvdata[i].data, prop, NV_DATA_SIZE);
			g_state.nvdata[i].present = true;
		}
	}
	g_state.valid = true;
	return 0;
}