diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2007-05-03 17:23:44 +0200 |
---|---|---|
committer | Oliver Endriss <o.endriss@gmx.de> | 2007-05-03 17:23:44 +0200 |
commit | ce1fef0b7e749c71729bdacaa98708d9b65387a4 (patch) | |
tree | f4895d13653aa4b7464f035f5a7d91adfbe4c730 /linux/include/media/saa7146.h | |
parent | 43925e774ee9f5e800ee3bf3a762b3667e030e90 (diff) | |
download | mediapointer-dvb-s2-ce1fef0b7e749c71729bdacaa98708d9b65387a4.tar.gz mediapointer-dvb-s2-ce1fef0b7e749c71729bdacaa98708d9b65387a4.tar.bz2 |
saa7146: DMA: Correctly free resources on error, sync PCI streamed data
From: Jon Burgess <jburgess777@googlemail.com>
I added saa7146_vmalloc_destroy_pgtable() which frees the resources
allocated by saa7146_vmalloc_build_pgtable() and updated the callers in
budget-core.c and av7110.c. I have also been through the updated
functions and updated the error paths to ensure they free all allocated
resources on error.
I also realised that there are other callers to saa7146_pgtable_free()
which did not have any sg DMA mapped so it seems wrong to add the
pci_unmap_sg() into that function. Instead I created
saa7146_vmalloc_destroy_pgtable() to do this.
Also included in this patch are the previous fixes for pci_unmap_sg()
and syncing the PCI streamed data to work with a SWIOTLB and match the
requirements documented in DMA-API.txt.
Signed-off-by: Jon Burgess <jburgess777@googlemail.com>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Diffstat (limited to 'linux/include/media/saa7146.h')
-rw-r--r-- | linux/include/media/saa7146.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/linux/include/media/saa7146.h b/linux/include/media/saa7146.h index ab0a60b4d..1904940e3 100644 --- a/linux/include/media/saa7146.h +++ b/linux/include/media/saa7146.h @@ -70,6 +70,7 @@ struct saa7146_pgtable { unsigned long offset; /* used for custom pagetables (used for example by budget dvb cards) */ struct scatterlist *slist; + int nents; }; struct saa7146_pci_extension_data { @@ -181,6 +182,7 @@ int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt); void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt); int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length ); char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt); +void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, char *mem, struct saa7146_pgtable *pt); void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data); int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); |