ubi_detach_mtd_dev(9)
π 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 β
-EBUSYif the UBI device is busy and cannot be destroyed β she's booked and busy, literally π-EINVALif 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 π
- Kernel file
./drivers/mtd/ubi/build.cstruct mtd_dev_param(9) ubi_volume_notify(9)ubi_notify_all(9)ubi_enumerate_volumes(9)ubi_get_device(9)ubi_put_device(9)ubi_get_by_major(9)ubi_major2num(9)kill_volumes(9)uif_init(9)uif_close(9)ubi_free_volumes_from(9)ubi_free_all_volumes(9)ubi_free_internal_volumes(9)io_init(9)autoresize(9)ubi_attach_mtd_dev(9)open_mtd_by_chdev(9)open_mtd_device(9)bytes_str_to_int(9)ubi_mtd_param_parse(9)
src: ./drivers/mtd/ubi Β· date: October 2026 Β· byeee bestie, go detach something responsibly π
β¨π
π¦ 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