aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorJon Burgess <jburgess777@googlemail.com>2007-05-03 11:23:44 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-05-09 09:12:42 -0400
commit87c3019d7b1acb7704a257d78c482112e9b0c227 (patch)
tree312478a0bed426b3ca89bf4fae1880fed9986bd2 /include/media
parent32a1db42480dc972e8e92be68d9e604f6aff5381 (diff)
V4L/DVB (5592): DMA: Correctly free resources on error, sync PCI streamed data
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/saa7146.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/media/saa7146.h b/include/media/saa7146.h
index 796bcf151a3a..d3f4f5a38214 100644
--- a/include/media/saa7146.h
+++ b/include/media/saa7146.h
@@ -58,6 +58,7 @@ struct saa7146_pgtable {
58 unsigned long offset; 58 unsigned long offset;
59 /* used for custom pagetables (used for example by budget dvb cards) */ 59 /* used for custom pagetables (used for example by budget dvb cards) */
60 struct scatterlist *slist; 60 struct scatterlist *slist;
61 int nents;
61}; 62};
62 63
63struct saa7146_pci_extension_data { 64struct saa7146_pci_extension_data {
@@ -157,6 +158,7 @@ int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt);
157void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt); 158void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt);
158int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length ); 159int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length );
159char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt); 160char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt);
161void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, char *mem, struct saa7146_pgtable *pt);
160void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data); 162void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data);
161int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); 163int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop);
162 164