ubi_detach_mtd_dev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ubi_detach_mtd_dev(9) β€” the Kernel API Manual glow-up ✨

okay so bestie, welcome to ubi_detach_mtd_dev, straight out of the Kernel API Manual (section 9, kernel-land, we love her) πŸ’–


πŸŽ€ NAME πŸŽ€

ubi_detach_mtd_dev β€” detach an MTD device. that's it, that's the whole vibe πŸ’…


✨ SYNOPSIS ✨

int ubi_detach_mtd_dev (int ubi_num , int anyway );

yes bestie, exactly like that, spaces and all, do not come for me πŸ™ˆ


🌸 ARGUMENTS 🌸

  • ubi_num β€” the UBI device number you're detaching from. the main character of this whole operation πŸ‘‘
  • anyway β€” detach the MTD even if the device reference count is not zero. like, it's saying "idc, do it anyway" 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what this function does: it destroys a UBI device number ubi_num and detaches the underlying MTD device. that's the whole arc 🫢

return values, because we stay informed:

  • returns zero in case of success β€” slay ⭐
  • -EBUSY if the UBI device is busy and cannot be destroyed β€” she's booked and busy, literally πŸ’€
  • -EINVAL if it does not exist β€” ghosted, it was never there πŸ™ˆ
⚠️ note bestie, do NOT skip this one: the invocations of this function have to be serialized by the ubi_devices_mutex. no cap. take the lock, it's giving basic hygiene πŸ”₯

🌈 SEE ALSO 🌈

the whole friend group, all together now πŸŽ€


src: ./drivers/mtd/ubi Β· date: October 2026 Β· byeee bestie, go detach something responsibly πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from