Jarod Wilson 6d7bd0
 drivers/media/IR/imon.c   |   20 +-------------------
Jarod Wilson 6d7bd0
 drivers/media/IR/mceusb.c |   15 +--------------
Jarod Wilson 6d7bd0
 2 files changed, 2 insertions(+), 33 deletions(-)
Jarod Wilson 6d7bd0
Jarod Wilson 6d7bd0
diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
Jarod Wilson 6d7bd0
index 65c125e..c185422 100644
Jarod Wilson 6d7bd0
--- a/drivers/media/IR/imon.c
Jarod Wilson 6d7bd0
+++ b/drivers/media/IR/imon.c
Jarod Wilson 6d7bd0
@@ -87,7 +87,6 @@ static ssize_t lcd_write(struct file *file, const char *buf,
Jarod Wilson 6d7bd0
 struct imon_context {
Jarod Wilson 6d7bd0
 	struct device *dev;
Jarod Wilson 6d7bd0
 	struct ir_dev_props *props;
Jarod Wilson 6d7bd0
-	struct ir_input_dev *ir;
Jarod Wilson 6d7bd0
 	/* Newer devices have two interfaces */
Jarod Wilson 6d7bd0
 	struct usb_device *usbdev_intf0;
Jarod Wilson 6d7bd0
 	struct usb_device *usbdev_intf1;
Jarod Wilson 6d7bd0
@@ -1656,7 +1655,6 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
Jarod Wilson 6d7bd0
 {
Jarod Wilson 6d7bd0
 	struct input_dev *idev;
Jarod Wilson 6d7bd0
 	struct ir_dev_props *props;
Jarod Wilson 6d7bd0
-	struct ir_input_dev *ir;
Jarod Wilson 6d7bd0
 	int ret, i;
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
 	idev = input_allocate_device();
Jarod Wilson 6d7bd0
@@ -1671,12 +1669,6 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
Jarod Wilson 6d7bd0
 		goto props_alloc_failed;
Jarod Wilson 6d7bd0
 	}
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
-	ir = kzalloc(sizeof(struct ir_input_dev), GFP_KERNEL);
Jarod Wilson 6d7bd0
-	if (!ir) {
Jarod Wilson 6d7bd0
-		dev_err(ictx->dev, "remote ir input dev allocation failed\n");
Jarod Wilson 6d7bd0
-		goto ir_dev_alloc_failed;
Jarod Wilson 6d7bd0
-	}
Jarod Wilson 6d7bd0
-
Jarod Wilson 6d7bd0
 	snprintf(ictx->name_idev, sizeof(ictx->name_idev),
Jarod Wilson 6d7bd0
 		 "iMON Remote (%04x:%04x)", ictx->vendor, ictx->product);
Jarod Wilson 6d7bd0
 	idev->name = ictx->name_idev;
Jarod Wilson 6d7bd0
@@ -1706,14 +1698,9 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
Jarod Wilson 6d7bd0
 	props->change_protocol = imon_ir_change_protocol;
Jarod Wilson 6d7bd0
 	ictx->props = props;
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
-	ictx->ir = ir;
Jarod Wilson 6d7bd0
-	memcpy(&ir->dev, ictx->dev, sizeof(struct device));
Jarod Wilson 6d7bd0
-
Jarod Wilson 6d7bd0
 	usb_to_input_id(ictx->usbdev_intf0, &idev->id);
Jarod Wilson 6d7bd0
 	idev->dev.parent = ictx->dev;
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
-	input_set_drvdata(idev, ir);
Jarod Wilson 6d7bd0
-
Jarod Wilson 6d7bd0
 	ret = ir_input_register(idev, RC_MAP_IMON_PAD, props, MOD_NAME);
Jarod Wilson 6d7bd0
 	if (ret < 0) {
Jarod Wilson 6d7bd0
 		dev_err(ictx->dev, "remote input dev register failed\n");
Jarod Wilson 6d7bd0
@@ -1723,8 +1710,6 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)
Jarod Wilson 6d7bd0
 	return idev;
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
 idev_register_failed:
Jarod Wilson 6d7bd0
-	kfree(ir);
Jarod Wilson 6d7bd0
-ir_dev_alloc_failed:
Jarod Wilson 6d7bd0
 	kfree(props);
Jarod Wilson 6d7bd0
 props_alloc_failed:
Jarod Wilson 6d7bd0
 	input_free_device(idev);
Jarod Wilson 6d7bd0
@@ -1944,7 +1929,6 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
 urb_submit_failed:
Jarod Wilson 6d7bd0
 	ir_input_unregister(ictx->idev);
Jarod Wilson 6d7bd0
-	input_free_device(ictx->idev);
Jarod Wilson 6d7bd0
 idev_setup_failed:
Jarod Wilson 6d7bd0
 find_endpoint_failed:
Jarod Wilson 6d7bd0
 	mutex_unlock(&ictx->lock);
Jarod Wilson 6d7bd0
@@ -2014,10 +1998,8 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf,
Jarod Wilson 6d7bd0
 	return ictx;
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
 urb_submit_failed:
Jarod Wilson 6d7bd0
-	if (ictx->touch) {
Jarod Wilson 6d7bd0
+	if (ictx->touch)
Jarod Wilson 6d7bd0
 		input_unregister_device(ictx->touch);
Jarod Wilson 6d7bd0
-		input_free_device(ictx->touch);
Jarod Wilson 6d7bd0
-	}
Jarod Wilson 6d7bd0
 touch_setup_failed:
Jarod Wilson 6d7bd0
 find_endpoint_failed:
Jarod Wilson 6d7bd0
 	mutex_unlock(&ictx->lock);
Jarod Wilson 6d7bd0
diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
Jarod Wilson 6d7bd0
index 78bf7f7..65b0738 100644
Jarod Wilson 6d7bd0
--- a/drivers/media/IR/mceusb.c
Jarod Wilson 6d7bd0
+++ b/drivers/media/IR/mceusb.c
Jarod Wilson 6d7bd0
@@ -228,7 +228,6 @@ static struct usb_device_id std_tx_mask_list[] = {
Jarod Wilson 6d7bd0
 /* data structure for each usb transceiver */
Jarod Wilson 6d7bd0
 struct mceusb_dev {
Jarod Wilson 6d7bd0
 	/* ir-core bits */
Jarod Wilson 6d7bd0
-	struct ir_input_dev *irdev;
Jarod Wilson 6d7bd0
 	struct ir_dev_props *props;
Jarod Wilson 6d7bd0
 	struct ir_raw_event rawir;
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
@@ -739,7 +738,7 @@ static void mceusb_dev_recv(struct urb *urb, struct pt_regs *regs)
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
 	if (ir->send_flags == RECV_FLAG_IN_PROGRESS) {
Jarod Wilson 6d7bd0
 		ir->send_flags = SEND_FLAG_COMPLETE;
Jarod Wilson 6d7bd0
-		dev_dbg(&ir->irdev->dev, "setup answer received %d bytes\n",
Jarod Wilson 6d7bd0
+		dev_dbg(ir->dev, "setup answer received %d bytes\n",
Jarod Wilson 6d7bd0
 			buf_len);
Jarod Wilson 6d7bd0
 	}
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
@@ -861,7 +860,6 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
Jarod Wilson 6d7bd0
 {
Jarod Wilson 6d7bd0
 	struct input_dev *idev;
Jarod Wilson 6d7bd0
 	struct ir_dev_props *props;
Jarod Wilson 6d7bd0
-	struct ir_input_dev *irdev;
Jarod Wilson 6d7bd0
 	struct device *dev = ir->dev;
Jarod Wilson 6d7bd0
 	int ret = -ENODEV;
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
@@ -878,12 +876,6 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
Jarod Wilson 6d7bd0
 		goto props_alloc_failed;
Jarod Wilson 6d7bd0
 	}
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
-	irdev = kzalloc(sizeof(struct ir_input_dev), GFP_KERNEL);
Jarod Wilson 6d7bd0
-	if (!irdev) {
Jarod Wilson 6d7bd0
-		dev_err(dev, "remote ir input dev allocation failed\n");
Jarod Wilson 6d7bd0
-		goto ir_dev_alloc_failed;
Jarod Wilson 6d7bd0
-	}
Jarod Wilson 6d7bd0
-
Jarod Wilson 6d7bd0
 	snprintf(ir->name, sizeof(ir->name), "Media Center Ed. eHome "
Jarod Wilson 6d7bd0
 		 "Infrared Remote Transceiver (%04x:%04x)",
Jarod Wilson 6d7bd0
 		 le16_to_cpu(ir->usbdev->descriptor.idVendor),
Jarod Wilson 6d7bd0
@@ -902,9 +894,6 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
Jarod Wilson 6d7bd0
 	props->tx_ir = mceusb_tx_ir;
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
 	ir->props = props;
Jarod Wilson 6d7bd0
-	ir->irdev = irdev;
Jarod Wilson 6d7bd0
-
Jarod Wilson 6d7bd0
-	input_set_drvdata(idev, irdev);
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
 	ret = ir_input_register(idev, RC_MAP_RC6_MCE, props, DRIVER_NAME);
Jarod Wilson 6d7bd0
 	if (ret < 0) {
Jarod Wilson 6d7bd0
@@ -915,8 +904,6 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
Jarod Wilson 6d7bd0
 	return idev;
Jarod Wilson 6d7bd0
 
Jarod Wilson 6d7bd0
 irdev_failed:
Jarod Wilson 6d7bd0
-	kfree(irdev);
Jarod Wilson 6d7bd0
-ir_dev_alloc_failed:
Jarod Wilson 6d7bd0
 	kfree(props);
Jarod Wilson 6d7bd0
 props_alloc_failed:
Jarod Wilson 6d7bd0
 	input_free_device(idev);