summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2019-05-23 06:01:51 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-05-29 12:57:37 -0400
commit0547858b00bf2e895ee7c6ede7b376450e217171 (patch)
treef986ac09aab1b566140decba3c96870af4000031 /drivers/media/usb
parent6bd914bc05f378071f9fa975ce91fbf9a4a5e224 (diff)
downloadlinux-0547858b00bf2e895ee7c6ede7b376450e217171.tar.bz2
media: em28xx: use usb_to_input_id() rather than handrolling it
This also populates the version member correctly. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/em28xx/em28xx-input.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index 6e43da5f6c5a..5aa15a7a49de 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/usb.h>
+#include <linux/usb/input.h>
#include <linux/slab.h>
#include <linux/bitrev.h>
@@ -603,10 +604,7 @@ static int em28xx_register_snapshot_button(struct em28xx *dev)
set_bit(EM28XX_SNAPSHOT_KEY, input_dev->keybit);
input_dev->keycodesize = 0;
input_dev->keycodemax = 0;
- input_dev->id.bustype = BUS_USB;
- input_dev->id.vendor = le16_to_cpu(udev->descriptor.idVendor);
- input_dev->id.product = le16_to_cpu(udev->descriptor.idProduct);
- input_dev->id.version = 1;
+ usb_to_input_id(udev, &input_dev->id);
input_dev->dev.parent = &dev->intf->dev;
err = input_register_device(input_dev);
@@ -823,10 +821,7 @@ static int em28xx_ir_init(struct em28xx *dev)
rc->device_name = em28xx_boards[dev->model].name;
rc->input_phys = ir->phys;
- rc->input_id.bustype = BUS_USB;
- rc->input_id.version = 1;
- rc->input_id.vendor = le16_to_cpu(udev->descriptor.idVendor);
- rc->input_id.product = le16_to_cpu(udev->descriptor.idProduct);
+ usb_to_input_id(udev, &rc->input_id);
rc->dev.parent = &dev->intf->dev;
rc->driver_name = MODULE_NAME;