diff options
Diffstat (limited to 'drivers/net/wireless/spectrum_cs.c')
-rw-r--r-- | drivers/net/wireless/spectrum_cs.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c index 7a4a80b01f9c..be36679c8c95 100644 --- a/drivers/net/wireless/spectrum_cs.c +++ b/drivers/net/wireless/spectrum_cs.c | |||
@@ -63,7 +63,7 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket | |||
63 | /* PCMCIA specific device information (goes in the card field of | 63 | /* PCMCIA specific device information (goes in the card field of |
64 | * struct orinoco_private */ | 64 | * struct orinoco_private */ |
65 | struct orinoco_pccard { | 65 | struct orinoco_pccard { |
66 | dev_link_t link; | 66 | struct pcmcia_device *p_dev; |
67 | dev_node_t node; | 67 | dev_node_t node; |
68 | }; | 68 | }; |
69 | 69 | ||
@@ -554,12 +554,12 @@ static int | |||
554 | spectrum_cs_hard_reset(struct orinoco_private *priv) | 554 | spectrum_cs_hard_reset(struct orinoco_private *priv) |
555 | { | 555 | { |
556 | struct orinoco_pccard *card = priv->card; | 556 | struct orinoco_pccard *card = priv->card; |
557 | dev_link_t *link = &card->link; | 557 | dev_link_t *link = card->p_dev; |
558 | int err; | 558 | int err; |
559 | 559 | ||
560 | if (!hermes_present(&priv->hw)) { | 560 | if (!hermes_present(&priv->hw)) { |
561 | /* The firmware needs to be reloaded */ | 561 | /* The firmware needs to be reloaded */ |
562 | if (spectrum_dl_firmware(&priv->hw, &card->link) != 0) { | 562 | if (spectrum_dl_firmware(&priv->hw, link) != 0) { |
563 | printk(KERN_ERR PFX "Firmware download failed\n"); | 563 | printk(KERN_ERR PFX "Firmware download failed\n"); |
564 | err = -ENODEV; | 564 | err = -ENODEV; |
565 | } | 565 | } |
@@ -589,7 +589,7 @@ spectrum_cs_attach(struct pcmcia_device *p_dev) | |||
589 | struct net_device *dev; | 589 | struct net_device *dev; |
590 | struct orinoco_private *priv; | 590 | struct orinoco_private *priv; |
591 | struct orinoco_pccard *card; | 591 | struct orinoco_pccard *card; |
592 | dev_link_t *link; | 592 | dev_link_t *link = dev_to_instance(p_dev); |
593 | 593 | ||
594 | dev = alloc_orinocodev(sizeof(*card), spectrum_cs_hard_reset); | 594 | dev = alloc_orinocodev(sizeof(*card), spectrum_cs_hard_reset); |
595 | if (! dev) | 595 | if (! dev) |
@@ -598,7 +598,7 @@ spectrum_cs_attach(struct pcmcia_device *p_dev) | |||
598 | card = priv->card; | 598 | card = priv->card; |
599 | 599 | ||
600 | /* Link both structures together */ | 600 | /* Link both structures together */ |
601 | link = &card->link; | 601 | card->p_dev = p_dev; |
602 | link->priv = dev; | 602 | link->priv = dev; |
603 | 603 | ||
604 | /* Interrupt setup */ | 604 | /* Interrupt setup */ |
@@ -615,9 +615,6 @@ spectrum_cs_attach(struct pcmcia_device *p_dev) | |||
615 | link->conf.Attributes = 0; | 615 | link->conf.Attributes = 0; |
616 | link->conf.IntType = INT_MEMORY_AND_IO; | 616 | link->conf.IntType = INT_MEMORY_AND_IO; |
617 | 617 | ||
618 | link->handle = p_dev; | ||
619 | p_dev->instance = link; | ||
620 | |||
621 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 618 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
622 | spectrum_cs_config(link); | 619 | spectrum_cs_config(link); |
623 | 620 | ||
@@ -638,8 +635,8 @@ static void spectrum_cs_detach(struct pcmcia_device *p_dev) | |||
638 | if (link->state & DEV_CONFIG) | 635 | if (link->state & DEV_CONFIG) |
639 | spectrum_cs_release(link); | 636 | spectrum_cs_release(link); |
640 | 637 | ||
641 | DEBUG(0, PFX "detach: link=%p link->dev=%p\n", link, link->dev); | 638 | DEBUG(0, PFX "detach: link=%p link->dev_node=%p\n", link, link->dev_node); |
642 | if (link->dev) { | 639 | if (link->dev_node) { |
643 | DEBUG(0, PFX "About to unregister net device %p\n", | 640 | DEBUG(0, PFX "About to unregister net device %p\n", |
644 | dev); | 641 | dev); |
645 | unregister_netdev(dev); | 642 | unregister_netdev(dev); |
@@ -842,9 +839,9 @@ spectrum_cs_config(dev_link_t *link) | |||
842 | } | 839 | } |
843 | 840 | ||
844 | /* At this point, the dev_node_t structure(s) needs to be | 841 | /* At this point, the dev_node_t structure(s) needs to be |
845 | * initialized and arranged in a linked list at link->dev. */ | 842 | * initialized and arranged in a linked list at link->dev_node. */ |
846 | strcpy(card->node.dev_name, dev->name); | 843 | strcpy(card->node.dev_name, dev->name); |
847 | link->dev = &card->node; /* link->dev being non-NULL is also | 844 | link->dev_node = &card->node; /* link->dev_node being non-NULL is also |
848 | used to indicate that the | 845 | used to indicate that the |
849 | net_device has been registered */ | 846 | net_device has been registered */ |
850 | link->state &= ~DEV_CONFIG_PENDING; | 847 | link->state &= ~DEV_CONFIG_PENDING; |