+static const struct ec_config_schema ec_node_option_schema[] = {
+ {
+ .key = "child",
+ .desc = "The child node.",
+ .type = EC_CONFIG_TYPE_NODE,
+ },
+ {
+ .type = EC_CONFIG_TYPE_NONE,
+ },
+};
+
+static int ec_node_option_set_config(struct ec_node *gen_node,
+ const struct ec_config *config)
+{
+ struct ec_node_option *node = (struct ec_node_option *)gen_node;
+ const struct ec_config *child;
+
+ child = ec_config_dict_get(config, "child");
+ if (child == NULL)
+ goto fail;
+ if (ec_config_get_type(child) != EC_CONFIG_TYPE_NODE) {
+ errno = EINVAL;
+ goto fail;
+ }
+
+ if (node->child != NULL)
+ ec_node_free(node->child);
+ node->child = ec_node_clone(child->node);
+
+ return 0;
+
+fail:
+ return -1;
+}
+