Refactor the component class and component API
[babeltrace.git] / lib / component / source.c
index a0a21d1b893901a8dd080394c936850b34bf76b0..7b51590c7214117fc3a080b67f07f3d8c94c82af 100644 (file)
@@ -38,7 +38,6 @@ enum bt_component_status bt_component_source_validate(
                struct bt_component *component)
 {
        enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
-       struct bt_component_source *source;
 
        if (!component) {
                ret = BT_COMPONENT_STATUS_INVALID;
@@ -50,16 +49,11 @@ enum bt_component_status bt_component_source_validate(
                goto end;
        }
 
-       if (component->class->type != BT_COMPONENT_TYPE_SOURCE) {
+       if (component->class->type != BT_COMPONENT_CLASS_TYPE_SOURCE) {
                ret = BT_COMPONENT_STATUS_INVALID;
                goto end;
        }
 
-       source = container_of(component, struct bt_component_source, parent);
-       if (!source->init_iterator) {
-               ret = BT_COMPONENT_STATUS_INVALID;
-               goto end;
-       }
 end:
        return ret;
 }
@@ -86,25 +80,6 @@ end:
        return source ? &source->parent : NULL;
 }
 
-enum bt_component_status
-bt_component_source_set_iterator_init_cb(struct bt_component *component,
-               bt_component_source_init_iterator_cb init_iterator)
-{
-       struct bt_component_source *source;
-       enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
-
-       if (component->class->type != BT_COMPONENT_TYPE_SOURCE ||
-                       !component->initializing) {
-               ret = BT_COMPONENT_STATUS_INVALID;
-               goto end;
-       }
-
-       source = container_of(component, struct bt_component_source, parent);
-       source->init_iterator = init_iterator;
-end:
-       return ret;
-}
-
 struct bt_notification_iterator *bt_component_source_create_iterator(
                struct bt_component *component)
 {
This page took 0.023406 seconds and 4 git commands to generate.