kernel/drivers/base/regmap/regcache.c
.. .. @@ -343,6 +343,9 @@ 343 343 const char *name; 344 344 bool bypass; 345 345 346 + if (WARN_ON(map->cache_type == REGCACHE_NONE))347 + return -EINVAL;348 +346 349 BUG_ON(!map->cache_ops); 347 350 348 351 map->lock(map->lock_arg); .. .. @@ -412,6 +415,9 @@ 412 415 const char *name; 413 416 bool bypass; 414 417 418 + if (WARN_ON(map->cache_type == REGCACHE_NONE))419 + return -EINVAL;420 +415 421 BUG_ON(!map->cache_ops); 416 422 417 423 map->lock(map->lock_arg);