dts: rk3228: add i2s, spdif dts node
[firefly-linux-kernel-4.4.55.git] / lib / klist.c
index a2741a7d9784ec70032253dc82668c7786bc3dbf..358a368a2947057ef9d9309c9dd4fc893523d63d 100644 (file)
@@ -193,10 +193,10 @@ static void klist_release(struct kref *kref)
                if (waiter->node != n)
                        continue;
 
+               list_del(&waiter->list);
                waiter->woken = 1;
                mb();
                wake_up_process(waiter->process);
-               list_del(&waiter->list);
        }
        spin_unlock(&klist_remove_lock);
        knode_set_klist(n, NULL);
@@ -278,19 +278,13 @@ EXPORT_SYMBOL_GPL(klist_node_attached);
  * Similar to klist_iter_init(), but starts the action off with @n,
  * instead of with the list head.
  */
-int klist_iter_init_node(struct klist *k, struct klist_iter *i,
-                        struct klist_node *n)
+void klist_iter_init_node(struct klist *k, struct klist_iter *i,
+                         struct klist_node *n)
 {
-       if (n) {
-               kref_get(&n->n_ref);
-               if (!n->n_klist) {
-                       kref_put(&n->n_ref);
-                       return -ENODEV;
-               }
-       }
        i->i_klist = k;
        i->i_cur = n;
-       return 0;
+       if (n)
+               kref_get(&n->n_ref);
 }
 EXPORT_SYMBOL_GPL(klist_iter_init_node);