commit 76c775e3da72823adc56c3af98c2e24dc4fde3ca
parent 2aa31a1f849be7a50a1b5dd8305f20ae9bfd719a
Author: alex <alex@022568fa-442e-4ef8-a3e8-54dcafdb011a>
Date: Fri, 11 Jan 2008 08:06:39 +0000
* Check results from videobuf operations for < 0, rather than != 0
* Change a NULL to { } in the device defs table; removes a warning.
git-svn-id: http://svn.mediati.org/svn/r5u870/trunk@27 022568fa-442e-4ef8-a3e8-54dcafdb011a
Diffstat:
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/r5u870_md.c b/r5u870_md.c
@@ -3047,7 +3047,7 @@ static const struct usb_device_id id_table[] = {
{ R5U870_DEVICE_UVC(0x05CA, 0x1835, R5U870_DI_VGP_VCC5) },
{ R5U870_DEVICE_UVC(0x05CA, 0x1836, R5U870_DI_VGP_VCC4) },
{ R5U870_DEVICE_UVC(0x05CA, 0x183a, R5U870_DI_VGP_VCC7) },
- NULL,
+ { },
};
diff --git a/usbcam.c b/usbcam.c
@@ -280,12 +280,11 @@ static void usbcam_capture_stop_nondestructive(struct usbcam_dev *udp)
int usbcam_curframe_get(struct usbcam_dev *udp, struct usbcam_curframe *cf)
{
struct usbcam_frame *framep = usbcam_capture_curframe(udp);
- void *vmalloc;
+ struct videobuf_dmabuf *dma;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
- vmalloc = framep->vbb.dma.vmalloc;
+ dma = &framep->vbb.dma;
#else
- struct videobuf_dmabuf *dma = videobuf_to_dma(&framep->vbb);
- vmalloc = dma->vmalloc;
+ dma = videobuf_to_dma(&framep->vbb);
#endif
usbcam_chklock(udp);
@@ -295,7 +294,7 @@ int usbcam_curframe_get(struct usbcam_dev *udp, struct usbcam_curframe *cf)
cf->uc_base = (u8 *) (framep->vmap_sof
? framep->vmap_sof
- : vmalloc);
+ : dma->vmalloc);
cf->uc_size = framep->vbb.size;
cf->uc_field = framep->vbb.field;
memset(&cf->uc_timestamp, 0, sizeof(cf->uc_timestamp));
@@ -1405,7 +1404,7 @@ static int usbcam_v4l_int_ioctl(struct inode *inodep, struct file *filp,
" - closing and trying again.");
res = videobuf_streamoff(&ufp->uf_vbq);
- if (res)
+ if (res < 0)
{
usbcam_dbg(udp, IOCTL_BUF,
"VIDIOCGMBUF reqbufs failed:"
@@ -1425,7 +1424,7 @@ static int usbcam_v4l_int_ioctl(struct inode *inodep, struct file *filp,
res = videobuf_reqbufs(&ufp->uf_vbq, &req);
}
}
- else if (res) {
+ else if (res < 0) {
usbcam_dbg(udp, IOCTL_BUF,
"VIDIOCGMBUF reqbufs failed: %d", res);
return res;