From 43925e774ee9f5e800ee3bf3a762b3667e030e90 Mon Sep 17 00:00:00 2001 From: Oliver Endriss Date: Wed, 2 May 2007 03:13:47 +0200 Subject: saa7146: proper prototype for saa7146_video_do_ioctl() From: Adrian Bunk This patch adds a proper prototype for saa7146_video_do_ioctl() in include/media/saa7146_vv.h. Signed-off-by: Adrian Bunk Signed-off-by: Oliver Endriss --- linux/include/media/saa7146_vv.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/include') diff --git a/linux/include/media/saa7146_vv.h b/linux/include/media/saa7146_vv.h index 50e33b0e9..cce20ed5c 100644 --- a/linux/include/media/saa7146_vv.h +++ b/linux/include/media/saa7146_vv.h @@ -216,6 +216,8 @@ void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data); extern struct saa7146_use_ops saa7146_video_uops; int saa7146_start_preview(struct saa7146_fh *fh); int saa7146_stop_preview(struct saa7146_fh *fh); +int saa7146_video_do_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, void *arg); /* from saa7146_vbi.c */ extern struct saa7146_use_ops saa7146_vbi_uops; -- cgit v1.2.3 From ce1fef0b7e749c71729bdacaa98708d9b65387a4 Mon Sep 17 00:00:00 2001 From: Oliver Endriss Date: Thu, 3 May 2007 17:23:44 +0200 Subject: saa7146: DMA: Correctly free resources on error, sync PCI streamed data From: Jon Burgess 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 Signed-off-by: Oliver Endriss --- linux/include/media/saa7146.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/include') 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); -- cgit v1.2.3