064a44999b0890d8a4f682801d5f67f3550129d5
[openwrt/staging/xback.git] /
1 From 0ba424c934fd43dccf0d597e1ae8851f07cb2edf Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <linux@weissschuh.net>
3 Date: Fri, 28 Jun 2024 12:37:03 +0100
4 Subject: [PATCH] nvmem: core: only change name to fram for current attribute
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 bin_attr_nvmem_eeprom_compat is the template from which all future
10 compat attributes are created.
11 Changing it means to change all subsquent compat attributes, too.
12
13 Instead only use the "fram" name for the currently registered attribute.
14
15 Fixes: fd307a4ad332 ("nvmem: prepare basics for FRAM support")
16 Cc: stable@vger.kernel.org
17 Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
18 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
19 Link: https://lore.kernel.org/r/20240628113704.13742-4-srinivas.kandagatla@linaro.org
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 ---
22 drivers/nvmem/core.c | 5 ++---
23 1 file changed, 2 insertions(+), 3 deletions(-)
24
25 --- a/drivers/nvmem/core.c
26 +++ b/drivers/nvmem/core.c
27 @@ -397,10 +397,9 @@ static int nvmem_sysfs_setup_compat(stru
28 if (!config->base_dev)
29 return -EINVAL;
30
31 - if (config->type == NVMEM_TYPE_FRAM)
32 - bin_attr_nvmem_eeprom_compat.attr.name = "fram";
33 -
34 nvmem->eeprom = bin_attr_nvmem_eeprom_compat;
35 + if (config->type == NVMEM_TYPE_FRAM)
36 + nvmem->eeprom.attr.name = "fram";
37 nvmem->eeprom.attr.mode = nvmem_bin_attr_get_umode(nvmem);
38 nvmem->eeprom.size = nvmem->size;
39 #ifdef CONFIG_DEBUG_LOCK_ALLOC