Skip to content

Commit 0ba424c

Browse files
t-8chgregkh
authored andcommitted
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: fd307a4 ("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]>
1 parent 7a0a6d0 commit 0ba424c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/nvmem/core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,9 @@ static int nvmem_sysfs_setup_compat(struct nvmem_device *nvmem,
396396
if (!config->base_dev)
397397
return -EINVAL;
398398

399-
if (config->type == NVMEM_TYPE_FRAM)
400-
bin_attr_nvmem_eeprom_compat.attr.name = "fram";
401-
402399
nvmem->eeprom = bin_attr_nvmem_eeprom_compat;
400+
if (config->type == NVMEM_TYPE_FRAM)
401+
nvmem->eeprom.attr.name = "fram";
403402
nvmem->eeprom.attr.mode = nvmem_bin_attr_get_umode(nvmem);
404403
nvmem->eeprom.size = nvmem->size;
405404
#ifdef CONFIG_DEBUG_LOCK_ALLOC

0 commit comments

Comments
 (0)