diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-20 08:23:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-10 06:04:52 -0500 |
commit | b07b4783fb30dee8c542fc76ed8993108d46d6aa (patch) | |
tree | 0e57cc5887511b31e964299820a7adf37e6e45ae /drivers/media/video/usbvideo/quickcam_messenger.c | |
parent | ff67c614e23bf5a3c16968e2c42ab442121c4beb (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.c | 9 |
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); | |||
86 | static void qcm_register_input(struct qcm *cam, struct usb_device *dev) | 86 | static void qcm_register_input(struct qcm *cam, struct usb_device *dev) |
87 | { | 87 | { |
88 | struct input_dev *input_dev; | 88 | struct input_dev *input_dev; |
89 | int error; | ||
89 | 90 | ||
90 | usb_make_path(dev, cam->input_physname, sizeof(cam->input_physname)); | 91 | usb_make_path(dev, cam->input_physname, sizeof(cam->input_physname)); |
91 | strncat(cam->input_physname, "/input0", sizeof(cam->input_physname)); | 92 | 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) | |||
106 | 107 | ||
107 | input_dev->private = cam; | 108 | input_dev->private = cam; |
108 | 109 | ||
109 | input_register_device(cam->input); | 110 | error = input_register_device(cam->input); |
111 | if (error) { | ||
112 | warn("Failed to register camera's input device, err: %d\n", | ||
113 | error); | ||
114 | input_free_device(cam->input); | ||
115 | cam->input = NULL; | ||
116 | } | ||
110 | } | 117 | } |
111 | 118 | ||
112 | static void qcm_unregister_input(struct qcm *cam) | 119 | static void qcm_unregister_input(struct qcm *cam) |