]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regcache: Remove duplicate check in regcache_hw_init()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 10 Feb 2026 16:09:08 +0000 (17:09 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 22 Feb 2026 23:54:23 +0000 (23:54 +0000)
The regcache_hw_init() is never called without preliminary check
for num_reg_defaults_raw not being 0. Thus, remove duplicate in
the function.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260210161058.53093-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regcache.c

index a35f2b20298b27d413478269fe9d748c0a016f70..d41cdb39c78f15fed2cd80678d297ff44145d190 100644 (file)
@@ -50,9 +50,6 @@ static int regcache_hw_init(struct regmap *map)
        unsigned int reg, val;
        void *tmp_buf;
 
-       if (!map->num_reg_defaults_raw)
-               return -EINVAL;
-
        /* calculate the size of reg_defaults */
        for (count = 0, i = 0; i < map->num_reg_defaults_raw; i++)
                if (regmap_readable(map, i * map->reg_stride) &&