cdev_device_del(9)
π NAME π
okay bestie, this is the cdev_device_del(9) page from the Kernel API Manual, and it is literally the inverse of cdev_device_add β no cap. π
β¨
cdev_device_del β inverse of cdev_device_add π«Ά
β¨ SYNOPSIS β¨
void cdev_device_del (struct cdev *cdev , struct device *dev );
π ARGUMENTS π
cdevβ thecdevstructure πdevβ thedevicestructure β¨
π¦ DESCRIPTION π¦
so like, cdev_device_del is a helper function that calls cdev_del and device_del. that's the whole vibe. π«Ά
It should be used whenever cdev_device_add is used β like, they're a matching set, iykyk. π
If dev->devt is not set, it will not remove the cdev and will be equivalent to device_del. periodt. π
π¨ NOTE π¨
okay, important guarantee time: this guarantees that associated sysfs callbacks are not running or runnable. iconic. β¨
but bestie, plot twist π: any cdevs already open will remain, and their fops will still be callable even after this function returns. so don't think this closes absolutely everything β fr fr.
π SEE ALSO π
Kernel file: ./fs/char_dev.c π§
the whole related squad is right here:
register_chrdev_region(9)alloc_chrdev_region(9)__register_chrdev(9)unregister_chrdev_region(9)__unregister_chrdev(9)cdev_add(9)cdev_set_parent(9)cdev_device_add(9)cdev_del(9)cdev_alloc(9)cdev_init(9)
okay bye bestie, this page is serving source/version energy from ./fs, dated October 2026 β cdev_device_del(9) out. 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