nanddev_mtd_erase(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ nanddev_mtd_erase(9) ✨

okay bestie, welcome to the Kernel API Manual πŸ’… β€” we're doing the nanddev_mtd_erase(9) page today and honestly? it's a little icon, a tiny helper with big main character energy πŸŽ€


✨ NAME ✨

nanddev_mtd_erase β€” the generic mtd->_erase() implementation for NAND devices, no cap πŸ¦‹


🌸 SYNOPSIS 🌸

int nanddev_mtd_erase (struct mtd_info *mtd , struct erase_info *einfo );

πŸ’– ARGUMENTS πŸ’–

  • mtd β€” the MTD device, literally the thing we're erasing stuff on 🫢
  • einfo β€” the erase request itself, like the lil form you fill out to say "erase this pls" ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so this is a simple mtd->_erase implementation β€” it just loops over all the blocks that einfo is concerned with and calls nand->ops->erase on each one of them πŸŽ€ lowkey does exactly what it says on the tin, and it ate πŸ’…

⚠️ okay listen up, this part MATTERS: do not directly assign mtd->_erase to this helper, because there's no locking in here 😭 like none. zero. Not the vibe.

NAND specialized layers should instead implement their own wrapper around nanddev_mtd_erase, taking the appropriate lock before calling nanddev_mtd_erase πŸ‘‘ that's the way, fr fr.


🌈 RETURN 🌈

0 in case of success, and a negative error code otherwise πŸ“ (yes, that's the whole bit β€” short and sweet, iykyk)


⭐ SEE ALSO ⭐

Kernel file ./drivers/mtd/nand/core.c β€” go read it, it's giving lore 🧚


mwah πŸ’œ that's the whole page β€” brought to you by ./drivers/mtd/nand, dated October 2026, and yes she's serving kernel-manual realness till the very last line πŸŽ€βœ¨

πŸ“¦ where this page comes from