Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280544
b: refs/heads/master
c: 720e461
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Nov 16, 2011
1 parent 5dd07a2 commit da83b7c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e5e3b8abeda1cf45f5a079458dbc267952694c7a
refs/heads/master: 720e4616e8fd85284ef1addd8b8d93d8415e8dbc
5 changes: 2 additions & 3 deletions trunk/drivers/base/regmap/regcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
return -EINVAL;
}

map->reg_defaults = config->reg_defaults;
map->num_reg_defaults = config->num_reg_defaults;
map->num_reg_defaults_raw = config->num_reg_defaults_raw;
map->reg_defaults_raw = config->reg_defaults_raw;
Expand All @@ -127,10 +126,10 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
* won't vanish from under us. We'll need to make
* a copy of it.
*/
if (map->reg_defaults) {
if (config->reg_defaults) {
if (!map->num_reg_defaults)
return -EINVAL;
tmp_buf = kmemdup(map->reg_defaults, map->num_reg_defaults *
tmp_buf = kmemdup(config->reg_defaults, map->num_reg_defaults *
sizeof(struct reg_default), GFP_KERNEL);
if (!tmp_buf)
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/regmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct regmap_config {
bool (*precious_reg)(struct device *dev, unsigned int reg);

unsigned int max_register;
struct reg_default *reg_defaults;
const struct reg_default *reg_defaults;
unsigned int num_reg_defaults;
enum regcache_type cache_type;
const void *reg_defaults_raw;
Expand Down

0 comments on commit da83b7c

Please sign in to comment.