diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-05 04:45:09 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:15:57 -0500 |
commit | fd238232cd0ff4840ae6946bb338502154096d88 (patch) | |
tree | d20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /sound | |
parent | a78f4dd331a4f6a396eb5849656a4a72a70a56d7 (diff) |
[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the
same entity. The actual contents of dev_link_t will be cleaned up step by step.
This patch includes a bugfix from and signed-off-by Andrew Morton.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.c | 12 | ||||
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.h | 2 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxpocket.c | 20 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxpocket.h | 2 |
4 files changed, 17 insertions, 19 deletions
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 7c4091a57b69..b4158201e9e6 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c | |||
@@ -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->link; | 73 | dev_link_t *link = pdacf->p_dev; |
74 | 74 | ||
75 | pdacf_release(link); | 75 | pdacf_release(link); |
76 | 76 | ||
@@ -100,6 +100,8 @@ static int snd_pdacf_attach(struct pcmcia_device *p_dev) | |||
100 | .dev_free = snd_pdacf_dev_free, | 100 | .dev_free = snd_pdacf_dev_free, |
101 | }; | 101 | }; |
102 | 102 | ||
103 | link = dev_to_instance(p_dev); | ||
104 | |||
103 | snd_printdd(KERN_DEBUG "pdacf_attach called\n"); | 105 | snd_printdd(KERN_DEBUG "pdacf_attach called\n"); |
104 | /* find an empty slot from the card list */ | 106 | /* find an empty slot from the card list */ |
105 | for (i = 0; i < SNDRV_CARDS; i++) { | 107 | for (i = 0; i < SNDRV_CARDS; i++) { |
@@ -133,7 +135,7 @@ static int snd_pdacf_attach(struct pcmcia_device *p_dev) | |||
133 | pdacf->index = i; | 135 | pdacf->index = i; |
134 | card_list[i] = card; | 136 | card_list[i] = card; |
135 | 137 | ||
136 | link = &pdacf->link; | 138 | pdacf->p_dev = p_dev; |
137 | link->priv = pdacf; | 139 | link->priv = pdacf; |
138 | 140 | ||
139 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 141 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
@@ -150,10 +152,6 @@ static int snd_pdacf_attach(struct pcmcia_device *p_dev) | |||
150 | link->conf.ConfigIndex = 1; | 152 | link->conf.ConfigIndex = 1; |
151 | link->conf.Present = PRESENT_OPTION; | 153 | link->conf.Present = PRESENT_OPTION; |
152 | 154 | ||
153 | /* Chain drivers */ | ||
154 | link->next = NULL; | ||
155 | |||
156 | link->handle = p_dev; | ||
157 | pdacf_config(link); | 155 | pdacf_config(link); |
158 | 156 | ||
159 | return 0; | 157 | return 0; |
@@ -262,7 +260,7 @@ static void pdacf_config(dev_link_t *link) | |||
262 | if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) | 260 | if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) |
263 | goto failed; | 261 | goto failed; |
264 | 262 | ||
265 | link->dev = &pdacf->node; | 263 | link->dev_node = &pdacf->node; |
266 | link->state &= ~DEV_CONFIG_PENDING; | 264 | link->state &= ~DEV_CONFIG_PENDING; |
267 | return; | 265 | return; |
268 | 266 | ||
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h index 2744f189a613..9a14a4f64bd3 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.h +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h | |||
@@ -116,7 +116,7 @@ struct snd_pdacf { | |||
116 | void *pcm_area; | 116 | void *pcm_area; |
117 | 117 | ||
118 | /* pcmcia stuff */ | 118 | /* pcmcia stuff */ |
119 | dev_link_t link; | 119 | struct pcmcia_device *p_dev; |
120 | dev_node_t node; | 120 | dev_node_t node; |
121 | }; | 121 | }; |
122 | 122 | ||
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index ff2f927559fc..87ec48c6af28 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
@@ -126,7 +126,8 @@ static struct snd_vx_hardware vxp440_hw = { | |||
126 | /* | 126 | /* |
127 | * create vxpocket instance | 127 | * create vxpocket instance |
128 | */ | 128 | */ |
129 | static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl) | 129 | static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl, |
130 | struct pcmcia_device *p_dev) | ||
130 | { | 131 | { |
131 | dev_link_t *link; /* Info for cardmgr */ | 132 | dev_link_t *link; /* Info for cardmgr */ |
132 | struct vx_core *chip; | 133 | struct vx_core *chip; |
@@ -135,6 +136,8 @@ static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl) | |||
135 | .dev_free = snd_vxpocket_dev_free, | 136 | .dev_free = snd_vxpocket_dev_free, |
136 | }; | 137 | }; |
137 | 138 | ||
139 | link = dev_to_instance(p_dev); | ||
140 | |||
138 | chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops, | 141 | chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops, |
139 | sizeof(struct snd_vxpocket) - sizeof(struct vx_core)); | 142 | sizeof(struct snd_vxpocket) - sizeof(struct vx_core)); |
140 | if (! chip) | 143 | if (! chip) |
@@ -148,7 +151,7 @@ static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl) | |||
148 | 151 | ||
149 | vxp = (struct snd_vxpocket *)chip; | 152 | vxp = (struct snd_vxpocket *)chip; |
150 | 153 | ||
151 | link = &vxp->link; | 154 | vxp->p_dev = p_dev; |
152 | link->priv = chip; | 155 | link->priv = chip; |
153 | 156 | ||
154 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 157 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
@@ -263,7 +266,7 @@ static void vxpocket_config(dev_link_t *link) | |||
263 | if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0) | 266 | if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0) |
264 | goto failed; | 267 | goto failed; |
265 | 268 | ||
266 | link->dev = &vxp->node; | 269 | link->dev_node = &vxp->node; |
267 | link->state &= ~DEV_CONFIG_PENDING; | 270 | link->state &= ~DEV_CONFIG_PENDING; |
268 | kfree(parse); | 271 | kfree(parse); |
269 | return; | 272 | return; |
@@ -339,7 +342,7 @@ static int vxpocket_attach(struct pcmcia_device *p_dev) | |||
339 | return -ENOMEM; | 342 | return -ENOMEM; |
340 | } | 343 | } |
341 | 344 | ||
342 | vxp = snd_vxpocket_new(card, ibl[i]); | 345 | vxp = snd_vxpocket_new(card, ibl[i], p_dev); |
343 | if (! vxp) { | 346 | if (! vxp) { |
344 | snd_card_free(card); | 347 | snd_card_free(card); |
345 | return -ENODEV; | 348 | return -ENODEV; |
@@ -349,13 +352,10 @@ static int vxpocket_attach(struct pcmcia_device *p_dev) | |||
349 | vxp->index = i; | 352 | vxp->index = i; |
350 | card_alloc |= 1 << i; | 353 | card_alloc |= 1 << i; |
351 | 354 | ||
352 | /* Chain drivers */ | 355 | vxp->p_dev = p_dev; |
353 | vxp->link.next = NULL; | 356 | vxp->p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
354 | 357 | ||
355 | vxp->link.handle = p_dev; | 358 | vxpocket_config(p_dev); |
356 | vxp->link.state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
357 | p_dev->instance = &vxp->link; | ||
358 | vxpocket_config(&vxp->link); | ||
359 | 359 | ||
360 | return 0; | 360 | return 0; |
361 | } | 361 | } |
diff --git a/sound/pcmcia/vx/vxpocket.h b/sound/pcmcia/vx/vxpocket.h index 67efae3f6c8d..27ea002294c0 100644 --- a/sound/pcmcia/vx/vxpocket.h +++ b/sound/pcmcia/vx/vxpocket.h | |||
@@ -42,7 +42,7 @@ struct snd_vxpocket { | |||
42 | int index; /* card index */ | 42 | int index; /* card index */ |
43 | 43 | ||
44 | /* pcmcia stuff */ | 44 | /* pcmcia stuff */ |
45 | dev_link_t link; | 45 | struct pcmcia_device *p_dev; |
46 | dev_node_t node; | 46 | dev_node_t node; |
47 | }; | 47 | }; |
48 | 48 | ||