aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-11-17 12:35:41 -0500
committerTakashi Iwai <tiwai@suse.de>2009-11-18 01:23:32 -0500
commitb67cad932c4e45edca2f4da2ee4f46001ba17363 (patch)
tree0b20cdacf2ee161a017c50a79f8eea8bfe54a4c1 /sound/isa
parentb753e03e5e7c6ee60e81cd6335c80dc26519f9d0 (diff)
ALSA: opti-miro: use variables directly in the probe function
Use the fm_port and mpu_port variables directly in a probe function. This completely eliminates a need to copy the fm_port value to the snd_miro structure. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/opti9xx/miro.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index 02e30d7c6a9..b8170adeeff 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -118,8 +118,6 @@ struct snd_miro {
118 int dma1; 118 int dma1;
119 int dma2; 119 int dma2;
120 120
121 long fm_port;
122
123 long mpu_port; 121 long mpu_port;
124 int mpu_irq; 122 int mpu_irq;
125 123
@@ -757,7 +755,6 @@ static int __devinit snd_miro_init(struct snd_miro *chip,
757 chip->irq = -1; 755 chip->irq = -1;
758 chip->dma1 = -1; 756 chip->dma1 = -1;
759 chip->dma2 = -1; 757 chip->dma2 = -1;
760 chip->fm_port = -1;
761 chip->mpu_port = -1; 758 chip->mpu_port = -1;
762 chip->mpu_irq = -1; 759 chip->mpu_irq = -1;
763 760
@@ -1261,7 +1258,6 @@ static int __devinit snd_miro_probe(struct device *devptr, unsigned int n)
1261 } 1258 }
1262 1259
1263 miro->wss_base = port; 1260 miro->wss_base = port;
1264 miro->fm_port = fm_port;
1265 miro->mpu_port = mpu_port; 1261 miro->mpu_port = mpu_port;
1266 miro->irq = irq; 1262 miro->irq = irq;
1267 miro->mpu_irq = mpu_irq; 1263 miro->mpu_irq = mpu_irq;
@@ -1276,11 +1272,12 @@ static int __devinit snd_miro_probe(struct device *devptr, unsigned int n)
1276 } 1272 }
1277 } 1273 }
1278 1274
1279 if (miro->mpu_port == SNDRV_AUTO_PORT) { 1275 if (mpu_port == SNDRV_AUTO_PORT) {
1280 if ((miro->mpu_port = snd_legacy_find_free_ioport(possible_mpu_ports, 2)) < 0) { 1276 mpu_port = snd_legacy_find_free_ioport(possible_mpu_ports, 2);
1277 if (mpu_port < 0) {
1281 snd_card_free(card); 1278 snd_card_free(card);
1282 snd_printk(KERN_ERR "unable to find a free MPU401 port\n"); 1279 snd_printk(KERN_ERR "unable to find a free MPU401 port\n");
1283 return -EBUSY; 1280 return -EBUSY
1284 } 1281 }
1285 } 1282 }
1286 if (miro->irq == SNDRV_AUTO_IRQ) { 1283 if (miro->irq == SNDRV_AUTO_IRQ) {
@@ -1380,20 +1377,24 @@ static int __devinit snd_miro_probe(struct device *devptr, unsigned int n)
1380 card->shortname, miro->name, pcm->name, miro->wss_base + 4, 1377 card->shortname, miro->name, pcm->name, miro->wss_base + 4,
1381 miro->irq, miro->dma1, miro->dma2); 1378 miro->irq, miro->dma1, miro->dma2);
1382 1379
1383 if (miro->mpu_port <= 0 || miro->mpu_port == SNDRV_AUTO_PORT) 1380 if (mpu_port <= 0 || mpu_port == SNDRV_AUTO_PORT)
1384 rmidi = NULL; 1381 rmidi = NULL;
1385 else 1382 else {
1386 if ((error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 1383 error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
1387 miro->mpu_port, 0, miro->mpu_irq, IRQF_DISABLED, 1384 mpu_port, 0, miro->mpu_irq, IRQF_DISABLED,
1388 &rmidi))) 1385 &rmidi);
1389 snd_printk(KERN_WARNING "no MPU-401 device at 0x%lx?\n", miro->mpu_port); 1386 if (error < 0)
1387 snd_printk(KERN_WARNING "no MPU-401 device at 0x%lx?\n",
1388 mpu_port);
1389 }
1390 1390
1391 if (miro->fm_port > 0 && miro->fm_port != SNDRV_AUTO_PORT) { 1391 if (fm_port > 0 && fm_port != SNDRV_AUTO_PORT) {
1392 struct snd_opl3 *opl3 = NULL; 1392 struct snd_opl3 *opl3 = NULL;
1393 struct snd_opl4 *opl4; 1393 struct snd_opl4 *opl4;
1394 if (snd_opl4_create(card, miro->fm_port, miro->fm_port - 8, 1394 if (snd_opl4_create(card, fm_port, fm_port - 8,
1395 2, &opl3, &opl4) < 0) 1395 2, &opl3, &opl4) < 0)
1396 snd_printk(KERN_WARNING "no OPL4 device at 0x%lx\n", miro->fm_port); 1396 snd_printk(KERN_WARNING "no OPL4 device at 0x%lx\n",
1397 fm_port);
1397 } 1398 }
1398 1399
1399 if ((error = snd_set_aci_init_values(miro)) < 0) { 1400 if ((error = snd_set_aci_init_values(miro)) < 0) {