Clean-up notification iterator creation function
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 11 Dec 2016 08:59:43 +0000 (03:59 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 18:09:08 +0000 (14:09 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/plugin-system/iterator.c

index 71393d1265f57f619ec49c2fb74b927c0c18f8b6..b0b5d38b63073ff5c2bda48014f8a69caa927949 100644 (file)
@@ -53,10 +53,19 @@ BT_HIDDEN
 struct bt_notification_iterator *bt_notification_iterator_create(
                struct bt_component *component)
 {
+       enum bt_component_type type;
        struct bt_notification_iterator *iterator = NULL;
 
-       if (!component ||
-               bt_component_get_type(component) != BT_COMPONENT_TYPE_SOURCE) {
+       if (!component) {
+               goto end;
+       }
+
+       type = bt_component_get_type(component);
+       switch (type) {
+       case BT_COMPONENT_TYPE_SOURCE:
+       case BT_COMPONENT_TYPE_FILTER:
+               break;
+       default:
                goto end;
        }
 
This page took 0.025205 seconds and 4 git commands to generate.