Skip to content

Commit

Permalink
nvmem: rmem: Use NVMEM_DEVID_AUTO
Browse files Browse the repository at this point in the history
[ Upstream commit 09dd7b9 ]

It is reasonable to declare multiple nvmem blocks. Unless a unique 'id'
is passed in for each block there may be name clashes.

Avoid this by using the magic token NVMEM_DEVID_AUTO.

Fixes: 5a3fa75 ("nvmem: Add driver to expose reserved memory as nvmem")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Reviewed-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Message-ID: <20230611140330.154222-6-srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
pelwell authored and gregkh committed Jul 19, 2023
1 parent 0dfaf54 commit 92bc4a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/nvmem/rmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ static int rmem_probe(struct platform_device *pdev)
config.dev = dev;
config.priv = priv;
config.name = "rmem";
config.id = NVMEM_DEVID_AUTO;
config.size = mem->size;
config.reg_read = rmem_read;

Expand Down

0 comments on commit 92bc4a2

Please sign in to comment.