aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Weißschuh <[email protected]>2024-06-28 12:37:03 +0100
committerGreg Kroah-Hartman <[email protected]>2024-07-03 16:37:51 +0200
commit0ba424c934fd43dccf0d597e1ae8851f07cb2edf (patch)
tree0cddeb11c18357ee0ecbf3d2f0456429191b4ff8
parent7a0a6d0a7c805f9380381f4deedffdf87b93f408 (diff)
nvmem: core: only change name to fram for current attribute
bin_attr_nvmem_eeprom_compat is the template from which all future compat attributes are created. Changing it means to change all subsquent compat attributes, too. Instead only use the "fram" name for the currently registered attribute. Fixes: fd307a4ad332 ("nvmem: prepare basics for FRAM support") Cc: [email protected] Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/nvmem/core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index e1ec3b7200d7..1285300ed239 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -396,10 +396,9 @@ static int nvmem_sysfs_setup_compat(struct nvmem_device *nvmem,
if (!config->base_dev)
return -EINVAL;
- if (config->type == NVMEM_TYPE_FRAM)
- bin_attr_nvmem_eeprom_compat.attr.name = "fram";
-
nvmem->eeprom = bin_attr_nvmem_eeprom_compat;
+ if (config->type == NVMEM_TYPE_FRAM)
+ nvmem->eeprom.attr.name = "fram";
nvmem->eeprom.attr.mode = nvmem_bin_attr_get_umode(nvmem);
nvmem->eeprom.size = nvmem->size;
#ifdef CONFIG_DEBUG_LOCK_ALLOC