|
|
The samp_free_instance( ) subordinate driver routine is called to release the driver instance's idata structure when the samp_close( ) entry point routine has executed the final close of the device and the CFG_REMOVE subfunction of the samp_config( ) entry point routine has removed the driver from the system.
samp_free_instance( ) frees all resources that were allocated in the CFG_ADD subfunction of the config(D2) entry point routine. This involves calling the SV_DEALLOC(D3) and LOCK_DEALLOC(D3) functions to deallocate the synchronization variable and spin lock used for the idata and calling the kmem_free(D3) function to free the memory used for the idata structure. Note that these resources are freed in the opposite order from which they were allocated.