diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-24 21:49:18 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-24 21:49:18 +0100 |
commit | a32f7d1ad3744914273c6907204c2ab3b5d496a0 (patch) | |
tree | 1c5ae321ee85665707177547c07810ff7e09e1ab /drivers/media/usb | |
parent | [media] stv090x: On STV0903 do not set registers of the second path (diff) | |
parent | [media] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures (diff) | |
download | linux-a32f7d1ad3744914273c6907204c2ab3b5d496a0.tar.xz linux-a32f7d1ad3744914273c6907204c2ab3b5d496a0.zip |
Merge branch 'v4l_for_linus' into staging/for_v3.9
* v4l_for_linus: (464 commits)
[media] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures
[media] uvcvideo: Cleanup leftovers of partial revert
[media] uvcvideo: Return -EACCES when trying to set a read-only control
Linux 3.8-rc3
mm: reinstante dropped pmd_trans_splitting() check
cred: Remove tgcred pointer from struct cred
drm/ttm: fix fence locking in ttm_buffer_object_transfer
ARM: clps711x: Fix bad merge of clockevents setup
ARM: highbank: save and restore L2 cache and GIC on suspend
ARM: highbank: add a power request clear
ARM: highbank: fix secondary boot and hotplug
ARM: highbank: fix typos with hignbank in power request functions
ARM: dts: fix highbank cpu mpidr values
ARM: dts: add device_type prop to cpu nodes on Calxeda platforms
drm/prime: drop reference on imported dma-buf come from gem
xen/netfront: improve truesize tracking
ARM: mx5: Fix MX53 flexcan2 clock
ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array
sctp: fix Kconfig bug in default cookie hmac selection
EDAC: Cleanup device deregistering path
...
Conflicts:
drivers/media/pci/dm1105/dm1105.c
drivers/media/platform/soc_camera/mx2_camera.c
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/gspca/spca506.c | 3 | ||||
-rw-r--r-- | drivers/media/usb/siano/smsusb.c | 2 | ||||
-rw-r--r-- | drivers/media/usb/usbvision/usbvision-video.c | 10 | ||||
-rw-r--r-- | drivers/media/usb/uvc/uvc_ctrl.c | 15 | ||||
-rw-r--r-- | drivers/media/usb/uvc/uvc_v4l2.c | 18 |
5 files changed, 21 insertions, 27 deletions
diff --git a/drivers/media/usb/gspca/spca506.c b/drivers/media/usb/gspca/spca506.c index bab01c86c315..bcd2c04c770e 100644 --- a/drivers/media/usb/gspca/spca506.c +++ b/drivers/media/usb/gspca/spca506.c @@ -590,8 +590,7 @@ static const struct usb_device_id device_table[] = { MODULE_DEVICE_TABLE(usb, device_table); /* -- device connect -- */ -static int __devinit sd_probe(struct usb_interface *intf, - const struct usb_device_id *id) +static int sd_probe(struct usb_interface *intf, const struct usb_device_id *id) { return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd), THIS_MODULE); diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c index aac622200e99..de2c10289eec 100644 --- a/drivers/media/usb/siano/smsusb.c +++ b/drivers/media/usb/siano/smsusb.c @@ -389,7 +389,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id) return rc; } -static int __devinit smsusb_probe(struct usb_interface *intf, +static int smsusb_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_device *udev = interface_to_usbdev(intf); diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c index c6bc8ce67375..cd1fe78a5532 100644 --- a/drivers/media/usb/usbvision/usbvision-video.c +++ b/drivers/media/usb/usbvision/usbvision-video.c @@ -1364,7 +1364,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision) } /* register video4linux devices */ -static int __devinit usbvision_register_video(struct usb_usbvision *usbvision) +static int usbvision_register_video(struct usb_usbvision *usbvision) { /* Video Device: */ usbvision->vdev = usbvision_vdev_init(usbvision, @@ -1511,8 +1511,8 @@ static void usbvision_configure_video(struct usb_usbvision *usbvision) * if it looks like USBVISION video device * */ -static int __devinit usbvision_probe(struct usb_interface *intf, - const struct usb_device_id *devid) +static int usbvision_probe(struct usb_interface *intf, + const struct usb_device_id *devid) { struct usb_device *dev = usb_get_dev(interface_to_usbdev(intf)); struct usb_interface *uif; @@ -1620,7 +1620,7 @@ static int __devinit usbvision_probe(struct usb_interface *intf, * with no ill consequences. * */ -static void __devexit usbvision_disconnect(struct usb_interface *intf) +static void usbvision_disconnect(struct usb_interface *intf) { struct usb_usbvision *usbvision = to_usbvision(usb_get_intfdata(intf)); @@ -1665,7 +1665,7 @@ static struct usb_driver usbvision_driver = { .name = "usbvision", .id_table = usbvision_table, .probe = usbvision_probe, - .disconnect = __devexit_p(usbvision_disconnect), + .disconnect = usbvision_disconnect, }; /* diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 516a5b188ea5..d5baab17a5ef 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -1061,7 +1061,7 @@ int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain, ctrl = uvc_find_control(chain, v4l2_ctrl->id, &mapping); if (ctrl == NULL) { - ret = -ENOENT; + ret = -EINVAL; goto done; } @@ -1099,13 +1099,12 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain, return -ERESTARTSYS; ctrl = uvc_find_control(chain, query_menu->id, &mapping); - if (ctrl == NULL) { - ret = -ENOENT; + if (ctrl == NULL || mapping->v4l2_type != V4L2_CTRL_TYPE_MENU) { + ret = -EINVAL; goto done; } - if (mapping->v4l2_type != V4L2_CTRL_TYPE_MENU || - query_menu->index >= mapping->menu_count) { + if (query_menu->index >= mapping->menu_count) { ret = -EINVAL; goto done; } @@ -1264,7 +1263,7 @@ static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev, unsigned elems) ctrl = uvc_find_control(handle->chain, sev->id, &mapping); if (ctrl == NULL) { - ret = -ENOENT; + ret = -EINVAL; goto done; } @@ -1415,7 +1414,7 @@ int uvc_ctrl_get(struct uvc_video_chain *chain, ctrl = uvc_find_control(chain, xctrl->id, &mapping); if (ctrl == NULL) - return -ENOENT; + return -EINVAL; return __uvc_ctrl_get(chain, ctrl, mapping, &xctrl->value); } @@ -1433,7 +1432,7 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, ctrl = uvc_find_control(chain, xctrl->id, &mapping); if (ctrl == NULL) - return -ENOENT; + return -EINVAL; if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR)) return -EACCES; diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index 8e056046bc20..68d59b527492 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c @@ -607,10 +607,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) ret = uvc_ctrl_get(chain, &xctrl); uvc_ctrl_rollback(handle); - if (ret < 0) - return ret == -ENOENT ? -EINVAL : ret; - - ctrl->value = xctrl.value; + if (ret >= 0) + ctrl->value = xctrl.value; break; } @@ -634,7 +632,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) ret = uvc_ctrl_set(chain, &xctrl); if (ret < 0) { uvc_ctrl_rollback(handle); - return ret == -ENOENT ? -EINVAL : ret; + return ret; } ret = uvc_ctrl_commit(handle, &xctrl, 1); if (ret == 0) @@ -659,9 +657,8 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) ret = uvc_ctrl_get(chain, ctrl); if (ret < 0) { uvc_ctrl_rollback(handle); - ctrls->error_idx = ret == -ENOENT - ? ctrls->count : i; - return ret == -ENOENT ? -EINVAL : ret; + ctrls->error_idx = i; + return ret; } } ctrls->error_idx = 0; @@ -688,10 +685,9 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) ret = uvc_ctrl_set(chain, ctrl); if (ret < 0) { uvc_ctrl_rollback(handle); - ctrls->error_idx = (ret == -ENOENT && - cmd == VIDIOC_S_EXT_CTRLS) + ctrls->error_idx = cmd == VIDIOC_S_EXT_CTRLS ? ctrls->count : i; - return ret == -ENOENT ? -EINVAL : ret; + return ret; } } |