[PATCH 1/2] regmap: Add a function to check if a regmap register is cached

From
Mark Brown <broonie@kernel.org>
Date
2016-08-04 15:48:41
Also in
lkml
Reply to
Cristian Birsan, 2016-08-04
On Thu, Aug 04, 2016 at 05:55:57PM +0300, Cristian Birsan wrote:
quoted hunk ↗ jump to hunk
+bool regmap_cached(struct regmap *map, unsigned int reg)
+{
+	if (map->cache == REGCACHE_NONE)
+		return false;
+
+	if (!map->cache_ops)
+		return false;
+
+	if (map->max_register && reg > map->max_register)
+		return false;
+
+	return true;
+}
As Lars said this isn't actually checking if the register is cached.  To
do this you need to modify the output code to check if there's a value
cached and try a read if there is one instead.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160804/c7df4d0f/attachment.sig>
Thread (15 messages) 15 messages, 5 authors, last reply 2016-08-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help