Skip to content

Commit

Permalink
regmap: change struct regmap's internal locks as union
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang, Yalin authored and Mark Brown committed Sep 12, 2014
1 parent 9ba1e45 commit 336fb81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/base/regmap/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 336fb81

Please sign in to comment.