Skip to content

Commit

Permalink
doc: nvmem: Update example
Browse files Browse the repository at this point in the history
Update the example to reflect the new API. I have chosen the brcm-nvram
driver since it seems to be simpler than the qfprom driver.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220220151527.17216-12-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sean Anderson authored and Greg Kroah-Hartman committed Feb 21, 2022
1 parent 673d2cc commit 671aa5a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Documentation/driver-api/nvmem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,20 @@ nvmem_device pointer.

nvmem_unregister(nvmem) is used to unregister a previously registered provider.

For example, a simple qfprom case::
For example, a simple nvram case::

static struct nvmem_config econfig = {
.name = "qfprom",
.owner = THIS_MODULE,
};

static int qfprom_probe(struct platform_device *pdev)
static int brcm_nvram_probe(struct platform_device *pdev)
{
struct nvmem_config config = {
.name = "brcm-nvram",
.reg_read = brcm_nvram_read,
};
...
econfig.dev = &pdev->dev;
nvmem = nvmem_register(&econfig);
...
config.dev = &pdev->dev;
config.priv = priv;
config.size = resource_size(res);

devm_nvmem_register(&config);
}

Users of board files can define and register nvmem cells using the
Expand Down

0 comments on commit 671aa5a

Please sign in to comment.