diff options
Diffstat (limited to 'sound/pci/ymfpci/ymfpci.c')
-rw-r--r-- | sound/pci/ymfpci/ymfpci.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c index 82d4e0fda91b..b033bd290940 100644 --- a/sound/pci/ymfpci/ymfpci.c +++ b/sound/pci/ymfpci/ymfpci.c @@ -98,8 +98,10 @@ static int snd_ymfpci_create_gameport(struct snd_ymfpci *chip, int dev, case 0x204: legacy_ctrl2 |= 2 << 6; break; case 0x205: legacy_ctrl2 |= 3 << 6; break; default: - dev_err(chip->card->dev, - "invalid joystick port %#x", io_port); + if (io_port > 0) + dev_err(chip->card->dev, + "The %s does not support arbitrary IO ports for the game port (requested 0x%x)\n", + chip->card->shortname, (unsigned int)io_port); return -EINVAL; } } @@ -186,6 +188,13 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci, default: model = str = "???"; break; } + strcpy(card->driver, str); + sprintf(card->shortname, "Yamaha %s (%s)", model, str); + sprintf(card->longname, "%s at 0x%lx, irq %i", + card->shortname, + chip->reg_area_phys, + chip->irq); + legacy_ctrl = 0; legacy_ctrl2 = 0x0800; /* SBEN = 0, SMOD = 01, LAD = 0 */ @@ -218,7 +227,13 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci, case 0x398: legacy_ctrl2 |= 1; break; case 0x3a0: legacy_ctrl2 |= 2; break; case 0x3a8: legacy_ctrl2 |= 3; break; - default: fm_port[dev] = 0; break; + default: + if (fm_port[dev] > 0) + dev_err(card->dev, + "The %s does not support arbitrary IO ports for FM (requested 0x%x)\n", + card->shortname, (unsigned int)fm_port[dev]); + fm_port[dev] = 0; + break; } if (fm_port[dev] > 0) fm_res = devm_request_region(&pci->dev, fm_port[dev], @@ -234,7 +249,13 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci, case 0x300: legacy_ctrl2 |= 1 << 4; break; case 0x332: legacy_ctrl2 |= 2 << 4; break; case 0x334: legacy_ctrl2 |= 3 << 4; break; - default: mpu_port[dev] = 0; break; + default: + if (mpu_port[dev] > 0) + dev_err(card->dev, + "The %s does not support arbitrary IO ports for MPU-401 (requested 0x%x)\n", + card->shortname, (unsigned int)mpu_port[dev]); + mpu_port[dev] = 0; + break; } if (mpu_port[dev] > 0) mpu_res = devm_request_region(&pci->dev, mpu_port[dev], @@ -257,12 +278,6 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci, if (err < 0) return err; - strcpy(card->driver, str); - sprintf(card->shortname, "Yamaha %s (%s)", model, str); - sprintf(card->longname, "%s at 0x%lx, irq %i", - card->shortname, - chip->reg_area_phys, - chip->irq); err = snd_ymfpci_pcm(chip, 0); if (err < 0) return err; @@ -337,11 +352,9 @@ static struct pci_driver ymfpci_driver = { .name = KBUILD_MODNAME, .id_table = snd_ymfpci_ids, .probe = snd_card_ymfpci_probe, -#ifdef CONFIG_PM_SLEEP .driver = { - .pm = &snd_ymfpci_pm, + .pm = pm_sleep_ptr(&snd_ymfpci_pm), }, -#endif }; module_pci_driver(ymfpci_driver); |