diff options
-rw-r--r-- | drivers/media/video/uvc/uvc_status.c | 16 | ||||
-rw-r--r-- | drivers/media/video/uvc/uvcvideo.h | 1 |
2 files changed, 5 insertions, 12 deletions
diff --git a/drivers/media/video/uvc/uvc_status.c b/drivers/media/video/uvc/uvc_status.c index c705f248da88..21d87124986b 100644 --- a/drivers/media/video/uvc/uvc_status.c +++ b/drivers/media/video/uvc/uvc_status.c | |||
@@ -24,26 +24,19 @@ | |||
24 | #ifdef CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV | 24 | #ifdef CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV |
25 | static int uvc_input_init(struct uvc_device *dev) | 25 | static int uvc_input_init(struct uvc_device *dev) |
26 | { | 26 | { |
27 | struct usb_device *udev = dev->udev; | ||
28 | struct input_dev *input; | 27 | struct input_dev *input; |
29 | char *phys = NULL; | ||
30 | int ret; | 28 | int ret; |
31 | 29 | ||
32 | input = input_allocate_device(); | 30 | input = input_allocate_device(); |
33 | if (input == NULL) | 31 | if (input == NULL) |
34 | return -ENOMEM; | 32 | return -ENOMEM; |
35 | 33 | ||
36 | phys = kmalloc(6 + strlen(udev->bus->bus_name) + strlen(udev->devpath), | 34 | usb_make_path(dev->udev, dev->input_phys, sizeof(dev->input_phys)); |
37 | GFP_KERNEL); | 35 | strlcat(dev->input_phys, "/button", sizeof(dev->input_phys)); |
38 | if (phys == NULL) { | ||
39 | ret = -ENOMEM; | ||
40 | goto error; | ||
41 | } | ||
42 | sprintf(phys, "usb-%s-%s", udev->bus->bus_name, udev->devpath); | ||
43 | 36 | ||
44 | input->name = dev->name; | 37 | input->name = dev->name; |
45 | input->phys = phys; | 38 | input->phys = dev->input_phys; |
46 | usb_to_input_id(udev, &input->id); | 39 | usb_to_input_id(dev->udev, &input->id); |
47 | input->dev.parent = &dev->intf->dev; | 40 | input->dev.parent = &dev->intf->dev; |
48 | 41 | ||
49 | __set_bit(EV_KEY, input->evbit); | 42 | __set_bit(EV_KEY, input->evbit); |
@@ -57,7 +50,6 @@ static int uvc_input_init(struct uvc_device *dev) | |||
57 | 50 | ||
58 | error: | 51 | error: |
59 | input_free_device(input); | 52 | input_free_device(input); |
60 | kfree(phys); | ||
61 | return ret; | 53 | return ret; |
62 | } | 54 | } |
63 | 55 | ||
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index b2639878f9b2..6f55c4d49cf4 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h | |||
@@ -647,6 +647,7 @@ struct uvc_device { | |||
647 | struct urb *int_urb; | 647 | struct urb *int_urb; |
648 | __u8 *status; | 648 | __u8 *status; |
649 | struct input_dev *input; | 649 | struct input_dev *input; |
650 | char input_phys[64]; | ||
650 | 651 | ||
651 | /* Video Streaming interfaces */ | 652 | /* Video Streaming interfaces */ |
652 | struct list_head streaming; | 653 | struct list_head streaming; |