summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-08-02 08:01:17 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-08-02 08:01:17 -0300
commit194776fdadfd671ede360e46803ae6fcda75cb79 (patch)
tree84a20f08d9ded856def27dd54b118814d96dd5be /linux/drivers/media/video
parent384570f9e6a76f7b7368054a73de863076746689 (diff)
downloadmediapointer-dvb-s2-194776fdadfd671ede360e46803ae6fcda75cb79.tar.gz
mediapointer-dvb-s2-194776fdadfd671ede360e46803ae6fcda75cb79.tar.bz2
Konicawc - handle errors from input_register_device()
From: Dmitry Torokhov <dtor@insightbb.com> 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 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/usbvideo/konicawc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/linux/drivers/media/video/usbvideo/konicawc.c b/linux/drivers/media/video/usbvideo/konicawc.c
index 1feaf5f0b..1e8cf4485 100644
--- a/linux/drivers/media/video/usbvideo/konicawc.c
+++ b/linux/drivers/media/video/usbvideo/konicawc.c
@@ -228,6 +228,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));
@@ -248,7 +249,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);
+ cm->input = NULL;
+ }
}
static void konicawc_unregister_input(struct konicawc *cam)