Skip to content

Commit 336fb81

Browse files
Wang, Yalinbroonie
authored andcommitted
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>
1 parent 9ba1e45 commit 336fb81

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/base/regmap/internal.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ struct regmap_async {
4949
};
5050

5151
struct regmap {
52-
struct mutex mutex;
53-
spinlock_t spinlock;
52+
union {
53+
struct mutex mutex;
54+
spinlock_t spinlock;
55+
};
5456
unsigned long spinlock_flags;
5557
regmap_lock lock;
5658
regmap_unlock unlock;

0 commit comments

Comments
 (0)