#define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE)
#define eql_is_master(dev) ((dev->flags & IFF_MASTER) == IFF_MASTER)
-static void eql_kill_one_slave(slave_t *slave);
+static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave);
static void eql_timer(unsigned long param)
{
if (slave->bytes_queued < 0)
slave->bytes_queued = 0;
} else {
- eql_kill_one_slave(slave);
+ eql_kill_one_slave(&eql->queue, slave);
}
}
return 0;
}
-static void eql_kill_one_slave(slave_t *slave)
+static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave)
{
list_del(&slave->list);
+ queue->num_slaves--;
slave->dev->flags &= ~IFF_SLAVE;
dev_put(slave->dev);
kfree(slave);
list_for_each_safe(this, tmp, head) {
slave_t *s = list_entry(this, slave_t, list);
- eql_kill_one_slave(s);
- queue->num_slaves--;
+ eql_kill_one_slave(queue, s);
}
spin_unlock_bh(&queue->lock);
}
} else {
/* We found a dead slave, kill it. */
- eql_kill_one_slave(slave);
+ eql_kill_one_slave(queue, slave);
}
}
return best_slave;
duplicate_slave = __eql_find_slave_dev(queue, slave->dev);
if (duplicate_slave != 0)
- eql_kill_one_slave(duplicate_slave);
+ eql_kill_one_slave(queue, duplicate_slave);
list_add(&slave->list, &queue->all_slaves);
queue->num_slaves++;
slave_dev);
if (slave) {
- eql_kill_one_slave(slave);
+ eql_kill_one_slave(&eql->queue, slave);
ret = 0;
}
}