Driver Unloading
- The kernel calls the driver detach routine, pointed to by the
dev_ops structure, perfmon_detach(). This function removes
the device node, which was created during attach, by calling
the function ddi_remove_minor_node().
- The kernel then calls the driver's _fini() function which does
some housekeeping. It first calls mod_remove(), which takes
the driver out of the kernels data structures. It then
calls perfmon_cleanup() to do any driver-specific cleanup,
which is nothing in our case. Lastly, the mutex lock we
created earlier is destroyed and its memory freed.