aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/imon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/IR/imon.c')
-rw-r--r--drivers/media/IR/imon.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
index 65c125e44e96..c185422ef28c 100644
--- a/drivers/media/IR/imon.c
+++ b/drivers/media/IR/imon.c
@@ -87,7 +87,6 @@ static ssize_t lcd_write(struct file *file, const char *buf,
87struct imon_context { 87struct imon_context {
88 struct device *dev; 88 struct device *dev;
89 struct ir_dev_props *props; 89 struct ir_dev_props *props;
90 struct ir_input_dev *ir;
91 /* Newer devices have two interfaces */ 90 /* Newer devices have two interfaces */
92 struct usb_device *usbdev_intf0; 91 struct usb_device *usbdev_intf0;
93 struct usb_device *usbdev_intf1; 92 struct usb_device *usbdev_intf1;
@@ -1656,7 +1655,6 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
1656{ 1655{
1657 struct input_dev *idev; 1656 struct input_dev *idev;
1658 struct ir_dev_props *props; 1657 struct ir_dev_props *props;
1659 struct ir_input_dev *ir;
1660 int ret, i; 1658 int ret, i;
1661 1659
1662 idev = input_allocate_device(); 1660 idev = input_allocate_device();
@@ -1671,12 +1669,6 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
1671 goto props_alloc_failed; 1669 goto props_alloc_failed;
1672 } 1670 }
1673 1671
1674 ir = kzalloc(sizeof(struct ir_input_dev), GFP_KERNEL);
1675 if (!ir) {
1676 dev_err(ictx->dev, "remote ir input dev allocation failed\n");
1677 goto ir_dev_alloc_failed;
1678 }
1679
1680 snprintf(ictx->name_idev, sizeof(ictx->name_idev), 1672 snprintf(ictx->name_idev, sizeof(ictx->name_idev),
1681 "iMON Remote (%04x:%04x)", ictx->vendor, ictx->product); 1673 "iMON Remote (%04x:%04x)", ictx->vendor, ictx->product);
1682 idev->name = ictx->name_idev; 1674 idev->name = ictx->name_idev;
@@ -1706,14 +1698,9 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
1706 props->change_protocol = imon_ir_change_protocol; 1698 props->change_protocol = imon_ir_change_protocol;
1707 ictx->props = props; 1699 ictx->props = props;
1708 1700
1709 ictx->ir = ir;
1710 memcpy(&ir->dev, ictx->dev, sizeof(struct device));
1711
1712 usb_to_input_id(ictx->usbdev_intf0, &idev->id); 1701 usb_to_input_id(ictx->usbdev_intf0, &idev->id);
1713 idev->dev.parent = ictx->dev; 1702 idev->dev.parent = ictx->dev;
1714 1703
1715 input_set_drvdata(idev, ir);
1716
1717 ret = ir_input_register(idev, RC_MAP_IMON_PAD, props, MOD_NAME); 1704 ret = ir_input_register(idev, RC_MAP_IMON_PAD, props, MOD_NAME);
1718 if (ret < 0) { 1705 if (ret < 0) {
1719 dev_err(ictx->dev, "remote input dev register failed\n"); 1706 dev_err(ictx->dev, "remote input dev register failed\n");
@@ -1723,8 +1710,6 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
1723 return idev; 1710 return idev;
1724 1711
1725idev_register_failed: 1712idev_register_failed:
1726 kfree(ir);
1727ir_dev_alloc_failed:
1728 kfree(props); 1713 kfree(props);
1729props_alloc_failed: 1714props_alloc_failed:
1730 input_free_device(idev); 1715 input_free_device(idev);
@@ -1944,7 +1929,6 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
1944 1929
1945urb_submit_failed: 1930urb_submit_failed:
1946 ir_input_unregister(ictx->idev); 1931 ir_input_unregister(ictx->idev);
1947 input_free_device(ictx->idev);
1948idev_setup_failed: 1932idev_setup_failed:
1949find_endpoint_failed: 1933find_endpoint_failed:
1950 mutex_unlock(&ictx->lock); 1934 mutex_unlock(&ictx->lock);
@@ -2014,10 +1998,8 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf,
2014 return ictx; 1998 return ictx;
2015 1999
2016urb_submit_failed: 2000urb_submit_failed:
2017 if (ictx->touch) { 2001 if (ictx->touch)
2018 input_unregister_device(ictx->touch); 2002 input_unregister_device(ictx->touch);
2019 input_free_device(ictx->touch);
2020 }
2021touch_setup_failed: 2003touch_setup_failed:
2022find_endpoint_failed: 2004find_endpoint_failed:
2023 mutex_unlock(&ictx->lock); 2005 mutex_unlock(&ictx->lock);