/* Notifier function for lancmd replies. Called from read irq.  */
static void lcs_notify_lancmd_waiters(struct lcs_card *card, struct lcs_cmd *cmd)
/* Notifier function for lancmd replies. Called from read irq.  */
static void lcs_notify_lancmd_waiters(struct lcs_card *card, struct lcs_cmd *cmd)
{
	struct list_head *l, *n;
	struct lcs_reply *reply;
	LCS_DBF_TEXT(4, trace, "notiwait");
	spin_lock(&card->lock);
	list_for_each_safe(l, n, &card->lancmd_waiters) {
		reply = list_entry(l, struct lcs_reply, list);
		if (reply->sequence_no == cmd->sequence_no) {
			lcs_get_reply(reply);
			list_del_init(&reply->list);
			if (reply->callback != NULL)
				reply->callback(card, cmd);
			reply->received = 1;
			reply->rc = cmd->return_code;
			wake_up(&reply->wait_q);
			lcs_put_reply(reply);
			break;
		}
	}
	spin_unlock(&card->lock);
}