We need the mutex only around the iteration over existing hosts.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
h->speed_map = (u8 *)(h->csr.speed_map + 2);
mutex_lock(&host_num_alloc);
-
while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb))
hostnum++;
-
+ mutex_unlock(&host_num_alloc);
h->id = hostnum;
memcpy(&h->device, &nodemgr_dev_template_host, sizeof(h->device));
class_device_register(&h->class_dev);
get_device(&h->device);
- mutex_unlock(&host_num_alloc);
-
return h;
}