diff options
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 | 19 | ||||
-rw-r--r-- | drivers/media/usb/uvc/uvc_v4l2.c | 12 |
5 files changed, 20 insertions, 26 deletions
diff --git a/drivers/media/usb/gspca/spca506.c b/drivers/media/usb/gspca/spca506.c index bab01c86c31..bcd2c04c770 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 aac622200e9..de2c10289ee 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 5c36a57e659..ad7f7448072 100644 --- a/drivers/media/usb/usbvision/usbvision-video.c +++ b/drivers/media/usb/usbvision/usbvision-video.c @@ -1363,7 +1363,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, @@ -1510,8 +1510,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; @@ -1619,7 +1619,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)); @@ -1664,7 +1664,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 516a5b188ea..2bb7613ddeb 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); } @@ -1432,10 +1431,8 @@ int uvc_ctrl_set(struct uvc_video_chain *chain, int ret; ctrl = uvc_find_control(chain, xctrl->id, &mapping); - if (ctrl == NULL) - return -ENOENT; - if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR)) - return -EACCES; + if (ctrl == NULL || (ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR) == 0) + return -EINVAL; /* Clamp out of range values. */ switch (mapping->v4l2_type) { diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index 8e056046bc2..f2ee8c6b0d8 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) @@ -661,7 +659,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) uvc_ctrl_rollback(handle); ctrls->error_idx = ret == -ENOENT ? ctrls->count : i; - return ret == -ENOENT ? -EINVAL : ret; + return ret; } } ctrls->error_idx = 0; @@ -691,7 +689,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) ctrls->error_idx = (ret == -ENOENT && cmd == VIDIOC_S_EXT_CTRLS) ? ctrls->count : i; - return ret == -ENOENT ? -EINVAL : ret; + return ret; } } |