diff options
Diffstat (limited to 'sound/pcmcia/pdaudiocf/pdaudiocf.c')
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index b4158201e9e6..0431b8b0c1f5 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c | |||
@@ -57,12 +57,12 @@ static struct snd_card *card_list[SNDRV_CARDS]; | |||
57 | /* | 57 | /* |
58 | * prototypes | 58 | * prototypes |
59 | */ | 59 | */ |
60 | static void pdacf_config(dev_link_t *link); | 60 | static void pdacf_config(struct pcmcia_device *link); |
61 | static void snd_pdacf_detach(struct pcmcia_device *p_dev); | 61 | static void snd_pdacf_detach(struct pcmcia_device *p_dev); |
62 | 62 | ||
63 | static void pdacf_release(dev_link_t *link) | 63 | static void pdacf_release(struct pcmcia_device *link) |
64 | { | 64 | { |
65 | pcmcia_disable_device(link->handle); | 65 | pcmcia_disable_device(link); |
66 | } | 66 | } |
67 | 67 | ||
68 | /* | 68 | /* |
@@ -70,7 +70,7 @@ static void pdacf_release(dev_link_t *link) | |||
70 | */ | 70 | */ |
71 | static int snd_pdacf_free(struct snd_pdacf *pdacf) | 71 | static int snd_pdacf_free(struct snd_pdacf *pdacf) |
72 | { | 72 | { |
73 | dev_link_t *link = pdacf->p_dev; | 73 | struct pcmcia_device *link = pdacf->p_dev; |
74 | 74 | ||
75 | pdacf_release(link); | 75 | pdacf_release(link); |
76 | 76 | ||
@@ -90,18 +90,15 @@ static int snd_pdacf_dev_free(struct snd_device *device) | |||
90 | /* | 90 | /* |
91 | * snd_pdacf_attach - attach callback for cs | 91 | * snd_pdacf_attach - attach callback for cs |
92 | */ | 92 | */ |
93 | static int snd_pdacf_attach(struct pcmcia_device *p_dev) | 93 | static int snd_pdacf_attach(struct pcmcia_device *link) |
94 | { | 94 | { |
95 | int i; | 95 | int i; |
96 | dev_link_t *link; /* Info for cardmgr */ | ||
97 | struct snd_pdacf *pdacf; | 96 | struct snd_pdacf *pdacf; |
98 | struct snd_card *card; | 97 | struct snd_card *card; |
99 | static struct snd_device_ops ops = { | 98 | static struct snd_device_ops ops = { |
100 | .dev_free = snd_pdacf_dev_free, | 99 | .dev_free = snd_pdacf_dev_free, |
101 | }; | 100 | }; |
102 | 101 | ||
103 | link = dev_to_instance(p_dev); | ||
104 | |||
105 | snd_printdd(KERN_DEBUG "pdacf_attach called\n"); | 102 | snd_printdd(KERN_DEBUG "pdacf_attach called\n"); |
106 | /* find an empty slot from the card list */ | 103 | /* find an empty slot from the card list */ |
107 | for (i = 0; i < SNDRV_CARDS; i++) { | 104 | for (i = 0; i < SNDRV_CARDS; i++) { |
@@ -135,7 +132,7 @@ static int snd_pdacf_attach(struct pcmcia_device *p_dev) | |||
135 | pdacf->index = i; | 132 | pdacf->index = i; |
136 | card_list[i] = card; | 133 | card_list[i] = card; |
137 | 134 | ||
138 | pdacf->p_dev = p_dev; | 135 | pdacf->p_dev = link; |
139 | link->priv = pdacf; | 136 | link->priv = pdacf; |
140 | 137 | ||
141 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 138 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
@@ -201,9 +198,8 @@ static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irq | |||
201 | /* | 198 | /* |
202 | * snd_pdacf_detach - detach callback for cs | 199 | * snd_pdacf_detach - detach callback for cs |
203 | */ | 200 | */ |
204 | static void snd_pdacf_detach(struct pcmcia_device *p_dev) | 201 | static void snd_pdacf_detach(struct pcmcia_device *link) |
205 | { | 202 | { |
206 | dev_link_t *link = dev_to_instance(p_dev); | ||
207 | struct snd_pdacf *chip = link->priv; | 203 | struct snd_pdacf *chip = link->priv; |
208 | 204 | ||
209 | snd_printdd(KERN_DEBUG "pdacf_detach called\n"); | 205 | snd_printdd(KERN_DEBUG "pdacf_detach called\n"); |
@@ -222,9 +218,8 @@ static void snd_pdacf_detach(struct pcmcia_device *p_dev) | |||
222 | #define CS_CHECK(fn, ret) \ | 218 | #define CS_CHECK(fn, ret) \ |
223 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 219 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
224 | 220 | ||
225 | static void pdacf_config(dev_link_t *link) | 221 | static void pdacf_config(struct pcmcia_device *link) |
226 | { | 222 | { |
227 | client_handle_t handle = link->handle; | ||
228 | struct snd_pdacf *pdacf = link->priv; | 223 | struct snd_pdacf *pdacf = link->priv; |
229 | tuple_t tuple; | 224 | tuple_t tuple; |
230 | cisparse_t *parse = NULL; | 225 | cisparse_t *parse = NULL; |
@@ -243,9 +238,9 @@ static void pdacf_config(dev_link_t *link) | |||
243 | tuple.TupleDataMax = sizeof(buf); | 238 | tuple.TupleDataMax = sizeof(buf); |
244 | tuple.TupleOffset = 0; | 239 | tuple.TupleOffset = 0; |
245 | tuple.DesiredTuple = CISTPL_CONFIG; | 240 | tuple.DesiredTuple = CISTPL_CONFIG; |
246 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); | 241 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
247 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); | 242 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); |
248 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, parse)); | 243 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse)); |
249 | link->conf.ConfigBase = parse->config.base; | 244 | link->conf.ConfigBase = parse->config.base; |
250 | link->conf.ConfigIndex = 0x5; | 245 | link->conf.ConfigIndex = 0x5; |
251 | kfree(parse); | 246 | kfree(parse); |
@@ -253,9 +248,9 @@ static void pdacf_config(dev_link_t *link) | |||
253 | /* Configure card */ | 248 | /* Configure card */ |
254 | link->state |= DEV_CONFIG; | 249 | link->state |= DEV_CONFIG; |
255 | 250 | ||
256 | CS_CHECK(RequestIO, pcmcia_request_io(handle, &link->io)); | 251 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); |
257 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); | 252 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); |
258 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); | 253 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); |
259 | 254 | ||
260 | if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) | 255 | if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) |
261 | goto failed; | 256 | goto failed; |
@@ -265,16 +260,15 @@ static void pdacf_config(dev_link_t *link) | |||
265 | return; | 260 | return; |
266 | 261 | ||
267 | cs_failed: | 262 | cs_failed: |
268 | cs_error(link->handle, last_fn, last_ret); | 263 | cs_error(link, last_fn, last_ret); |
269 | failed: | 264 | failed: |
270 | pcmcia_disable_device(link->handle); | 265 | pcmcia_disable_device(link); |
271 | } | 266 | } |
272 | 267 | ||
273 | #ifdef CONFIG_PM | 268 | #ifdef CONFIG_PM |
274 | 269 | ||
275 | static int pdacf_suspend(struct pcmcia_device *dev) | 270 | static int pdacf_suspend(struct pcmcia_device *link) |
276 | { | 271 | { |
277 | dev_link_t *link = dev_to_instance(dev); | ||
278 | struct snd_pdacf *chip = link->priv; | 272 | struct snd_pdacf *chip = link->priv; |
279 | 273 | ||
280 | snd_printdd(KERN_DEBUG "SUSPEND\n"); | 274 | snd_printdd(KERN_DEBUG "SUSPEND\n"); |
@@ -286,9 +280,8 @@ static int pdacf_suspend(struct pcmcia_device *dev) | |||
286 | return 0; | 280 | return 0; |
287 | } | 281 | } |
288 | 282 | ||
289 | static int pdacf_resume(struct pcmcia_device *dev) | 283 | static int pdacf_resume(struct pcmcia_device *link) |
290 | { | 284 | { |
291 | dev_link_t *link = dev_to_instance(dev); | ||
292 | struct snd_pdacf *chip = link->priv; | 285 | struct snd_pdacf *chip = link->priv; |
293 | 286 | ||
294 | snd_printdd(KERN_DEBUG "RESUME\n"); | 287 | snd_printdd(KERN_DEBUG "RESUME\n"); |