bcm27xx: 6.1: add kernel patches
[openwrt/staging/nbd.git] / target / linux / bcm27xx / patches-6.1 / 950-0439-nvmem-Use-NVMEM_DEVID_AUTO.patch
1 From 10fcafcad54e1d055b6b67881a5b52b95dbd2da3 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Fri, 7 Oct 2022 10:38:31 +0100
4 Subject: [PATCH] nvmem: Use NVMEM_DEVID_AUTO
5
6 It is reasonable to declare multiple nvmem blocks. Unless a unique 'id'
7 is passed in for each block there may be name clashes.
8
9 Avoid this by using the magic token NVMEM_DEVID_AUTO.
10
11 Fixes: 5a3fa75a4d9cb ("nvmem: Add driver to expose reserved memory as nvmem")
12
13 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
14 ---
15 drivers/nvmem/rmem.c | 1 +
16 1 file changed, 1 insertion(+)
17
18 --- a/drivers/nvmem/rmem.c
19 +++ b/drivers/nvmem/rmem.c
20 @@ -71,6 +71,7 @@ static int rmem_probe(struct platform_de
21 config.dev = dev;
22 config.priv = priv;
23 config.name = "rmem";
24 + config.id = NVMEM_DEVID_AUTO;
25 config.size = mem->size;
26 config.reg_read = rmem_read;
27