tty: serial: max310x: convert to use maple tree register cache
authorwangkaiyuan <wangkaiyuan@inspur.com>
Mon, 18 Mar 2024 06:40:36 +0000 (14:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2024 14:50:36 +0000 (16:50 +0200)
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: wangkaiyuan <wangkaiyuan@inspur.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240318064036.1656-1-wangkaiyuan@inspur.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/max310x.c

index f0eb96429dae47c3408628eb61f2dd1398d8b1a6..35369a2f77b29e0f62e8c847d7eb63facb4e7713 100644 (file)
@@ -1473,7 +1473,7 @@ static struct regmap_config regcfg = {
        .reg_bits = 8,
        .val_bits = 8,
        .write_flag_mask = MAX310X_WRITE_BIT,
-       .cache_type = REGCACHE_RBTREE,
+       .cache_type = REGCACHE_MAPLE,
        .max_register = MAX310X_REG_1F,
        .writeable_reg = max310x_reg_writeable,
        .volatile_reg = max310x_reg_volatile,
@@ -1577,7 +1577,7 @@ static int max310x_i2c_extended_reg_enable(struct device *dev, bool enable)
 static struct regmap_config regcfg_i2c = {
        .reg_bits = 8,
        .val_bits = 8,
-       .cache_type = REGCACHE_RBTREE,
+       .cache_type = REGCACHE_MAPLE,
        .writeable_reg = max310x_reg_writeable,
        .volatile_reg = max310x_reg_volatile,
        .precious_reg = max310x_reg_precious,