aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uio
diff options
context:
space:
mode:
authorHans J. Koch <hjk@hansjkoch.de>2011-08-09 14:53:41 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-22 20:52:00 -0400
commit4e0b72fd7444e07e2870d193ce8fb6b0b00f5a89 (patch)
treed81946567cef8109de9e95e64bee846f5986f13d /drivers/uio
parenta406f75840e15afbabd98cb64ae36b51424a8033 (diff)
uio: uio_pci_generic: Remove useless spin_lock
The spin_lock in uio_pci_generic.c is only used in the interrupt handler, which cannot be executed twice at the same time. That makes the lock rather pointless. This patch removes it. Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Chris Wright <chrisw@redhat.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Anthony Foiani <anthony.foiani@gmail.com> Reported-by: Anthony Foiani <anthony.foiani@gmail.com> Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Hans J. Koch <hjk@hansjkoch.de> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/uio')
-rw-r--r--drivers/uio/uio_pci_generic.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
index fc22e1e6f215..02bd47bdee1c 100644
--- a/drivers/uio/uio_pci_generic.c
+++ b/drivers/uio/uio_pci_generic.c
@@ -24,7 +24,6 @@
24#include <linux/pci.h> 24#include <linux/pci.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/uio_driver.h> 26#include <linux/uio_driver.h>
27#include <linux/spinlock.h>
28 27
29#define DRIVER_VERSION "0.01.0" 28#define DRIVER_VERSION "0.01.0"
30#define DRIVER_AUTHOR "Michael S. Tsirkin <mst@redhat.com>" 29#define DRIVER_AUTHOR "Michael S. Tsirkin <mst@redhat.com>"
@@ -33,7 +32,6 @@
33struct uio_pci_generic_dev { 32struct uio_pci_generic_dev {
34 struct uio_info info; 33 struct uio_info info;
35 struct pci_dev *pdev; 34 struct pci_dev *pdev;
36 spinlock_t lock; /* guards command register accesses */
37}; 35};
38 36
39static inline struct uio_pci_generic_dev * 37static inline struct uio_pci_generic_dev *
@@ -57,7 +55,6 @@ static irqreturn_t irqhandler(int irq, struct uio_info *info)
57 BUILD_BUG_ON(PCI_COMMAND % 4); 55 BUILD_BUG_ON(PCI_COMMAND % 4);
58 BUILD_BUG_ON(PCI_COMMAND + 2 != PCI_STATUS); 56 BUILD_BUG_ON(PCI_COMMAND + 2 != PCI_STATUS);
59 57
60 spin_lock_irq(&gdev->lock);
61 pci_block_user_cfg_access(pdev); 58 pci_block_user_cfg_access(pdev);
62 59
63 /* Read both command and status registers in a single 32-bit operation. 60 /* Read both command and status registers in a single 32-bit operation.
@@ -83,7 +80,6 @@ static irqreturn_t irqhandler(int irq, struct uio_info *info)
83done: 80done:
84 81
85 pci_unblock_user_cfg_access(pdev); 82 pci_unblock_user_cfg_access(pdev);
86 spin_unlock_irq(&gdev->lock);
87 return ret; 83 return ret;
88} 84}
89 85
@@ -158,7 +154,6 @@ static int __devinit probe(struct pci_dev *pdev,
158 gdev->info.irq_flags = IRQF_SHARED; 154 gdev->info.irq_flags = IRQF_SHARED;
159 gdev->info.handler = irqhandler; 155 gdev->info.handler = irqhandler;
160 gdev->pdev = pdev; 156 gdev->pdev = pdev;
161 spin_lock_init(&gdev->lock);
162 157
163 if (uio_register_device(&pdev->dev, &gdev->info)) 158 if (uio_register_device(&pdev->dev, &gdev->info))
164 goto err_register; 159 goto err_register;