diff options
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_cs.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 3b4e55cf33cd..055e9914db81 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c @@ -557,6 +557,7 @@ static int prism2_config(struct pcmcia_device *link) config_info_t conf; cistpl_cftable_entry_t dflt = { 0 }; struct hostap_cs_priv *hw_priv; + unsigned long flags; PDEBUG(DEBUG_FLOW, "prism2_config()\n"); @@ -688,6 +689,12 @@ static int prism2_config(struct pcmcia_device *link) link->dev_node = &hw_priv->node; /* + * Make sure the IRQ handler cannot proceed until at least + * dev->base_addr is initialized. + */ + spin_lock_irqsave(&local->irq_init_lock, flags); + + /* * Allocate an interrupt line. Note that this does not assign a * handler to the interrupt, unless the 'Handler' member of the * irq structure is initialized. @@ -712,6 +719,8 @@ static int prism2_config(struct pcmcia_device *link) dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; + spin_unlock_irqrestore(&local->irq_init_lock, flags); + /* Finally, report what we've done */ printk(KERN_INFO "%s: index 0x%02x: ", dev_info, link->conf.ConfigIndex); @@ -742,6 +751,7 @@ static int prism2_config(struct pcmcia_device *link) return ret; cs_failed: + spin_unlock_irqrestore(&local->irq_init_lock, flags); cs_error(link, last_fn, last_ret); failed: |