Commit 25a94877 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branch 'regmap/fix/core' into regmap-linus

parents fe82dcec d6b41cb0
...@@ -1408,7 +1408,7 @@ int _regmap_write(struct regmap *map, unsigned int reg, ...@@ -1408,7 +1408,7 @@ int _regmap_write(struct regmap *map, unsigned int reg,
} }
#ifdef LOG_DEVICE #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); dev_info(map->dev, "%x <= %x\n", reg, val);
#endif #endif
...@@ -1659,6 +1659,9 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, ...@@ -1659,6 +1659,9 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
} else { } else {
void *wval; void *wval;
if (!val_count)
return -EINVAL;
wval = kmemdup(val, val_count * val_bytes, GFP_KERNEL); wval = kmemdup(val, val_count * val_bytes, GFP_KERNEL);
if (!wval) { if (!wval) {
dev_err(map->dev, "Error in memory allocation\n"); dev_err(map->dev, "Error in memory allocation\n");
...@@ -2058,7 +2061,7 @@ static int _regmap_read(struct regmap *map, unsigned int reg, ...@@ -2058,7 +2061,7 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
ret = map->reg_read(context, reg, val); ret = map->reg_read(context, reg, val);
if (ret == 0) { if (ret == 0) {
#ifdef LOG_DEVICE #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); dev_info(map->dev, "%x => %x\n", reg, *val);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment