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/wireless/ray_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/wireless/ray_cs.c')
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index fc81ac67009d..ed4bf5013f1a 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -868,14 +868,8 @@ static int ray_suspend(struct pcmcia_device *p_dev) | |||
868 | dev_link_t *link = dev_to_instance(p_dev); | 868 | dev_link_t *link = dev_to_instance(p_dev); |
869 | struct net_device *dev = link->priv; | 869 | struct net_device *dev = link->priv; |
870 | 870 | ||
871 | link->state |= DEV_SUSPEND; | 871 | if ((link->state & DEV_CONFIG) && (link->open)) |
872 | if (link->state & DEV_CONFIG) { | 872 | netif_device_detach(dev); |
873 | if (link->open) | ||
874 | netif_device_detach(dev); | ||
875 | |||
876 | pcmcia_release_configuration(link->handle); | ||
877 | } | ||
878 | |||
879 | 873 | ||
880 | return 0; | 874 | return 0; |
881 | } | 875 | } |
@@ -885,14 +879,10 @@ static int ray_resume(struct pcmcia_device *p_dev) | |||
885 | dev_link_t *link = dev_to_instance(p_dev); | 879 | dev_link_t *link = dev_to_instance(p_dev); |
886 | struct net_device *dev = link->priv; | 880 | struct net_device *dev = link->priv; |
887 | 881 | ||
888 | link->state &= ~DEV_SUSPEND; | 882 | if ((link->state & DEV_CONFIG) && (link->open)) { |
889 | if (link->state & DEV_CONFIG) { | 883 | ray_reset(dev); |
890 | pcmcia_request_configuration(link->handle, &link->conf); | 884 | netif_device_attach(dev); |
891 | if (link->open) { | 885 | } |
892 | ray_reset(dev); | ||
893 | netif_device_attach(dev); | ||
894 | } | ||
895 | } | ||
896 | 886 | ||
897 | return 0; | 887 | return 0; |
898 | } | 888 | } |