Skip to content

Commit e15d7f2

Browse files
sumanannaLee Jones
authored andcommitted
mfd: syscon: Use a unique name with regmap_config
The DT node full name is currently being used in regmap_config which in turn is used to create the regmap debugfs directories. This name however is not guaranteed to be unique and the regmap debugfs registration can fail in the cases where the syscon nodes have the same unit-address but are present in different DT node hierarchies. Replace this logic using the syscon reg resource address instead (inspired from logic used while creating platform devices) to ensure a unique name is given for each syscon. Signed-off-by: Suman Anna <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent 4f4ed45 commit e15d7f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mfd/syscon.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk)
101101
}
102102
}
103103

104-
syscon_config.name = of_node_full_name(np);
104+
syscon_config.name = kasprintf(GFP_KERNEL, "%pOFn@%llx", np,
105+
(u64)res.start);
105106
syscon_config.reg_stride = reg_io_width;
106107
syscon_config.val_bits = reg_io_width * 8;
107108
syscon_config.max_register = resource_size(&res) - reg_io_width;
108109

109110
regmap = regmap_init_mmio(NULL, base, &syscon_config);
111+
kfree(syscon_config.name);
110112
if (IS_ERR(regmap)) {
111113
pr_err("regmap init failed\n");
112114
ret = PTR_ERR(regmap);

0 commit comments

Comments
 (0)