Ignore:
Timestamp:
Sep 26, 2021, 6:18:40 PM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from next branch.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/sonicvibes.c

    r695 r703  
    853853        int err;
    854854
    855         if ((err = snd_pcm_new(sonic->card, "s3_86c617", device, 1, 1, &pcm)) < 0)
     855        err = snd_pcm_new(sonic->card, "s3_86c617", device, 1, 1, &pcm);
     856        if (err < 0)
    856857                return err;
    857858        if (snd_BUG_ON(!pcm))
     
    10941095
    10951096        for (idx = 0; idx < ARRAY_SIZE(snd_sonicvibes_controls); idx++) {
    1096                 if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_sonicvibes_controls[idx], sonic))) < 0)
     1097                kctl = snd_ctl_new1(&snd_sonicvibes_controls[idx], sonic);
     1098                err = snd_ctl_add(card, kctl);
     1099                if (err < 0)
    10971100                        return err;
    10981101                switch (idx) {
     
    12271230        *rsonic = NULL;
    12281231        /* enable PCI device */
    1229         if ((err = pci_enable_device(pci)) < 0)
     1232        err = pci_enable_device(pci);
     1233        if (err < 0)
    12301234                return err;
    12311235        /* check, if we can restrict PCI DMA transfers to 24 bits */
     
    12471251        sonic->irq = -1;
    12481252
    1249         if ((err = pci_request_regions(pci, "S3 SonicVibes")) < 0) {
     1253        err = pci_request_regions(pci, "S3 SonicVibes");
     1254        if (err < 0) {
    12501255                kfree(sonic);
    12511256                pci_disable_device(pci);
     
    12901295        pci_write_config_dword(pci, 0x48, dmac);
    12911296
    1292         if ((sonic->res_dmaa = request_region(dmaa, 0x10, "S3 SonicVibes DDMA-A")) == NULL) {
     1297        sonic->res_dmaa = request_region(dmaa, 0x10, "S3 SonicVibes DDMA-A");
     1298        if (!sonic->res_dmaa) {
    12931299                snd_sonicvibes_free(sonic);
    12941300                dev_err(card->dev,
     
    12971303                return -EBUSY;
    12981304        }
    1299         if ((sonic->res_dmac = request_region(dmac, 0x10, "S3 SonicVibes DDMA-C")) == NULL) {
     1305        sonic->res_dmac = request_region(dmac, 0x10, "S3 SonicVibes DDMA-C");
     1306        if (!sonic->res_dmac) {
    13001307                snd_sonicvibes_free(sonic);
    13011308                dev_err(card->dev,
     
    13591366        sonic->revision = snd_sonicvibes_in(sonic, SV_IREG_REVISION);
    13601367
    1361         if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, sonic, &ops)) < 0) {
     1368        err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, sonic, &ops);
     1369        if (err < 0) {
    13621370                snd_sonicvibes_free(sonic);
    13631371                return err;
     
    14061414        mpu->open_input = snd_sonicvibes_midi_input_open;
    14071415        mpu->close_input = snd_sonicvibes_midi_input_close;
    1408         for (idx = 0; idx < ARRAY_SIZE(snd_sonicvibes_midi_controls); idx++)
    1409                 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_sonicvibes_midi_controls[idx], sonic))) < 0)
     1416        for (idx = 0; idx < ARRAY_SIZE(snd_sonicvibes_midi_controls); idx++) {
     1417                err = snd_ctl_add(card, snd_ctl_new1(&snd_sonicvibes_midi_controls[idx], sonic));
     1418                if (err < 0)
    14101419                        return err;
     1420        }
    14111421        return 0;
    14121422}
     
    14401450                }
    14411451        }
    1442         if ((err = snd_sonicvibes_create(card, pci,
    1443                                          reverb[dev] ? 1 : 0,
    1444                                          mge[dev] ? 1 : 0,
    1445                                          &sonic)) < 0) {
     1452        err = snd_sonicvibes_create(card, pci,
     1453                                    reverb[dev] ? 1 : 0,
     1454                                    mge[dev] ? 1 : 0,
     1455                                    &sonic);
     1456        if (err < 0) {
    14461457                snd_card_free(card);
    14471458                return err;
     
    14561467                sonic->irq);
    14571468
    1458         if ((err = snd_sonicvibes_pcm(sonic, 0)) < 0) {
     1469        err = snd_sonicvibes_pcm(sonic, 0);
     1470        if (err < 0) {
    14591471                snd_card_free(card);
    14601472                return err;
    14611473        }
    1462         if ((err = snd_sonicvibes_mixer(sonic)) < 0) {
     1474        err = snd_sonicvibes_mixer(sonic);
     1475        if (err < 0) {
    14631476                snd_card_free(card);
    14641477                return err;
    14651478        }
    1466         if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES,
    1467                                        sonic->midi_port,
    1468                                        MPU401_INFO_INTEGRATED |
    1469                                        MPU401_INFO_IRQ_HOOK,
    1470                                        -1, &midi_uart)) < 0) {
     1479        err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES,
     1480                                  sonic->midi_port,
     1481                                  MPU401_INFO_INTEGRATED |
     1482                                  MPU401_INFO_IRQ_HOOK,
     1483                                  -1, &midi_uart);
     1484        if (err < 0) {
    14711485                snd_card_free(card);
    14721486                return err;
    14731487        }
    14741488        snd_sonicvibes_midi(sonic, midi_uart);
    1475         if ((err = snd_opl3_create(card, sonic->synth_port,
    1476                                    sonic->synth_port + 2,
    1477                                    OPL3_HW_OPL3_SV, 1, &opl3)) < 0) {
     1489        err = snd_opl3_create(card, sonic->synth_port,
     1490                              sonic->synth_port + 2,
     1491                              OPL3_HW_OPL3_SV, 1, &opl3);
     1492        if (err < 0) {
    14781493                snd_card_free(card);
    14791494                return err;
    14801495        }
    1481         if ((err = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
     1496        err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
     1497        if (err < 0) {
    14821498                snd_card_free(card);
    14831499                return err;
     
    14901506        }
    14911507
    1492         if ((err = snd_card_register(card)) < 0) {
     1508        err = snd_card_register(card);
     1509        if (err < 0) {
    14931510                snd_card_free(card);
    14941511                return err;
Note: See TracChangeset for help on using the changeset viewer.