nanddev_register(9)
β¨ nanddev_register(9) β¨
okay so this is a page from the Kernel API Manual β yes, the kernel has its own manual, we love a documented kernel π
β and today's main character is nanddev_register. buckle up bestie, it's short but it's important. π
πΈ NAME πΈ
nanddev_register β literally just: register a NAND device. that's the whole vibe. no cap. β¨
π¦ SYNOPSIS π¦
int nanddev_register (struct nand_device *nand );
that's it. one function, one argument, returns an int. iconic minimalism π«Ά
π ARGUMENTS π
nandβ the NAND device. that's yourstruct nand_device *right there. hand it over and it gets registered. π
π DESCRIPTION π
so what does it actually do? it registers a NAND device. that's the headline, periodt. π
but here's the tea: this function is just a wrapper around mtd_device_register β like, it's not doing some secret extra magic, it's registering the MTD device that's embedded in nand. so if you were expecting extra steps, nope π it's giving "small function, big responsibility." very main character energy honestly. β
π₯ RETURN π₯
0β success!! slay π you did it.- a negative error code β otherwise π something went sideways.
π SEE ALSO π
the full squad, fr fr. no skipping, we're listing everyone π
first up, the kernel file: ./include/linux/mtd/nand.h
π§ the structs & enums
struct nand_memory_organization(9)struct nand_row_converter(9)struct nand_pos(9)enum nand_page_io_req_type(9)struct nand_page_io_req(9)enum nand_ecc_engine_type(9)enum nand_ecc_placement(9)enum nand_ecc_algo(9)struct nand_ecc_props(9)struct nand_bbt(9)struct nand_ops(9)struct nand_ecc_context(9)struct nand_ecc_engine_ops(9)enum nand_ecc_engine_integration(9)struct nand_ecc_engine(9)struct nand_ecc_req_tweak_ctx(9)struct nand_ecc(9)struct nand_device(9)struct nand_io_iter(9)
π§ the functions
mtd_to_nanddev(9)nanddev_to_mtd(9)nanddev_page_size(9)nanddev_per_page_oobsize(9)nanddev_pages_per_eraseblock(9)nanddev_pages_per_target(9)nanddev_eraseblocks_per_lun(9)nanddev_eraseblocks_per_target(9)nanddev_target_size(9)nanddev_neraseblocks(9)nanddev_size(9)nanddev_get_memorg(9)nanddev_get_ecc_conf(9)nanddev_get_ecc_nsteps(9)nanddev_get_ecc_bytes_per_step(9)nanddev_get_ecc_requirements(9)nanddev_set_ecc_requirements(9)nanddev_unregister(9)nanddev_set_of_node(9)nanddev_get_of_node(9)nanddev_offs_to_pos(9)nanddev_pos_cmp(9)nanddev_pos_to_offs(9)nanddev_pos_to_row(9)nanddev_pos_next_target(9)nanddev_pos_next_lun(9)nanddev_pos_next_eraseblock(9)nanddev_pos_next_page(9)nanddev_bbt_pos_to_entry(9)nanddev_bbt_is_initialized(9)
ok bestie quick recap: one function, one arg, returns0or a negative error, and it's a thin wrapper overmtd_device_registerfor the MTD device embedded innand. go register that device. you got this πͺπ
and that's the whole page!! sourced from ./include/linux/mtd, dated October 2026 β so this is the future of the kernel manual and honestly it ate. π¦ go forth and nanddev_register responsibly, bestie. mwah ππ
β¨
π¦ 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