Selaa lähdekoodia

regmap: change struct regmap's internal locks as union

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>
Wang, Yalin 11 vuotta sitten
vanhempi
commit
336fb81b31
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      drivers/base/regmap/internal.h

+ 4 - 2
drivers/base/regmap/internal.h

@@ -49,8 +49,10 @@ struct regmap_async {
 };
 };
 
 
 struct regmap {
 struct regmap {
-	struct mutex mutex;
-	spinlock_t spinlock;
+	union {
+		struct mutex mutex;
+		spinlock_t spinlock;
+	};
 	unsigned long spinlock_flags;
 	unsigned long spinlock_flags;
 	regmap_lock lock;
 	regmap_lock lock;
 	regmap_unlock unlock;
 	regmap_unlock unlock;