Remove useless component/iterator validation functions
[babeltrace.git] / lib / graph / component.c
index 4ea9bd864546cbe63f72bf5f0ab202246d15023f..9fad68ac968074a71c0aeb6c017c954599e85e25 100644 (file)
@@ -65,14 +65,6 @@ void (*component_destroy_funcs[])(struct bt_component *) = {
        [BT_COMPONENT_CLASS_TYPE_FILTER] = bt_component_filter_destroy,
 };
 
-static
-enum bt_component_status (* const component_validation_funcs[])(
-               struct bt_component *) = {
-       [BT_COMPONENT_CLASS_TYPE_SOURCE] = bt_component_source_validate,
-       [BT_COMPONENT_CLASS_TYPE_SINK] = bt_component_sink_validate,
-       [BT_COMPONENT_CLASS_TYPE_FILTER] = bt_component_filter_validate,
-};
-
 static
 void bt_component_destroy(struct bt_object *obj)
 {
@@ -336,8 +328,6 @@ struct bt_component *bt_component_create_with_init_method_data(
                goto end;
        }
 
-       component->initializing = BT_TRUE;
-
        if (component_class->methods.init) {
                BT_LOGD_STR("Calling user's initialization method.");
                ret = component_class->methods.init(
@@ -345,7 +335,6 @@ struct bt_component *bt_component_create_with_init_method_data(
                        init_method_data);
                BT_LOGD("User method returned: status=%s",
                        bt_component_status_string(ret));
-               component->initializing = BT_FALSE;
                if (ret != BT_COMPONENT_STATUS_OK) {
                        BT_LOGW_STR("Initialization method failed.");
                        BT_PUT(component);
@@ -353,15 +342,6 @@ struct bt_component *bt_component_create_with_init_method_data(
                }
        }
 
-       component->initializing = BT_FALSE;
-       ret = component_validation_funcs[type](component);
-       if (ret != BT_COMPONENT_STATUS_OK) {
-               BT_LOGW("Component is invalid: status=%s",
-                       bt_component_status_string(ret));
-               BT_PUT(component);
-               goto end;
-       }
-
        BT_LOGD_STR("Freezing component class.");
        bt_component_class_freeze(component->class);
        BT_LOGD("Created component from component class: "
@@ -428,11 +408,6 @@ enum bt_component_status bt_private_component_set_user_data(
                goto end;
        }
 
-       if (!component->initializing) {
-               ret = BT_COMPONENT_STATUS_INVALID;
-               goto end;
-       }
-
        component->user_data = data;
        BT_LOGV("Set component's user data: "
                "comp-addr=%p, comp-name=\"%s\", user-data-addr=%p",
This page took 0.035772 seconds and 4 git commands to generate.