+enum bt_component_status bt_component_sink_set_add_iterator_cb(
+ struct bt_component *component,
+ bt_component_sink_add_iterator_cb add_iterator)
+{
+ struct bt_component_sink *sink;
+ enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
+
+ if (!component) {
+ ret = BT_COMPONENT_STATUS_INVALID;
+ goto end;
+ }
+
+ if (bt_component_get_type(component) != BT_COMPONENT_TYPE_SINK) {
+ ret = BT_COMPONENT_STATUS_UNSUPPORTED;
+ goto end;
+ }
+
+ if (!component->initializing) {
+ ret = BT_COMPONENT_STATUS_INVALID;
+ goto end;
+ }
+
+ sink = container_of(component, struct bt_component_sink, parent);
+ sink->add_iterator = add_iterator;
+end:
+ return ret;
+}
+