summaryrefslogtreecommitdiff
path: root/drivers/media/video/usbvideo
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-08-08 18:48:06 (GMT)
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 14:53:33 (GMT)
commit56b8df11345452103a75060a44429751ce71ee97 (patch)
tree7ab323b3043c735365aad60557309cd094c19f7e /drivers/media/video/usbvideo
parent5aff308c5e73307fc495b89b6421b491f56d3657 (diff)
downloadlinux-fsl-qoriq-56b8df11345452103a75060a44429751ce71ee97.tar.xz
V4L/DVB (4413): Konicawc - handle errors from input_register_device()
Compile-tested only (no hardware) Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/usbvideo')
-rw-r--r--drivers/media/video/usbvideo/konicawc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/video/usbvideo/konicawc.c b/drivers/media/video/usbvideo/konicawc.c
index 6f31ecc..4eee8be 100644
--- a/drivers/media/video/usbvideo/konicawc.c
+++ b/drivers/media/video/usbvideo/konicawc.c
@@ -222,6 +222,7 @@ static void konicawc_adjust_picture(struct uvd *uvd)
static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev)
{
struct input_dev *input_dev;
+ int error;
usb_make_path(dev, cam->input_physname, sizeof(cam->input_physname));
strncat(cam->input_physname, "/input0", sizeof(cam->input_physname));
@@ -242,7 +243,13 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev
input_dev->private = cam;
- input_register_device(cam->input);
+ error = input_register_device(cam->input);
+ if (error) {
+ warn("Failed to register camera's input device, err: %d\n",
+ error);
+ input_free_device(cam->input);
+ cam->input = NULL;
+ }
}
static void konicawc_unregister_input(struct konicawc *cam)