Skip to content

Commit

Permalink
regmap: Remove indexed cache type
Browse files Browse the repository at this point in the history
There should be no situation where it offers any advantage over rbtree
and there are no current users so remove the code for simplicity.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Nov 20, 2011
1 parent b44d48c commit 4c69166
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 89 deletions.
2 changes: 1 addition & 1 deletion drivers/base/regmap/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
obj-$(CONFIG_REGMAP) += regmap.o regcache.o regcache-indexed.o
obj-$(CONFIG_REGMAP) += regmap.o regcache.o
obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.o
obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
Expand Down
3 changes: 0 additions & 3 deletions drivers/base/regmap/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,7 @@ unsigned int regcache_get_val(const void *base, unsigned int idx,
bool regcache_set_val(void *base, unsigned int idx,
unsigned int val, unsigned int word_size);
int regcache_lookup_reg(struct regmap *map, unsigned int reg);
int regcache_insert_reg(struct regmap *map, unsigned int reg,
unsigned int val);

extern struct regcache_ops regcache_indexed_ops;
extern struct regcache_ops regcache_rbtree_ops;
extern struct regcache_ops regcache_lzo_ops;

Expand Down
64 changes: 0 additions & 64 deletions drivers/base/regmap/regcache-indexed.c

This file was deleted.

20 changes: 0 additions & 20 deletions drivers/base/regmap/regcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "internal.h"

static const struct regcache_ops *cache_types[] = {
&regcache_indexed_ops,
&regcache_rbtree_ops,
&regcache_lzo_ops,
};
Expand Down Expand Up @@ -420,22 +419,3 @@ int regcache_lookup_reg(struct regmap *map, unsigned int reg)
else
return -ENOENT;
}

int regcache_insert_reg(struct regmap *map, unsigned int reg,
unsigned int val)
{
void *tmp;

tmp = krealloc(map->reg_defaults,
(map->num_reg_defaults + 1) * sizeof(struct reg_default),
GFP_KERNEL);
if (!tmp)
return -ENOMEM;
map->reg_defaults = tmp;
map->num_reg_defaults++;
map->reg_defaults[map->num_reg_defaults - 1].reg = reg;
map->reg_defaults[map->num_reg_defaults - 1].def = val;
sort(map->reg_defaults, map->num_reg_defaults,
sizeof(struct reg_default), regcache_default_cmp, NULL);
return 0;
}
1 change: 0 additions & 1 deletion include/linux/regmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct spi_device;
/* An enum of all the supported cache types */
enum regcache_type {
REGCACHE_NONE,
REGCACHE_INDEXED,
REGCACHE_RBTREE,
REGCACHE_COMPRESSED
};
Expand Down

0 comments on commit 4c69166

Please sign in to comment.