imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,47 +1,46 @@
 static int dvb_usbv2_remote_init(struct dvb_usb_device *d) {
   int ret;
   struct rc_dev *dev;
   dev_dbg(&d->udev->dev, "%s:\n", __func__);
   if (dvb_usbv2_disable_rc_polling || !d->props->get_rc_config) return 0;
   d->rc.map_name = d->rc_map;
   ret = d->props->get_rc_config(d, &d->rc);
   if (ret < 0) goto err;
   /* disable rc when there is no keymap defined */
   if (!d->rc.map_name) return 0;
-  dev = rc_allocate_device();
+  dev = rc_allocate_device(d->rc.driver_type);
   if (!dev) {
     ret = -ENOMEM;
     goto err;
   }
   dev->dev.parent = &d->udev->dev;
   dev->input_name = d->name;
   usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys));
   strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys));
   dev->input_phys = d->rc_phys;
   usb_to_input_id(d->udev, &dev->input_id);
   /* TODO: likely RC-core should took const char * */
   dev->driver_name = (char *)d->props->driver_name;
   dev->map_name = d->rc.map_name;
-  dev->driver_type = d->rc.driver_type;
   dev->allowed_protocols = d->rc.allowed_protos;
   dev->change_protocol = d->rc.change_protocol;
   dev->priv = d;
   ret = rc_register_device(dev);
   if (ret < 0) {
     rc_free_device(dev);
     goto err;
   }
   d->rc_dev = dev;
   /* start polling if needed */
   if (d->rc.query && !d->rc.bulk_mode) {
     /* initialize a work queue for handling polling */
     INIT_DELAYED_WORK(&d->rc_query_work, dvb_usb_read_remote_control);
     dev_info(&d->udev->dev, "%s: schedule remote query interval to %d msecs\n", KBUILD_MODNAME, d->rc.interval);
     schedule_delayed_work(&d->rc_query_work, msecs_to_jiffies(d->rc.interval));
     d->rc_polling_active = true;
   }
   return 0;
 err:
   dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
   return ret;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;
--- initial
+++ final
@@ -1,74 +1,73 @@
 static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) {
   int error = -ENOMEM;
   struct rc_dev *rdev;
   struct ene_device *dev;
   /* allocate memory */
   dev = kzalloc(sizeof(struct ene_device), GFP_KERNEL);
-  rdev = rc_allocate_device();
+  rdev = rc_allocate_device(RC_DRIVER_IR_RAW);
   if (!dev || !rdev) goto exit_free_dev_rdev;
   /* validate resources */
   error = -ENODEV;
   /* init these to -1, as 0 is valid for both */
   dev->hw_io = -1;
   dev->irq = -1;
   if (!pnp_port_valid(pnp_dev, 0) || pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE) goto exit_free_dev_rdev;
   if (!pnp_irq_valid(pnp_dev, 0)) goto exit_free_dev_rdev;
   spin_lock_init(&dev->hw_lock);
   dev->hw_io = pnp_port_start(pnp_dev, 0);
   dev->irq = pnp_irq(pnp_dev, 0);
   pnp_set_drvdata(pnp_dev, dev);
   dev->pnp_dev = pnp_dev;
   /* don't allow too short/long sample periods */
   if (sample_period < 5 || sample_period > 0x7F) sample_period = ENE_DEFAULT_SAMPLE_PERIOD;
   /* detect hardware version and features */
   error = ene_hw_detect(dev);
   if (error) goto exit_free_dev_rdev;
   if (!dev->hw_learning_and_tx_capable && txsim) {
     dev->hw_learning_and_tx_capable = true;
     setup_timer(&dev->tx_sim_timer, ene_tx_irqsim, (long unsigned int)dev);
     pr_warn("Simulation of TX activated\n");
   }
   if (!dev->hw_learning_and_tx_capable) learning_mode_force = false;
-  rdev->driver_type = RC_DRIVER_IR_RAW;
   rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
   rdev->priv = dev;
   rdev->open = ene_open;
   rdev->close = ene_close;
   rdev->s_idle = ene_set_idle;
   rdev->driver_name = ENE_DRIVER_NAME;
   rdev->map_name = RC_MAP_RC6_MCE;
   rdev->input_name = "ENE eHome Infrared Remote Receiver";
   if (dev->hw_learning_and_tx_capable) {
     rdev->s_learning_mode = ene_set_learning_mode;
     init_completion(&dev->tx_complete);
     rdev->tx_ir = ene_transmit;
     rdev->s_tx_mask = ene_set_tx_mask;
     rdev->s_tx_carrier = ene_set_tx_carrier;
     rdev->s_tx_duty_cycle = ene_set_tx_duty_cycle;
     rdev->s_carrier_report = ene_set_carrier_report;
     rdev->input_name = "ENE eHome Infrared Remote Transceiver";
   }
   dev->rdev = rdev;
   ene_rx_setup_hw_buffer(dev);
   ene_setup_default_settings(dev);
   ene_setup_hw_settings(dev);
   device_set_wakeup_capable(&pnp_dev->dev, true);
   device_set_wakeup_enable(&pnp_dev->dev, true);
   error = rc_register_device(rdev);
   if (error < 0) goto exit_free_dev_rdev;
   /* claim the resources */
   error = -EBUSY;
   if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { goto exit_unregister_device; }
   if (request_irq(dev->irq, ene_isr, IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { goto exit_release_hw_io; }
   pr_notice("driver has been successfully loaded\n");
   return 0;
 exit_release_hw_io:
   release_region(dev->hw_io, ENE_IO_SIZE);
 exit_unregister_device:
   rc_unregister_device(rdev);
   rdev = NULL;
 exit_free_dev_rdev:
   rc_free_device(rdev);
   kfree(dev);
   return error;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;
--- initial
+++ final
@@ -1,73 +1,72 @@
 static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) {
   struct fintek_dev *fintek;
   struct rc_dev *rdev;
   int ret = -ENOMEM;
   fintek = kzalloc(sizeof(struct fintek_dev), GFP_KERNEL);
   if (!fintek) return ret;
   /* input device for IR remote (and tx) */
-  rdev = rc_allocate_device();
+  rdev = rc_allocate_device(RC_DRIVER_IR_RAW);
   if (!rdev) goto exit_free_dev_rdev;
   ret = -ENODEV;
   /* validate pnp resources */
   if (!pnp_port_valid(pdev, 0)) {
     dev_err(&pdev->dev, "IR PNP Port not valid!\n");
     goto exit_free_dev_rdev;
   }
   if (!pnp_irq_valid(pdev, 0)) {
     dev_err(&pdev->dev, "IR PNP IRQ not valid!\n");
     goto exit_free_dev_rdev;
   }
   fintek->cir_addr = pnp_port_start(pdev, 0);
   fintek->cir_irq = pnp_irq(pdev, 0);
   fintek->cir_port_len = pnp_port_len(pdev, 0);
   fintek->cr_ip = CR_INDEX_PORT;
   fintek->cr_dp = CR_DATA_PORT;
   spin_lock_init(&fintek->fintek_lock);
   pnp_set_drvdata(pdev, fintek);
   fintek->pdev = pdev;
   ret = fintek_hw_detect(fintek);
   if (ret) goto exit_free_dev_rdev;
   /* Initialize CIR & CIR Wake Logical Devices */
   fintek_config_mode_enable(fintek);
   fintek_cir_ldev_init(fintek);
   fintek_config_mode_disable(fintek);
   /* Initialize CIR & CIR Wake Config Registers */
   fintek_cir_regs_init(fintek);
   /* Set up the rc device */
   rdev->priv = fintek;
-  rdev->driver_type = RC_DRIVER_IR_RAW;
   rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
   rdev->open = fintek_open;
   rdev->close = fintek_close;
   rdev->input_name = FINTEK_DESCRIPTION;
   rdev->input_phys = "fintek/cir0";
   rdev->input_id.bustype = BUS_HOST;
   rdev->input_id.vendor = VENDOR_ID_FINTEK;
   rdev->input_id.product = fintek->chip_major;
   rdev->input_id.version = fintek->chip_minor;
   rdev->dev.parent = &pdev->dev;
   rdev->driver_name = FINTEK_DRIVER_NAME;
   rdev->map_name = RC_MAP_RC6_MCE;
   rdev->timeout = US_TO_NS(1000);
   /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */
   rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);
   fintek->rdev = rdev;
   ret = -EBUSY;
   /* now claim resources */
   if (!request_region(fintek->cir_addr, fintek->cir_port_len, FINTEK_DRIVER_NAME)) goto exit_free_dev_rdev;
   if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, FINTEK_DRIVER_NAME, (void *)fintek)) goto exit_free_cir_addr;
   ret = rc_register_device(rdev);
   if (ret) goto exit_free_irq;
   device_init_wakeup(&pdev->dev, true);
   fit_pr(KERN_NOTICE, "driver has been successfully loaded\n");
   if (debug) cir_dump_regs(fintek);
   return 0;
 exit_free_irq:
   free_irq(fintek->cir_irq, fintek);
 exit_free_cir_addr:
   release_region(fintek->cir_addr, fintek->cir_port_len);
 exit_free_dev_rdev:
   rc_free_device(rdev);
   kfree(fintek);
   return ret;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;
--- initial
+++ final
@@ -1,68 +1,67 @@
 static int gpio_ir_recv_probe(struct platform_device *pdev) {
   struct gpio_rc_dev *gpio_dev;
   struct rc_dev *rcdev;
   const struct gpio_ir_recv_platform_data *pdata = pdev->dev.platform_data;
   int rc;
   if (pdev->dev.of_node) {
     struct gpio_ir_recv_platform_data *dtpdata = devm_kzalloc(&pdev->dev, sizeof(*dtpdata), GFP_KERNEL);
     if (!dtpdata) return -ENOMEM;
     rc = gpio_ir_recv_get_devtree_pdata(&pdev->dev, dtpdata);
     if (rc) return rc;
     pdata = dtpdata;
   }
   if (!pdata) return -EINVAL;
   if (pdata->gpio_nr < 0) return -EINVAL;
   gpio_dev = kzalloc(sizeof(struct gpio_rc_dev), GFP_KERNEL);
   if (!gpio_dev) return -ENOMEM;
-  rcdev = rc_allocate_device();
+  rcdev = rc_allocate_device(RC_DRIVER_IR_RAW);
   if (!rcdev) {
     rc = -ENOMEM;
     goto err_allocate_device;
   }
   rcdev->priv = gpio_dev;
-  rcdev->driver_type = RC_DRIVER_IR_RAW;
   rcdev->input_name = GPIO_IR_DEVICE_NAME;
   rcdev->input_phys = GPIO_IR_DEVICE_NAME "/input0";
   rcdev->input_id.bustype = BUS_HOST;
   rcdev->input_id.vendor = 0x0001;
   rcdev->input_id.product = 0x0001;
   rcdev->input_id.version = 0x0100;
   rcdev->dev.parent = &pdev->dev;
   rcdev->driver_name = GPIO_IR_DRIVER_NAME;
   rcdev->min_timeout = 0;
   rcdev->timeout = IR_DEFAULT_TIMEOUT;
   rcdev->max_timeout = 10 * IR_DEFAULT_TIMEOUT;
   if (pdata->allowed_protos)
     rcdev->allowed_protocols = pdata->allowed_protos;
   else
     rcdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
   rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY;
   gpio_dev->rcdev = rcdev;
   gpio_dev->gpio_nr = pdata->gpio_nr;
   gpio_dev->active_low = pdata->active_low;
   setup_timer(&gpio_dev->flush_timer, flush_timer, (unsigned long)gpio_dev);
   rc = gpio_request(pdata->gpio_nr, "gpio-ir-recv");
   if (rc < 0) goto err_gpio_request;
   rc = gpio_direction_input(pdata->gpio_nr);
   if (rc < 0) goto err_gpio_direction_input;
   rc = rc_register_device(rcdev);
   if (rc < 0) {
     dev_err(&pdev->dev, "failed to register rc device\n");
     goto err_register_rc_device;
   }
   platform_set_drvdata(pdev, gpio_dev);
   rc = request_any_context_irq(gpio_to_irq(pdata->gpio_nr), gpio_ir_recv_irq, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "gpio-ir-recv-irq", gpio_dev);
   if (rc < 0) goto err_request_irq;
   return 0;
 err_request_irq:
   rc_unregister_device(rcdev);
   rcdev = NULL;
 err_register_rc_device:
 err_gpio_direction_input:
   gpio_free(pdata->gpio_nr);
 err_gpio_request:
   rc_free_device(rcdev);
 err_allocate_device:
   kfree(gpio_dev);
   return rc;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;
--- initial
+++ final
@@ -1,29 +1,28 @@
 int picolcd_init_cir(struct picolcd_data *data, struct hid_report *report) {
   struct rc_dev *rdev;
   int ret = 0;
-  rdev = rc_allocate_device();
+  rdev = rc_allocate_device(RC_DRIVER_IR_RAW);
   if (!rdev) return -ENOMEM;
   rdev->priv = data;
-  rdev->driver_type = RC_DRIVER_IR_RAW;
   rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
   rdev->open = picolcd_cir_open;
   rdev->close = picolcd_cir_close;
   rdev->input_name = data->hdev->name;
   rdev->input_phys = data->hdev->phys;
   rdev->input_id.bustype = data->hdev->bus;
   rdev->input_id.vendor = data->hdev->vendor;
   rdev->input_id.product = data->hdev->product;
   rdev->input_id.version = data->hdev->version;
   rdev->dev.parent = &data->hdev->dev;
   rdev->driver_name = PICOLCD_NAME;
   rdev->map_name = RC_MAP_RC6_MCE;
   rdev->timeout = MS_TO_NS(100);
   rdev->rx_resolution = US_TO_NS(1);
   ret = rc_register_device(rdev);
   if (ret) goto err;
   data->rc_dev = rdev;
   return 0;
 err:
   rc_free_device(rdev);
   return ret;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;
--- initial
+++ final
@@ -1,61 +1,60 @@
 static int igorplugusb_probe(struct usb_interface *intf, const struct usb_device_id *id) {
   struct usb_device *udev;
   struct usb_host_interface *idesc;
   struct usb_endpoint_descriptor *ep;
   struct igorplugusb *ir;
   struct rc_dev *rc;
   int ret = -ENOMEM;
   udev = interface_to_usbdev(intf);
   idesc = intf->cur_altsetting;
   if (idesc->desc.bNumEndpoints != 1) {
     dev_err(&intf->dev, "incorrect number of endpoints");
     return -ENODEV;
   }
   ep = &idesc->endpoint[0].desc;
   if (!usb_endpoint_dir_in(ep) || !usb_endpoint_xfer_control(ep)) {
     dev_err(&intf->dev, "endpoint incorrect");
     return -ENODEV;
   }
   ir = devm_kzalloc(&intf->dev, sizeof(*ir), GFP_KERNEL);
   if (!ir) return -ENOMEM;
   ir->dev = &intf->dev;
   setup_timer(&ir->timer, igorplugusb_timer, (unsigned long)ir);
   ir->request.bRequest = GET_INFRACODE;
   ir->request.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN;
   ir->request.wLength = cpu_to_le16(sizeof(ir->buf_in));
   ir->urb = usb_alloc_urb(0, GFP_KERNEL);
   if (!ir->urb) goto fail;
   usb_fill_control_urb(ir->urb, udev, usb_rcvctrlpipe(udev, 0), (uint8_t *)&ir->request, ir->buf_in, sizeof(ir->buf_in), igorplugusb_callback, ir);
   usb_make_path(udev, ir->phys, sizeof(ir->phys));
-  rc = rc_allocate_device();
+  rc = rc_allocate_device(RC_DRIVER_IR_RAW);
   if (!rc) goto fail;
   rc->input_name = DRIVER_DESC;
   rc->input_phys = ir->phys;
   usb_to_input_id(udev, &rc->input_id);
   rc->dev.parent = &intf->dev;
-  rc->driver_type = RC_DRIVER_IR_RAW;
   /*
    * This device can only store 36 pulses + spaces, which is not enough
    * for the NEC protocol and many others.
    */
   rc->allowed_protocols = RC_BIT_ALL_IR_DECODER & ~(RC_BIT_NEC | RC_BIT_NECX | RC_BIT_NEC32 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE | RC_BIT_SONY20 | RC_BIT_MCE_KBD | RC_BIT_SANYO);
   rc->priv = ir;
   rc->driver_name = DRIVER_NAME;
   rc->map_name = RC_MAP_HAUPPAUGE;
   rc->timeout = MS_TO_NS(100);
   rc->rx_resolution = 85333;
   ir->rc = rc;
   ret = rc_register_device(rc);
   if (ret) {
     dev_err(&intf->dev, "failed to register rc device: %d", ret);
     goto fail;
   }
   usb_set_intfdata(intf, ir);
   igorplugusb_cmd(ir, SET_INFRABUFFER_EMPTY);
   return 0;
 fail:
   rc_free_device(ir->rc);
   usb_free_urb(ir->urb);
   del_timer(&ir->timer);
   return ret;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;
--- initial
+++ final
@@ -1,45 +1,44 @@
 static struct rc_dev *imon_init_rdev(struct imon_context *ictx) {
   struct rc_dev *rdev;
   int ret;
   const unsigned char fp_packet[] = {0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88};
-  rdev = rc_allocate_device();
+  rdev = rc_allocate_device(RC_DRIVER_SCANCODE);
   if (!rdev) {
     dev_err(ictx->dev, "remote control dev allocation failed\n");
     goto out;
   }
   snprintf(ictx->name_rdev, sizeof(ictx->name_rdev), "iMON Remote (%04x:%04x)", ictx->vendor, ictx->product);
   usb_make_path(ictx->usbdev_intf0, ictx->phys_rdev, sizeof(ictx->phys_rdev));
   strlcat(ictx->phys_rdev, "/input0", sizeof(ictx->phys_rdev));
   rdev->input_name = ictx->name_rdev;
   rdev->input_phys = ictx->phys_rdev;
   usb_to_input_id(ictx->usbdev_intf0, &rdev->input_id);
   rdev->dev.parent = ictx->dev;
   rdev->priv = ictx;
-  rdev->driver_type = RC_DRIVER_SCANCODE;
   rdev->allowed_protocols = RC_BIT_OTHER | RC_BIT_RC6_MCE; /* iMON PAD or MCE */
   rdev->change_protocol = imon_ir_change_protocol;
   rdev->driver_name = MOD_NAME;
   /* Enable front-panel buttons and/or knobs */
   memcpy(ictx->usb_tx_buf, &fp_packet, sizeof(fp_packet));
   ret = send_packet(ictx);
   /* Not fatal, but warn about it */
   if (ret) dev_info(ictx->dev, "panel buttons/knobs setup failed\n");
   if (ictx->product == 0xffdc) {
     imon_get_ffdc_type(ictx);
     rdev->allowed_protocols = ictx->rc_type;
   }
   imon_set_display_type(ictx);
   if (ictx->rc_type == RC_BIT_RC6_MCE)
     rdev->map_name = RC_MAP_IMON_MCE;
   else
     rdev->map_name = RC_MAP_IMON_PAD;
   ret = rc_register_device(rdev);
   if (ret < 0) {
     dev_err(ictx->dev, "remote input dev register failed\n");
     goto out;
   }
   return rdev;
 out:
   rc_free_device(rdev);
   return NULL;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;
--- initial
+++ final
@@ -1,70 +1,69 @@
 static int hix5hd2_ir_probe(struct platform_device *pdev) {
   struct rc_dev *rdev;
   struct device *dev = &pdev->dev;
   struct resource *res;
   struct hix5hd2_ir_priv *priv;
   struct device_node *node = pdev->dev.of_node;
   const char *map_name;
   int ret;
   priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
   if (!priv) return -ENOMEM;
   priv->regmap = syscon_regmap_lookup_by_phandle(node, "hisilicon,power-syscon");
   if (IS_ERR(priv->regmap)) {
     dev_info(dev, "no power-reg\n");
     priv->regmap = NULL;
   }
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   priv->base = devm_ioremap_resource(dev, res);
   if (IS_ERR(priv->base)) return PTR_ERR(priv->base);
   priv->irq = platform_get_irq(pdev, 0);
   if (priv->irq < 0) {
     dev_err(dev, "irq can not get\n");
     return priv->irq;
   }
-  rdev = rc_allocate_device();
+  rdev = rc_allocate_device(RC_DRIVER_IR_RAW);
   if (!rdev) return -ENOMEM;
   priv->clock = devm_clk_get(dev, NULL);
   if (IS_ERR(priv->clock)) {
     dev_err(dev, "clock not found\n");
     ret = PTR_ERR(priv->clock);
     goto err;
   }
   clk_prepare_enable(priv->clock);
   priv->rate = clk_get_rate(priv->clock);
-  rdev->driver_type = RC_DRIVER_IR_RAW;
   rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
   rdev->priv = priv;
   rdev->open = hix5hd2_ir_open;
   rdev->close = hix5hd2_ir_close;
   rdev->driver_name = IR_HIX5HD2_NAME;
   map_name = of_get_property(node, "linux,rc-map-name", NULL);
   rdev->map_name = map_name ?: RC_MAP_EMPTY;
   rdev->input_name = IR_HIX5HD2_NAME;
   rdev->input_phys = IR_HIX5HD2_NAME "/input0";
   rdev->input_id.bustype = BUS_HOST;
   rdev->input_id.vendor = 0x0001;
   rdev->input_id.product = 0x0001;
   rdev->input_id.version = 0x0100;
   rdev->rx_resolution = US_TO_NS(10);
   rdev->timeout = US_TO_NS(IR_CFG_SYMBOL_MAXWIDTH * 10);
   ret = rc_register_device(rdev);
   if (ret < 0) goto clkerr;
   if (devm_request_irq(dev, priv->irq, hix5hd2_ir_rx_interrupt, 0, pdev->name, priv) < 0) {
     dev_err(dev, "IRQ %d register failed\n", priv->irq);
     ret = -EINVAL;
     goto regerr;
   }
   priv->rdev = rdev;
   priv->dev = dev;
   platform_set_drvdata(pdev, priv);
   return ret;
 regerr:
   rc_unregister_device(rdev);
   rdev = NULL;
 clkerr:
   clk_disable_unprepare(priv->clock);
 err:
   rc_free_device(rdev);
   dev_err(dev, "Unable to register device (%d)\n", ret);
   return ret;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;
--- initial
+++ final
@@ -1,42 +1,41 @@
 static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir) {
   struct usb_device *udev = ir->usbdev;
   struct device *dev = ir->dev;
   struct rc_dev *rc;
   int ret;
-  rc = rc_allocate_device();
+  rc = rc_allocate_device(RC_DRIVER_IR_RAW);
   if (!rc) {
     dev_err(dev, "remote dev allocation failed");
     goto out;
   }
   snprintf(ir->name, sizeof(ir->name), "%s (%04x:%04x)", mceusb_model[ir->model].name ? mceusb_model[ir->model].name : "Media Center Ed. eHome Infrared Remote Transceiver", le16_to_cpu(ir->usbdev->descriptor.idVendor), le16_to_cpu(ir->usbdev->descriptor.idProduct));
   usb_make_path(ir->usbdev, ir->phys, sizeof(ir->phys));
   rc->input_name = ir->name;
   rc->input_phys = ir->phys;
   usb_to_input_id(ir->usbdev, &rc->input_id);
   rc->dev.parent = dev;
   rc->priv = ir;
-  rc->driver_type = RC_DRIVER_IR_RAW;
   rc->allowed_protocols = RC_BIT_ALL_IR_DECODER;
   rc->timeout = MS_TO_NS(100);
   if (!ir->flags.no_tx) {
     rc->s_tx_mask = mceusb_set_tx_mask;
     rc->s_tx_carrier = mceusb_set_tx_carrier;
     rc->tx_ir = mceusb_tx_ir;
   }
   rc->driver_name = DRIVER_NAME;
   switch (le16_to_cpu(udev->descriptor.idVendor)) {
   case VENDOR_HAUPPAUGE: rc->map_name = RC_MAP_HAUPPAUGE; break;
   case VENDOR_PCTV: rc->map_name = RC_MAP_PINNACLE_PCTV_HD; break;
   default: rc->map_name = RC_MAP_RC6_MCE;
   }
   if (mceusb_model[ir->model].rc_map) rc->map_name = mceusb_model[ir->model].rc_map;
   ret = rc_register_device(rc);
   if (ret < 0) {
     dev_err(dev, "remote dev registration failed");
     goto out;
   }
   return rc;
 out:
   rc_free_device(rc);
   return NULL;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;
--- initial
+++ final
@@ -1,72 +1,71 @@
 static int meson_ir_probe(struct platform_device *pdev) {
   struct device *dev = &pdev->dev;
   struct device_node *node = dev->of_node;
   struct resource *res;
   const char *map_name;
   struct meson_ir *ir;
   int ret;
   ir = devm_kzalloc(dev, sizeof(struct meson_ir), GFP_KERNEL);
   if (!ir) return -ENOMEM;
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   ir->reg = devm_ioremap_resource(dev, res);
   if (IS_ERR(ir->reg)) {
     dev_err(dev, "failed to map registers\n");
     return PTR_ERR(ir->reg);
   }
   ir->irq = platform_get_irq(pdev, 0);
   if (ir->irq < 0) {
     dev_err(dev, "no irq resource\n");
     return ir->irq;
   }
-  ir->rc = rc_allocate_device();
+  ir->rc = rc_allocate_device(RC_DRIVER_IR_RAW);
   if (!ir->rc) {
     dev_err(dev, "failed to allocate rc device\n");
     return -ENOMEM;
   }
   ir->rc->priv = ir;
   ir->rc->input_name = DRIVER_NAME;
   ir->rc->input_phys = DRIVER_NAME "/input0";
   ir->rc->input_id.bustype = BUS_HOST;
   map_name = of_get_property(node, "linux,rc-map-name", NULL);
   ir->rc->map_name = map_name ? map_name : RC_MAP_EMPTY;
   ir->rc->dev.parent = dev;
-  ir->rc->driver_type = RC_DRIVER_IR_RAW;
   ir->rc->allowed_protocols = RC_BIT_ALL_IR_DECODER;
   ir->rc->rx_resolution = US_TO_NS(MESON_TRATE);
   ir->rc->timeout = MS_TO_NS(200);
   ir->rc->driver_name = DRIVER_NAME;
   spin_lock_init(&ir->lock);
   platform_set_drvdata(pdev, ir);
   ret = rc_register_device(ir->rc);
   if (ret) {
     dev_err(dev, "failed to register rc device\n");
     goto out_free;
   }
   ret = devm_request_irq(dev, ir->irq, meson_ir_irq, 0, "ir-meson", ir);
   if (ret) {
     dev_err(dev, "failed to request irq\n");
     goto out_unreg;
   }
   /* Reset the decoder */
   meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, REG1_RESET);
   meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, 0);
   /* Set general operation mode (= raw/software decoding) */
   if (of_device_is_compatible(node, "amlogic,meson6-ir"))
     meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK, DECODE_MODE_RAW << REG1_MODE_SHIFT);
   else
     meson_ir_set_mask(ir, IR_DEC_REG2, REG2_MODE_MASK, DECODE_MODE_RAW << REG2_MODE_SHIFT);
   /* Set rate */
   meson_ir_set_mask(ir, IR_DEC_REG0, REG0_RATE_MASK, MESON_TRATE - 1);
   /* IRQ on rising and falling edges */
   meson_ir_set_mask(ir, IR_DEC_REG1, REG1_IRQSEL_MASK, REG1_IRQSEL_RISE_FALL);
   /* Enable the decoder */
   meson_ir_set_mask(ir, IR_DEC_REG1, REG1_ENABLE, REG1_ENABLE);
   dev_info(dev, "receiver initialized\n");
   return 0;
 out_unreg:
   rc_unregister_device(ir->rc);
   ir->rc = NULL;
 out_free:
   rc_free_device(ir->rc);
   return ret;
 }<sep>@@
expression rdev,e;
@@
-       rdev = rc_allocate_device();
+       rdev = rc_allocate_device(e);
	...
-       rdev->driver_type      = e;