mtd_ooblayout_ecc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ mtd_ooblayout_ecc(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual πŸ’– this page is all about grabbing the OOB region definition of a specific ECC section, and it's lowkey iconic. It's giving β€œtiny helper, big MTD energy” ✨


🌸 NAME 🌸

mtd_ooblayout_ecc β€” Get the OOB region definition of a specific ECC section.

πŸ¦‹ SYNOPSIS πŸ¦‹

int mtd_ooblayout_ecc (struct mtd_info *mtd , int section , struct
       mtd_oob_region *oobecc );

✨ ARGUMENTS ✨

  • mtd β€” the MTD device structure, aka the device we're working with.
  • section β€” ECC section. Depending on the layout you may have all the ECC bytes stored in a single contiguous section, or one section per ECC chunk (and sometime several sections for a single ECC ECC chunk) 😭. Layouts can be weird, fr fr.
  • oobecc β€” OOB region struct filled with the appropriate ECC position information. It's the output bestie 🫢.

πŸ’… DESCRIPTION πŸ’…

This function returns ECC section information in the OOB area. If you want to get all the ECC bytes information, then you should call mtd_ooblayout_ecc(mtd, section++, oobecc) until it returns -ERANGE β€” yes, loop that bad boy until it taps out πŸ”₯.

Returns zero on success, a negative error code otherwise. So 0 is the slay, negative is the β€œoop” πŸ’€.

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/mtd/mtdcore.c plus these icons:


okay bye bestie 🫢 this page is sourced from ./drivers/mtd in the Kernel API Manual, dated October 2026, and honestly? iconic πŸ’…βœ¨

πŸ“¦ where this page comes from