diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-01 18:02:33 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:15:52 -0500 |
commit | 8661bb5b4af1849c1f5a4e80c4e275fd13c155d6 (patch) | |
tree | ad99d85ea8d6f5c4c99b93f869bfd412994fb4ee /drivers/net/pcmcia/pcnet_cs.c | |
parent | 50db3fdbbc98260fb538c1cc3f8cc597ba7bffe7 (diff) |
[PATCH] pcmcia: default suspend and resume handling
In all but one case, the suspend and resume functions of PCMCIA drivers
contain mostly of calls to pcmcia_release_configuration() and
pcmcia_request_configuration(). Therefore, move this code out of the
drivers and into the core.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia/pcnet_cs.c')
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 52f44bdff1f7..3a2b731eeb3c 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -756,12 +756,8 @@ static int pcnet_suspend(struct pcmcia_device *p_dev) | |||
756 | dev_link_t *link = dev_to_instance(p_dev); | 756 | dev_link_t *link = dev_to_instance(p_dev); |
757 | struct net_device *dev = link->priv; | 757 | struct net_device *dev = link->priv; |
758 | 758 | ||
759 | link->state |= DEV_SUSPEND; | 759 | if ((link->state & DEV_CONFIG) && (link->open)) |
760 | if (link->state & DEV_CONFIG) { | 760 | netif_device_detach(dev); |
761 | if (link->open) | ||
762 | netif_device_detach(dev); | ||
763 | pcmcia_release_configuration(link->handle); | ||
764 | } | ||
765 | 761 | ||
766 | return 0; | 762 | return 0; |
767 | } | 763 | } |
@@ -771,14 +767,10 @@ static int pcnet_resume(struct pcmcia_device *p_dev) | |||
771 | dev_link_t *link = dev_to_instance(p_dev); | 767 | dev_link_t *link = dev_to_instance(p_dev); |
772 | struct net_device *dev = link->priv; | 768 | struct net_device *dev = link->priv; |
773 | 769 | ||
774 | link->state &= ~DEV_SUSPEND; | 770 | if ((link->state & DEV_CONFIG) && (link->open)) { |
775 | if (link->state & DEV_CONFIG) { | 771 | pcnet_reset_8390(dev); |
776 | pcmcia_request_configuration(link->handle, &link->conf); | 772 | NS8390_init(dev, 1); |
777 | if (link->open) { | 773 | netif_device_attach(dev); |
778 | pcnet_reset_8390(dev); | ||
779 | NS8390_init(dev, 1); | ||
780 | netif_device_attach(dev); | ||
781 | } | ||
782 | } | 774 | } |
783 | 775 | ||
784 | return 0; | 776 | return 0; |