of_nvmem_cell_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… of_nvmem_cell_get πŸ’…

okay so this is the of_nvmem_cell_get page from the Kernel API Manual β€” yes it's a kernel function, yes it's a 9-section page, and yes we're gonna get through it together bestie, no cap 🫢


✨ NAME ✨

of_nvmem_cell_get β€” literally just: get an nvmem cell from a given device node and a cell id. that's the whole vibe. grab the cell, slay πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct nvmem_cell * of_nvmem_cell_get (struct device_node *np , const char *id );

look at her go, main character energy fr πŸ’–


🌸 ARGUMENTS 🌸

  • np β€” the device tree node that uses the nvmem cell. she's the one doing the using, okurrr ✨
  • id β€” the nvmem cell name, taken from the nvmem-cell-names property. OR you can pass NULL to get the cell at index 0 β€” that's the lone cell with no accompanying nvmem-cell-names property. so like, NULL = "just give me the only one there is" πŸ™ˆ

πŸ‘‘ RETURN πŸ‘‘

so what do you get back? on error you get an ERR_PTR β€” yes it's one of those returns, so check it, don't just rawdog the dereference πŸ’€

on success you get a valid pointer to a struct nvmem_cell.

⚠️ important bestie: the nvmem_cell will be freed by nvmem_cell_put. so you don't free it yourself, you hand it back. that's the deal, periodt.

🌈 SEE ALSO 🌈

the friend group β€” the whole nvmem crew, and we are obsessed πŸ”₯ these are all in the kernel file ./drivers/nvmem/core.c:

go read them all, i'll wait πŸ§šπŸ’œ


aaaand that's the page!! πŸ’– this one lives in ./drivers/nvmem, dated October 2026, and it's part of the Kernel API Manual. mwah, bye bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from