of_nvmem_cell_get(9)
π 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 thenvmem-cell-namesproperty. OR you can passNULLto get the cell at index0β that's the lone cell with no accompanyingnvmem-cell-namesproperty. 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: thenvmem_cellwill be freed bynvmem_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:
nvmem_add_one_cell(9)nvmem_add_cells(9)nvmem_register_notifier(9)nvmem_unregister_notifier(9)nvmem_register(9)nvmem_unregister(9)devm_nvmem_register(9)of_nvmem_device_get(9)nvmem_device_get(9)nvmem_device_find(9)devm_nvmem_device_put(9)nvmem_device_put(9)devm_nvmem_device_get(9)nvmem_cell_get(9)devm_nvmem_cell_get(9)devm_nvmem_cell_put(9)nvmem_cell_put(9)nvmem_cell_read(9)nvmem_cell_write(9)nvmem_cell_read_u8(9)nvmem_cell_read_u16(9)nvmem_cell_read_u32(9)nvmem_cell_read_u64(9)nvmem_cell_read_variable_le_u32(9)nvmem_cell_read_variable_le_u64(9)nvmem_device_cell_read(9)nvmem_device_cell_write(9)nvmem_device_read(9)nvmem_device_write(9)nvmem_add_cell_lookups(9)nvmem_del_cell_lookups(9)nvmem_dev_name(9)nvmem_dev_size(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms