static int labx_local_audio_release(struct inode *inode, struct file *filp) { struct labx_local_audio_pdev *local_audio_pdev = (struct labx_local_audio_pdev*)filp->private_data; /* Invoke the release() operation on the derived driver, if there is one */ if((local_audio_pdev->derivedFops != NULL) && (local_audio_pdev->derivedFops->release != NULL)) { local_audio_pdev->derivedFops->release(inode, filp); } /* Also release the DMA instance, if there is one */ if(local_audio_pdev->dma != NULL) labx_dma_release(local_audio_pdev->dma); return(0); }
/* This is exported to allow polymorphic drivers to invoke it */ int labx_local_audio_remove(struct labx_local_audio_pdev *local_audio_pdev) { int deviceIndex; /* Make sure the DMA unit is no longer running */ labx_dma_release(local_audio_pdev->dma); misc_deregister(&local_audio_pdev->miscdev); for (deviceIndex = 0; deviceIndex < MAX_LA_DEVICES; deviceIndex++) { if (local_audio_pdev == devices[deviceIndex]) { devices[deviceIndex] = NULL; break; } } return(0); }
static int labx_dma_release_cdev(struct inode *inode, struct file *filp) { struct labx_dma_pdev *dma_pdev = (struct labx_dma_pdev*)filp->private_data; /* Simply let our DMA know it's closing */ return(labx_dma_release(&dma_pdev->dma)); }