nvmem_device_read(9)
β¨ nvmem_device_read(9) β¨
okay so bestie, welcome to the Kernel API Manual π
this one is a lil function called nvmem_device_read β it reads stuff out of a given nvmem device π and honestly? it's giving "just read the bytes, diva." let's get into it π¦
πΈ NAME πΈ
nvmem_device_read β read from a given nvmem device πβ¨
π«Ά SYNOPSIS π«Ά
int nvmem_device_read (struct nvmem_device *nvmem , unsigned int offset
, size_t bytes , void *buf );
like, that's the whole signature, no cap π₯
π ARGUMENTS π
nvmemβ the nvmem device you wanna read from π this is your main character.offsetβ where in the nvmem device you're starting, bestie. an offset, if you will πbytesβ how many bytes you want. the literal count πbufβ buffer pointer which will be populated on successful read β¨ like, it starts empty-ish and gets filled up with the good stuff if everything goes well π
β RETURN β
on success you get the length of successful bytes read β like, how much actually came through π₯³
on error you get a negative error code π so if you see a negative number, that's the vibe check failing, periodt.
π¦ SEE ALSO π¦
kernel file ./drivers/nvmem/core.c β and the whole friend group of related funcs, all listed here because we don't gatekeep π
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)of_nvmem_cell_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_write(9)nvmem_add_cell_lookups(9)nvmem_del_cell_lookups(9)nvmem_dev_name(9)nvmem_dev_size(9)
like, that's a lot of friends but they're all iconic in their own way π
lowkey a reminder: if the read fails you're getting a negative error code back, so don't just cast it to a length and vibe β check that sign first ππ
omg and that's a wrap π this page lives under ./drivers/nvmem, from the October 2026 era of the manual, and yes β nvmem_device_read(9) is the title, slay π bye bestie, go read some bytes π¦β¨
π¦ 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