Miscellaneous Devices¶
- intmisc_register(structmiscdevice*misc)¶
register a miscellaneous device
Parameters
structmiscdevice*miscdevice structure
Description
Register a miscellaneous device with the kernel. If the minornumber is set to
MISC_DYNAMIC_MINORa minor number is assignedand placed in the minor field of the structure. For other casesthe minor number requested is used.The structure passed is linked into the kernel and may not bedestroyed until it has been unregistered. By default, an open()syscall to the device sets file->private_data to point to thestructure. Drivers don’t need open in fops for this.
A zero is returned on success and a negative errno code forfailure.
- voidmisc_deregister(structmiscdevice*misc)¶
unregister a miscellaneous device
Parameters
structmiscdevice*miscdevice to unregister
Description
Unregister a miscellaneous device that was previouslysuccessfully registered with
misc_register().