--- initial
+++ final
@@ -1,91 +1,90 @@
 static int via_ircc_open(struct pci_dev *pdev, chipio_t *info, unsigned int id) {
   struct net_device *dev;
   struct via_ircc_cb *self;
   int err;
   IRDA_DEBUG(3, "%s()\n", __func__);
   /* Allocate new instance of the driver */
   dev = alloc_irdadev(sizeof(struct via_ircc_cb));
   if (dev == NULL) return -ENOMEM;
   self = netdev_priv(dev);
   self->netdev = dev;
   spin_lock_init(&self->lock);
   pci_set_drvdata(pdev, self);
   /* Initialize Resource */
   self->io.cfg_base = info->cfg_base;
   self->io.fir_base = info->fir_base;
   self->io.irq = info->irq;
   self->io.fir_ext = CHIP_IO_EXTENT;
   self->io.dma = info->dma;
   self->io.dma2 = info->dma2;
   self->io.fifo_size = 32;
   self->chip_id = id;
   self->st_fifo.len = 0;
   self->RxDataReady = 0;
   /* Reserve the ioports that we need */
   if (!request_region(self->io.fir_base, self->io.fir_ext, driver_name)) {
     IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n", __func__, self->io.fir_base);
     err = -ENODEV;
     goto err_out1;
   }
 
   /* Initialize QoS for this device */
   irda_init_max_qos_capabilies(&self->qos);
   /* Check if user has supplied the dongle id or not */
   if (!dongle_id) dongle_id = via_ircc_read_dongle_id(self->io.fir_base);
   self->io.dongle_id = dongle_id;
   /* The only value we must override it the baudrate */
   /* Maximum speeds and capabilities are dongle-dependent. */
   switch (self->io.dongle_id) {
   case 0x0d: self->qos.baud_rate.bits = IR_9600 | IR_19200 | IR_38400 | IR_57600 | IR_115200 | IR_576000 | IR_1152000 | (IR_4000000 << 8); break;
   default: self->qos.baud_rate.bits = IR_9600 | IR_19200 | IR_38400 | IR_57600 | IR_115200; break;
   }
   /* Following was used for testing:
    *
    *   self->qos.baud_rate.bits = IR_9600;
    *
    * Is is no good, as it prohibits (error-prone) speed-changes.
    */
   self->qos.min_turn_time.bits = qos_mtt_bits;
   irda_qos_bits_to_value(&self->qos);
   /* Max DMA buffer size needed = (data_size + 6) * (window_size) + 6; */
   self->rx_buff.truesize = 14384 + 2048;
   self->tx_buff.truesize = 14384 + 2048;
   /* Allocate memory if needed */
   self->rx_buff.head = dma_zalloc_coherent(&pdev->dev, self->rx_buff.truesize, &self->rx_buff_dma, GFP_KERNEL);
   if (self->rx_buff.head == NULL) {
     err = -ENOMEM;
     goto err_out2;
   }
   self->tx_buff.head = dma_zalloc_coherent(&pdev->dev, self->tx_buff.truesize, &self->tx_buff_dma, GFP_KERNEL);
   if (self->tx_buff.head == NULL) {
     err = -ENOMEM;
     goto err_out3;
   }
   self->rx_buff.in_frame = FALSE;
   self->rx_buff.state = OUTSIDE_FRAME;
   self->tx_buff.data = self->tx_buff.head;
   self->rx_buff.data = self->rx_buff.head;
   /* Reset Tx queue info */
   self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0;
   self->tx_fifo.tail = self->tx_buff.head;
   /* Override the network functions we need to use */
   dev->netdev_ops = &via_ircc_sir_ops;
   err = register_netdev(dev);
   if (err) goto err_out4;
   IRDA_MESSAGE("IrDA: Registered device %s (via-ircc)\n", dev->name);
   /* Initialise the hardware..
    */
   self->io.speed = 9600;
   via_hw_init(self);
   return 0;
 err_out4:
   dma_free_coherent(&pdev->dev, self->tx_buff.truesize, self->tx_buff.head, self->tx_buff_dma);
 err_out3:
   dma_free_coherent(&pdev->dev, self->rx_buff.truesize, self->rx_buff.head, self->rx_buff_dma);
 err_out2:
   release_region(self->io.fir_base, self->io.fir_ext);
 err_out1:
-  pci_set_drvdata(pdev, NULL);
   free_netdev(dev);
   return err;
 }<sep>@@
expression pci;
@@

- pci_set_drvdata(pci, NULL);