History

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.

Suman Anna committed 6 years ago

Commit e15d7f21 parent 4f4ed451 file · +3 −1Browse files

Unified · Split

drivers/mfd/syscon.c+3−1
@@ -101,12 +101,14 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk) · 100 unmodified lines
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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t