summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/regmap/regmap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 8b37451fa931..6c637b18d6b0 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -723,6 +723,15 @@ struct regmap *__regmap_init(struct device *dev,
} else {
if ((bus && bus->fast_io) ||
config->fast_io) {
+ /*
+ * fast_io is incompatible with REGCACHE_RBTREE and REGCACHE_MAPLE
+ * since both need to dynamically allocate memory.
+ */
+ if (config->cache_type == REGCACHE_RBTREE ||
+ config->cache_type == REGCACHE_MAPLE) {
+ ret = -EINVAL;
+ goto err_name;
+ }
if (config->use_raw_spinlock) {
raw_spin_lock_init(&map->raw_spinlock);
map->lock = regmap_lock_raw_spinlock;