aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/es1688/es1688.c
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2010-05-09 14:35:44 -0400
committerTakashi Iwai <tiwai@suse.de>2010-05-10 03:48:59 -0400
commit396fa8272601c3d488cb8391c3962a7ee552afd0 (patch)
tree6ef9af15019a00f6a81243c458ca792247a07869 /sound/isa/es1688/es1688.c
parent02a2ad40295fc8862457b469b3b698d8ece3c72a (diff)
ALSA: es1688: allocate snd_es1688 structure as a part of snd_card structure
Allocate the snd_es1688 during the snd_card allocation. This allows to remove the card pointer from the snd_es1688 structure. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/es1688/es1688.c')
-rw-r--r--sound/isa/es1688/es1688.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index 07df201ed8fa..281679493fb4 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -79,8 +79,8 @@ static int __devinit snd_es1688_match(struct device *dev, unsigned int n)
79 return enable[n]; 79 return enable[n];
80} 80}
81 81
82static int __devinit snd_es1688_legacy_create(struct snd_card *card, 82static int __devinit snd_es1688_legacy_create(struct snd_card *card,
83 struct device *dev, unsigned int n, struct snd_es1688 **rchip) 83 struct snd_es1688 *chip, struct device *dev, unsigned int n)
84{ 84{
85 static long possible_ports[] = {0x220, 0x240, 0x260}; 85 static long possible_ports[] = {0x220, 0x240, 0x260};
86 static int possible_irqs[] = {5, 9, 10, 7, -1}; 86 static int possible_irqs[] = {5, 9, 10, 7, -1};
@@ -104,14 +104,14 @@ static int __devinit snd_es1688_legacy_create(struct snd_card *card,
104 } 104 }
105 105
106 if (port[n] != SNDRV_AUTO_PORT) 106 if (port[n] != SNDRV_AUTO_PORT)
107 return snd_es1688_create(card, port[n], mpu_port[n], irq[n], 107 return snd_es1688_create(card, chip, port[n], mpu_port[n],
108 mpu_irq[n], dma8[n], ES1688_HW_AUTO, rchip); 108 irq[n], mpu_irq[n], dma8[n], ES1688_HW_AUTO);
109 109
110 i = 0; 110 i = 0;
111 do { 111 do {
112 port[n] = possible_ports[i]; 112 port[n] = possible_ports[i];
113 error = snd_es1688_create(card, port[n], mpu_port[n], irq[n], 113 error = snd_es1688_create(card, chip, port[n], mpu_port[n],
114 mpu_irq[n], dma8[n], ES1688_HW_AUTO, rchip); 114 irq[n], mpu_irq[n], dma8[n], ES1688_HW_AUTO);
115 } while (error < 0 && ++i < ARRAY_SIZE(possible_ports)); 115 } while (error < 0 && ++i < ARRAY_SIZE(possible_ports));
116 116
117 return error; 117 return error;
@@ -125,19 +125,22 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n)
125 struct snd_pcm *pcm; 125 struct snd_pcm *pcm;
126 int error; 126 int error;
127 127
128 error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); 128 error = snd_card_create(index[n], id[n], THIS_MODULE,
129 sizeof(struct snd_es1688), &card);
129 if (error < 0) 130 if (error < 0)
130 return error; 131 return error;
131 132
132 error = snd_es1688_legacy_create(card, dev, n, &chip); 133 chip = card->private_data;
134
135 error = snd_es1688_legacy_create(card, chip, dev, n);
133 if (error < 0) 136 if (error < 0)
134 goto out; 137 goto out;
135 138
136 error = snd_es1688_pcm(chip, 0, &pcm); 139 error = snd_es1688_pcm(card, chip, 0, &pcm);
137 if (error < 0) 140 if (error < 0)
138 goto out; 141 goto out;
139 142
140 error = snd_es1688_mixer(chip); 143 error = snd_es1688_mixer(card, chip);
141 if (error < 0) 144 if (error < 0)
142 goto out; 145 goto out;
143 146