diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt61pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index a014c64f4275..77e8113b91e1 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2263,39 +2263,37 @@ static void rt61pci_wakeup(struct rt2x00_dev *rt2x00dev) | |||
2263 | static void rt61pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, | 2263 | static void rt61pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, |
2264 | struct rt2x00_field32 irq_field) | 2264 | struct rt2x00_field32 irq_field) |
2265 | { | 2265 | { |
2266 | unsigned long flags; | ||
2267 | u32 reg; | 2266 | u32 reg; |
2268 | 2267 | ||
2269 | /* | 2268 | /* |
2270 | * Enable a single interrupt. The interrupt mask register | 2269 | * Enable a single interrupt. The interrupt mask register |
2271 | * access needs locking. | 2270 | * access needs locking. |
2272 | */ | 2271 | */ |
2273 | spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); | 2272 | spin_lock_irq(&rt2x00dev->irqmask_lock); |
2274 | 2273 | ||
2275 | rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, ®); | 2274 | rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, ®); |
2276 | rt2x00_set_field32(®, irq_field, 0); | 2275 | rt2x00_set_field32(®, irq_field, 0); |
2277 | rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg); | 2276 | rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg); |
2278 | 2277 | ||
2279 | spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); | 2278 | spin_unlock_irq(&rt2x00dev->irqmask_lock); |
2280 | } | 2279 | } |
2281 | 2280 | ||
2282 | static void rt61pci_enable_mcu_interrupt(struct rt2x00_dev *rt2x00dev, | 2281 | static void rt61pci_enable_mcu_interrupt(struct rt2x00_dev *rt2x00dev, |
2283 | struct rt2x00_field32 irq_field) | 2282 | struct rt2x00_field32 irq_field) |
2284 | { | 2283 | { |
2285 | unsigned long flags; | ||
2286 | u32 reg; | 2284 | u32 reg; |
2287 | 2285 | ||
2288 | /* | 2286 | /* |
2289 | * Enable a single MCU interrupt. The interrupt mask register | 2287 | * Enable a single MCU interrupt. The interrupt mask register |
2290 | * access needs locking. | 2288 | * access needs locking. |
2291 | */ | 2289 | */ |
2292 | spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); | 2290 | spin_lock_irq(&rt2x00dev->irqmask_lock); |
2293 | 2291 | ||
2294 | rt2x00pci_register_read(rt2x00dev, MCU_INT_MASK_CSR, ®); | 2292 | rt2x00pci_register_read(rt2x00dev, MCU_INT_MASK_CSR, ®); |
2295 | rt2x00_set_field32(®, irq_field, 0); | 2293 | rt2x00_set_field32(®, irq_field, 0); |
2296 | rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg); | 2294 | rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg); |
2297 | 2295 | ||
2298 | spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); | 2296 | spin_unlock_irq(&rt2x00dev->irqmask_lock); |
2299 | } | 2297 | } |
2300 | 2298 | ||
2301 | static void rt61pci_txstatus_tasklet(unsigned long data) | 2299 | static void rt61pci_txstatus_tasklet(unsigned long data) |
@@ -2333,7 +2331,6 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance) | |||
2333 | struct rt2x00_dev *rt2x00dev = dev_instance; | 2331 | struct rt2x00_dev *rt2x00dev = dev_instance; |
2334 | u32 reg_mcu, mask_mcu; | 2332 | u32 reg_mcu, mask_mcu; |
2335 | u32 reg, mask; | 2333 | u32 reg, mask; |
2336 | unsigned long flags; | ||
2337 | 2334 | ||
2338 | /* | 2335 | /* |
2339 | * Get the interrupt sources & saved to local variable. | 2336 | * Get the interrupt sources & saved to local variable. |
@@ -2378,7 +2375,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance) | |||
2378 | * Disable all interrupts for which a tasklet was scheduled right now, | 2375 | * Disable all interrupts for which a tasklet was scheduled right now, |
2379 | * the tasklet will reenable the appropriate interrupts. | 2376 | * the tasklet will reenable the appropriate interrupts. |
2380 | */ | 2377 | */ |
2381 | spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); | 2378 | spin_lock(&rt2x00dev->irqmask_lock); |
2382 | 2379 | ||
2383 | rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, ®); | 2380 | rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, ®); |
2384 | reg |= mask; | 2381 | reg |= mask; |
@@ -2388,7 +2385,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance) | |||
2388 | reg |= mask_mcu; | 2385 | reg |= mask_mcu; |
2389 | rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg); | 2386 | rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg); |
2390 | 2387 | ||
2391 | spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); | 2388 | spin_unlock(&rt2x00dev->irqmask_lock); |
2392 | 2389 | ||
2393 | return IRQ_HANDLED; | 2390 | return IRQ_HANDLED; |
2394 | } | 2391 | } |