+ node->table = NULL;
+ node->len = 0;
+}
+
+static const struct ec_config_schema ec_node_or_subschema[] = {
+ {
+ .desc = "A child node which is part of the choice.",
+ .type = EC_CONFIG_TYPE_NODE,
+ },
+ {
+ .type = EC_CONFIG_TYPE_NONE,
+ },
+};
+
+static const struct ec_config_schema ec_node_or_schema[] = {
+ {
+ .key = "children",
+ .desc = "The list of children nodes defining the choice "
+ "elements.",
+ .type = EC_CONFIG_TYPE_LIST,
+ .subschema = ec_node_or_subschema,
+ },
+ {
+ .type = EC_CONFIG_TYPE_NONE,
+ },
+};
+
+static int ec_node_or_set_config(struct ec_node *gen_node,
+ const struct ec_config *config)
+{
+ struct ec_node_or *node = (struct ec_node_or *)gen_node;
+ struct ec_node **table = NULL;
+ size_t i, len = 0;
+
+ table = ec_node_config_node_list_to_table(
+ ec_config_dict_get(config, "children"), &len);
+ if (table == NULL)
+ goto fail;
+
+ for (i = 0; i < node->len; i++)
+ ec_node_free(node->table[i]);
+ ec_free(node->table);
+ node->table = table;
+ node->len = len;
+
+ return 0;
+
+fail:
+ for (i = 0; i < len; i++)
+ ec_node_free(table[i]);
+ ec_free(table);
+ return -1;