unsigned int base, top;
int nodes = 0;
int registers = 0;
+++ int average;
-- - mutex_lock(&map->lock);
++ + map->lock(map);
for (node = rb_first(&rbtree_ctx->root); node != NULL;
node = rb_next(node)) {
registers += top - base + 1;
}
+++ if (nodes)
+++ average = registers / nodes;
+++ else
+++ average = 0;
+++
seq_printf(s, "%d nodes, %d registers, average %d registers\n",
--- nodes, registers, registers / nodes);
+++ nodes, registers, average);
-- - mutex_unlock(&map->lock);
++ + map->unlock(map);
return 0;
}
map->format.pad_bytes = config->pad_bits / 8;
map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8);
map->format.buf_size += map->format.pad_bytes;
+ ++ map->reg_shift = config->pad_bits % 8;
map->dev = dev;
map->bus = bus;
++ + map->bus_context = bus_context;
map->max_register = config->max_register;
map->writeable_reg = config->writeable_reg;
map->readable_reg = config->readable_reg;