diff options
Diffstat (limited to 'drivers/uio')
-rw-r--r-- | drivers/uio/uio_pci_generic.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c index 02bd47bdee1c..56d00c6258f0 100644 --- a/drivers/uio/uio_pci_generic.c +++ b/drivers/uio/uio_pci_generic.c | |||
@@ -55,7 +55,8 @@ static irqreturn_t irqhandler(int irq, struct uio_info *info) | |||
55 | BUILD_BUG_ON(PCI_COMMAND % 4); | 55 | BUILD_BUG_ON(PCI_COMMAND % 4); |
56 | BUILD_BUG_ON(PCI_COMMAND + 2 != PCI_STATUS); | 56 | BUILD_BUG_ON(PCI_COMMAND + 2 != PCI_STATUS); |
57 | 57 | ||
58 | pci_block_user_cfg_access(pdev); | 58 | if (!pci_cfg_access_trylock(pdev)) |
59 | goto error; | ||
59 | 60 | ||
60 | /* Read both command and status registers in a single 32-bit operation. | 61 | /* Read both command and status registers in a single 32-bit operation. |
61 | * Note: we could cache the value for command and move the status read | 62 | * Note: we could cache the value for command and move the status read |
@@ -79,7 +80,7 @@ static irqreturn_t irqhandler(int irq, struct uio_info *info) | |||
79 | ret = IRQ_HANDLED; | 80 | ret = IRQ_HANDLED; |
80 | done: | 81 | done: |
81 | 82 | ||
82 | pci_unblock_user_cfg_access(pdev); | 83 | pci_cfg_access_lock(pdev); |
83 | return ret; | 84 | return ret; |
84 | } | 85 | } |
85 | 86 | ||
@@ -91,7 +92,7 @@ static int __devinit verify_pci_2_3(struct pci_dev *pdev) | |||
91 | u16 orig, new; | 92 | u16 orig, new; |
92 | int err = 0; | 93 | int err = 0; |
93 | 94 | ||
94 | pci_block_user_cfg_access(pdev); | 95 | pci_cfg_access_lock(pdev); |
95 | pci_read_config_word(pdev, PCI_COMMAND, &orig); | 96 | pci_read_config_word(pdev, PCI_COMMAND, &orig); |
96 | pci_write_config_word(pdev, PCI_COMMAND, | 97 | pci_write_config_word(pdev, PCI_COMMAND, |
97 | orig ^ PCI_COMMAND_INTX_DISABLE); | 98 | orig ^ PCI_COMMAND_INTX_DISABLE); |
@@ -114,7 +115,7 @@ static int __devinit verify_pci_2_3(struct pci_dev *pdev) | |||
114 | /* Now restore the original value. */ | 115 | /* Now restore the original value. */ |
115 | pci_write_config_word(pdev, PCI_COMMAND, orig); | 116 | pci_write_config_word(pdev, PCI_COMMAND, orig); |
116 | err: | 117 | err: |
117 | pci_unblock_user_cfg_access(pdev); | 118 | pci_cfg_access_unlock(pdev); |
118 | return err; | 119 | return err; |
119 | } | 120 | } |
120 | 121 | ||