regmap: change struct regmap's internal locks as union
authorWang, Yalin <Yalin.Wang@sonymobile.com>
Thu, 11 Sep 2014 08:19:49 +0000 (16:19 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 12 Sep 2014 13:57:26 +0000 (14:57 +0100)
this patch change struct regmap->mutex and struct regmap->spinlock
as an union, because these 2 members are only used one of them,
we change it to shrink the struct size.

Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/internal.h

index 7d1326985bee8b4d3e9dcb326bf795622901bf49..f82e8faa5d938c9c38255145f9eba1689dd7b933 100644 (file)
@@ -49,8 +49,10 @@ struct regmap_async {
 };
 
 struct regmap {
-       struct mutex mutex;
-       spinlock_t spinlock;
+       union {
+               struct mutex mutex;
+               spinlock_t spinlock;
+       };
        unsigned long spinlock_flags;
        regmap_lock lock;
        regmap_unlock unlock;