[PATCH 4/8] regmap: Guard regcache_sync() with map->lock

From: Dimitris Papastamos
Date: Thu Sep 29 2011 - 05:39:21 EST


Signed-off-by: Dimitris Papastamos <dp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
---
drivers/base/regmap/regcache.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index b6efde7..674da82 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -230,6 +230,7 @@ int regcache_sync(struct regmap *map)

BUG_ON(!map->cache_ops);

+ mutex_lock(&map->lock);
dev_dbg(map->dev, "Syncing %s cache\n",
map->cache_ops->name);
name = map->cache_ops->name;
@@ -254,6 +255,7 @@ int regcache_sync(struct regmap *map)
}
out:
trace_regcache_sync(map->dev, name, "stop");
+ mutex_unlock(&map->lock);

return ret;
}
--
1.7.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/