Skip to content

Commit a274383

Browse files
t-8chroxanan1996
authored andcommitted
nvmem: core: only change name to fram for current attribute
BugLink: https://bugs.launchpad.net/bugs/2075170 commit 0ba424c upstream. 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: stable@vger.kernel.org Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20240628113704.13742-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent fbee376 commit a274383

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
@@ -362,10 +362,9 @@ static int nvmem_sysfs_setup_compat(struct nvmem_device *nvmem,
362362
if (!config->base_dev)
363363
return -EINVAL;
364364

365-
if (config->type == NVMEM_TYPE_FRAM)
366-
bin_attr_nvmem_eeprom_compat.attr.name = "fram";
367-
368365
nvmem->eeprom = bin_attr_nvmem_eeprom_compat;
366+
if (config->type == NVMEM_TYPE_FRAM)
367+
nvmem->eeprom.attr.name = "fram";
369368
nvmem->eeprom.attr.mode = nvmem_bin_attr_get_umode(nvmem);
370369
nvmem->eeprom.size = nvmem->size;
371370
#ifdef CONFIG_DEBUG_LOCK_ALLOC

0 commit comments

Comments
 (0)