lkml.org 
[lkml]   [2016]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] regmap: Add a function to check if a regmap register is cached
On Thu, Aug 04, 2016 at 05:55:57PM +0300, Cristian Birsan wrote:

> +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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-08-04 18:41    [W:0.062 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site