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: 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>
1 parent 7a0a6d0 commit 0ba424c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

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)