igb_uio: convert license header to SPDX tag
[dpdk.git] / lib / librte_eal / linuxapp / igb_uio / igb_uio.c
index 3884448..7f2b4c8 100644 (file)
@@ -1,25 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*-
- * GPL LICENSE SUMMARY
- *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of version 2 of the GNU General Public License as
- *   published by the Free Software Foundation.
- *
- *   This program is distributed in the hope that it will be useful, but
- *   WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *   General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *   The full GNU General Public License is included in this distribution
- *   in the file called LICENSE.GPL.
- *
- *   Contact Information:
- *   Intel Corporation
+ * Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -209,9 +190,8 @@ igbuio_pci_irqcontrol(struct uio_info *info, s32 irq_state)
 static irqreturn_t
 igbuio_pci_irqhandler(int irq, void *dev_id)
 {
-       struct uio_device *idev = (struct uio_device *)dev_id;
-       struct uio_info *info = idev->info;
-       struct rte_uio_pci_dev *udev = info->priv;
+       struct rte_uio_pci_dev *udev = (struct rte_uio_pci_dev *)dev_id;
+       struct uio_info *info = &udev->info;
 
        /* Legacy mode need to mask in hardware */
        if (udev->mode == RTE_INTR_MODE_LEGACY &&
@@ -299,7 +279,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
        if (udev->info.irq != UIO_IRQ_NONE)
                err = request_irq(udev->info.irq, igbuio_pci_irqhandler,
                                  udev->info.irq_flags, udev->info.name,
-                                 udev->info.uio_dev);
+                                 udev);
        dev_info(&udev->pdev->dev, "uio device registered with irq %lx\n",
                 udev->info.irq);
 
@@ -310,7 +290,7 @@ static void
 igbuio_pci_disable_interrupts(struct rte_uio_pci_dev *udev)
 {
        if (udev->info.irq) {
-               free_irq(udev->info.irq, udev->info.uio_dev);
+               free_irq(udev->info.irq, udev);
                udev->info.irq = 0;
        }
 
@@ -337,8 +317,6 @@ igbuio_pci_open(struct uio_info *info, struct inode *inode)
        struct pci_dev *dev = udev->pdev;
        int err;
 
-       pci_reset_function(dev);
-
        /* set bus master, which was cleared by the reset function */
        pci_set_master(dev);
 
@@ -363,8 +341,6 @@ igbuio_pci_release(struct uio_info *info, struct inode *inode)
        /* stop the device from further DMA */
        pci_clear_master(dev);
 
-       pci_reset_function(dev);
-
        return 0;
 }