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/serial/serial_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/serial/serial_cs.c')
-rw-r--r-- | drivers/serial/serial_cs.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index ff38820a03f5..b6b460fa693f 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c | |||
@@ -151,7 +151,6 @@ static void serial_remove(dev_link_t *link) | |||
151 | static int serial_suspend(struct pcmcia_device *dev) | 151 | static int serial_suspend(struct pcmcia_device *dev) |
152 | { | 152 | { |
153 | dev_link_t *link = dev_to_instance(dev); | 153 | dev_link_t *link = dev_to_instance(dev); |
154 | link->state |= DEV_SUSPEND; | ||
155 | 154 | ||
156 | if (link->state & DEV_CONFIG) { | 155 | if (link->state & DEV_CONFIG) { |
157 | struct serial_info *info = link->priv; | 156 | struct serial_info *info = link->priv; |
@@ -160,8 +159,8 @@ static int serial_suspend(struct pcmcia_device *dev) | |||
160 | for (i = 0; i < info->ndev; i++) | 159 | for (i = 0; i < info->ndev; i++) |
161 | serial8250_suspend_port(info->line[i]); | 160 | serial8250_suspend_port(info->line[i]); |
162 | 161 | ||
163 | if (!info->slave) | 162 | if (info->slave) |
164 | pcmcia_release_configuration(link->handle); | 163 | link->state &= DEV_SUSPEND_NORELEASE; |
165 | } | 164 | } |
166 | 165 | ||
167 | return 0; | 166 | return 0; |
@@ -170,15 +169,11 @@ static int serial_suspend(struct pcmcia_device *dev) | |||
170 | static int serial_resume(struct pcmcia_device *dev) | 169 | static int serial_resume(struct pcmcia_device *dev) |
171 | { | 170 | { |
172 | dev_link_t *link = dev_to_instance(dev); | 171 | dev_link_t *link = dev_to_instance(dev); |
173 | link->state &= ~DEV_SUSPEND; | ||
174 | 172 | ||
175 | if (DEV_OK(link)) { | 173 | if (DEV_OK(link)) { |
176 | struct serial_info *info = link->priv; | 174 | struct serial_info *info = link->priv; |
177 | int i; | 175 | int i; |
178 | 176 | ||
179 | if (!info->slave) | ||
180 | pcmcia_request_configuration(link->handle, &link->conf); | ||
181 | |||
182 | for (i = 0; i < info->ndev; i++) | 177 | for (i = 0; i < info->ndev; i++) |
183 | serial8250_resume_port(info->line[i]); | 178 | serial8250_resume_port(info->line[i]); |
184 | } | 179 | } |