mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
nvmem: core: Allow specifying device name verbatim
Add code to allow avoid having nvmem core append a numeric suffix to the end of the name by passing config->id of -1. Cc: Srinivas Kandagatla <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Carlo Caione <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Andrey Smirnov <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
0b2ed745e7
commit
fd0f4906a3
2 changed files with 11 additions and 3 deletions
|
|
@ -473,9 +473,14 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
|
|||
nvmem->reg_read = config->reg_read;
|
||||
nvmem->reg_write = config->reg_write;
|
||||
nvmem->dev.of_node = config->dev->of_node;
|
||||
dev_set_name(&nvmem->dev, "%s%d",
|
||||
config->name ? : "nvmem",
|
||||
config->name ? config->id : nvmem->id);
|
||||
|
||||
if (config->id == -1 && config->name) {
|
||||
dev_set_name(&nvmem->dev, "%s", config->name);
|
||||
} else {
|
||||
dev_set_name(&nvmem->dev, "%s%d",
|
||||
config->name ? : "nvmem",
|
||||
config->name ? config->id : nvmem->id);
|
||||
}
|
||||
|
||||
nvmem->read_only = device_property_present(config->dev, "read-only") |
|
||||
config->read_only;
|
||||
|
|
|
|||
Loading…
Reference in a new issue