summaryrefslogtreecommitdiff
path: root/drivers/media/video/usbvideo/quickcam_messenger.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-11-20 10:23:04 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-10 09:04:52 -0200
commitb07b4783fb30dee8c542fc76ed8993108d46d6aa (patch)
tree0e57cc5887511b31e964299820a7adf37e6e45ae /drivers/media/video/usbvideo/quickcam_messenger.c
parentff67c614e23bf5a3c16968e2c42ab442121c4beb (diff)
V4L/DVB (4854): Handle errors from input_register_device()
Also sprinkled some input_sync() throughout the code. Acked-by: Ricardo Cerqueira <v4l@cerqueira.org> Acked-by: Oliver Endriss <o.endriss@gmx.de> Acked-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/usbvideo/quickcam_messenger.c')
-rw-r--r--drivers/media/video/usbvideo/quickcam_messenger.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/video/usbvideo/quickcam_messenger.c b/drivers/media/video/usbvideo/quickcam_messenger.c
index bbf2beeeb449..ec0ff2247f06 100644
--- a/drivers/media/video/usbvideo/quickcam_messenger.c
+++ b/drivers/media/video/usbvideo/quickcam_messenger.c
@@ -86,6 +86,7 @@ MODULE_DEVICE_TABLE(usb, qcm_table);
static void qcm_register_input(struct qcm *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));
@@ -106,7 +107,13 @@ static void qcm_register_input(struct qcm *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 qcm_unregister_input(struct qcm *cam)