Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 49049588 authored by Jason Kridner's avatar Jason Kridner
Browse files

pru_speak: attempt to free memory

parent 82e286cb
No related merge requests found
......@@ -26,4 +26,5 @@ ssize_t pru_external_reset(struct device *dev,
int pruproc_external_request_bind(struct pru_rproc_external_glue *g);
void pruproc_external_request_unbind(void);
#endif /* RPROC_EXTERNAL_GLUE_H_ */
......@@ -432,8 +432,7 @@ static int pru_speak_remove(struct platform_device *pdev)
struct device *dev = pp->miscdev.this_device;
/* TODO: Unregister ourselves from the pru_rproc module */
/* TODO: deallocate memory */
pruproc_external_request_unbind();
device_remove_file(dev, &dev_attr_reset);
device_remove_file(dev, &dev_attr_load);
......@@ -445,8 +444,16 @@ static int pru_speak_remove(struct platform_device *pdev)
device_remove_file(dev, &dev_attr_pru_speak_single_cmd);
device_remove_file(dev, &dev_attr_pru_speak_single_cmd_64);
misc_deregister(&pp->miscdev);
platform_set_drvdata(pdev, NULL);
/* TODO: deallocate memory */
dma_free_coherent(dev, pp->shm_code.size_in_pages * PAGE_SIZE, pp->shm_code.vaddr,
(dma_addr_t) pp->shm_code.paddr);
dma_free_coherent(dev, pp->shm_ret.size_in_pages * PAGE_SIZE, pp->shm_ret.vaddr,
(dma_addr_t) pp->shm_ret.paddr);
kfree(pp);
/* Print a log message to announce unloading */
printk("PRU Speak unloaded\n");
return 0;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment