* [PATCH 2/3] regmap: fix regcache_reg_present() for empty cache
@ 2013-08-09 10:09 Ionut Nicu
2013-08-09 11:47 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Ionut Nicu @ 2013-08-09 10:09 UTC (permalink / raw)
To: Mark Brown; +Cc: Greg Kroah-Hartman, linux-kernel
In the initial case when no reg_defaults values are
provided and no register value was added to the cache
yet, the cache_present bitmap is NULL. If this function
is invoked for any register it should return false
(i.e. the register is not cached) instead of true.
Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
---
drivers/base/regmap/internal.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index 29c8316..5308e3e 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -223,7 +223,7 @@ int regcache_set_reg_present(struct regmap *map, unsigned int reg);
static inline bool regcache_reg_present(struct regmap *map, unsigned int reg)
{
if (!map->cache_present)
- return true;
+ return false;
if (reg > map->cache_present_nbits)
return false;
return map->cache_present[BIT_WORD(reg)] & BIT_MASK(reg);
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-09 11:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-09 10:09 [PATCH 2/3] regmap: fix regcache_reg_present() for empty cache Ionut Nicu
2013-08-09 11:47 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox