
The helper functions declared in include/linux/cdev.h are defined in fs/char_dev.c, with some useful code comments:

_randomize_layout is a macro, which is out of the scope of these considerations. Therefore, driver code should include, where not only the structure, but also its associated helper functions are declared.


In order to use a character device, the driver must first allocate and register one or more of these structures.
