Skip to content

Commit

Permalink
Merge remote-tracking branch 'regmap/fix/core' into regmap-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Brown committed Sep 29, 2014
2 parents fe82dce + d6b41cb commit 25a9487
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ int _regmap_write(struct regmap *map, unsigned int reg,
}

#ifdef LOG_DEVICE
if (strcmp(dev_name(map->dev), LOG_DEVICE) == 0)
if (map->dev && strcmp(dev_name(map->dev), LOG_DEVICE) == 0)
dev_info(map->dev, "%x <= %x\n", reg, val);
#endif

Expand Down Expand Up @@ -1659,6 +1659,9 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
} else {
void *wval;

if (!val_count)
return -EINVAL;

wval = kmemdup(val, val_count * val_bytes, GFP_KERNEL);
if (!wval) {
dev_err(map->dev, "Error in memory allocation\n");
Expand Down Expand Up @@ -2058,7 +2061,7 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
ret = map->reg_read(context, reg, val);
if (ret == 0) {
#ifdef LOG_DEVICE
if (strcmp(dev_name(map->dev), LOG_DEVICE) == 0)
if (map->dev && strcmp(dev_name(map->dev), LOG_DEVICE) == 0)
dev_info(map->dev, "%x => %x\n", reg, *val);
#endif

Expand Down

0 comments on commit 25a9487

Please sign in to comment.