From: Dimitris Papastamos Date: Mon, 11 Mar 2013 17:27:02 +0000 (+0000) Subject: regmap: Initialize `map->debugfs' before regcache X-Git-Tag: Ubuntu-5.13.0-19.19~22592^2~1^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=c6432ea9cc043994d5b7dcb3ad86a087777cb40c;p=mirror_ubuntu-jammy-kernel.git regmap: Initialize `map->debugfs' before regcache In the rbtree code we are exposing statistics relating to the number of nodes/registers of the rbtree cache for each of the devices. Ensure that `map->debugfs' has been initialized before we attempt to initialize the debugfs entry for the rbtree cache. Signed-off-by: Dimitris Papastamos Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 3d2367501fd0..50ef277ea4b6 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -710,12 +710,12 @@ skip_format_initialization: } } + regmap_debugfs_init(map, config->name); + ret = regcache_init(map, config); if (ret != 0) goto err_range; - regmap_debugfs_init(map, config->name); - /* Add a devres resource for dev_get_regmap() */ m = devres_alloc(dev_get_regmap_release, sizeof(*m), GFP_KERNEL); if (!m) {