/* IMPORTANT: We are using a spinlock here: the function executed on each element has to be atomic.  */
int wlp_eda_for_each(struct wlp_eda *eda, wlp_eda_for_each_f function, void *priv)
/* IMPORTANT: We are using a spinlock here: the function executed on each element has to be atomic.  */
int wlp_eda_for_each(struct wlp_eda *eda, wlp_eda_for_each_f function, void *priv)
{
	int result = 0;
	struct wlp *wlp = container_of(eda, struct wlp, eda);
	struct wlp_eda_node *entry;
	unsigned long flags;
	spin_lock_irqsave(&eda->lock, flags);
	list_for_each_entry(entry, &eda->cache, list_node) {
		result = (*function)(wlp, entry, priv);
		if (result < 0)
			break;
	}
	spin_unlock_irqrestore(&eda->lock, flags);
	return result;
}