]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'topic/snd_card_new-err' into topic/drop-l3
authorTakashi Iwai <tiwai@suse.de>
Tue, 17 Mar 2009 16:57:37 +0000 (17:57 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 17 Mar 2009 16:57:37 +0000 (17:57 +0100)
22 files changed:
1  2 
sound/arm/sa11xx-uda1341.c
sound/drivers/mtpav.c
sound/drivers/mts64.c
sound/drivers/pcsp/pcsp.c
sound/drivers/serial-u16550.c
sound/drivers/virmidi.c
sound/mips/au1x00.c
sound/pci/als300.c
sound/pci/azt3328.c
sound/pci/ca0106/ca0106_main.c
sound/pci/cs4281.c
sound/pci/cs5535audio/cs5535audio.c
sound/pci/ens1370.c
sound/pci/es1938.c
sound/pci/hda/hda_intel.c
sound/pci/sonicvibes.c
sound/pci/via82xx.c
sound/pci/via82xx_modem.c
sound/ppc/snd_ps3.c
sound/soc/soc-core.c
sound/sparc/amd7930.c
sound/usb/caiaq/caiaq-device.c

index ed481a866a3e7f1910b0f1bc8860a3ec9d1df4ee,51d708c31e6586a50414a8ceec47cdec8794f0f4..7101d3d8bae61d4e73342ac169fb901a8518d681
@@@ -887,9 -887,10 +887,10 @@@ static int __devinit sa11xx_uda1341_pro
        struct sa11xx_uda1341 *chip;
  
        /* register the soundcard */
-       card = snd_card_new(-1, id, THIS_MODULE, sizeof(struct sa11xx_uda1341));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(-1, id, THIS_MODULE,
+                             sizeof(struct sa11xx_uda1341), &card);
+       if (err < 0)
+               return err;
  
        chip = card->private_data;
        spin_lock_init(&chip->s[0].dma_lock);
        snd_card_set_dev(card, &devptr->dev);
  
        if ((err = snd_card_register(card)) == 0) {
 -              printk( KERN_INFO "iPAQ audio support initialized\n" );
 +              printk(KERN_INFO "iPAQ audio support initialized\n");
                platform_set_drvdata(devptr, card);
                return 0;
        }
diff --combined sound/drivers/mtpav.c
index 6b26305ff0e673def576f69a3d80c38773316c98,c3e9833dcfd9af1ffc2d8c53e49a6894a9ed1ef3..355da33cbd22e60f49b1ee7f90da32ea71e1099b
@@@ -303,10 -303,8 +303,10 @@@ static void snd_mtpav_output_port_write
  
                snd_mtpav_send_byte(mtp_card, 0xf5);
                snd_mtpav_send_byte(mtp_card, portp->hwport);
 -              //snd_printk("new outport: 0x%x\n", (unsigned int) portp->hwport);
 -
 +              /*
 +              snd_printk(KERN_DEBUG "new outport: 0x%x\n",
 +                         (unsigned int) portp->hwport);
 +              */
                if (!(outbyte & 0x80) && portp->running_status)
                        snd_mtpav_send_byte(mtp_card, portp->running_status);
        }
@@@ -542,7 -540,7 +542,7 @@@ static void snd_mtpav_read_bytes(struc
  
        u8 sbyt = snd_mtpav_getreg(mcrd, SREG);
  
 -      //printk("snd_mtpav_read_bytes() sbyt: 0x%x\n", sbyt);
 +      /* printk(KERN_DEBUG "snd_mtpav_read_bytes() sbyt: 0x%x\n", sbyt); */
  
        if (!(sbyt & SIGS_BYTE))
                return;
@@@ -587,12 -585,12 +587,12 @@@ static irqreturn_t snd_mtpav_irqh(int i
  static int __devinit snd_mtpav_get_ISA(struct mtpav * mcard)
  {
        if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) {
 -              snd_printk("MTVAP port 0x%lx is busy\n", port);
 +              snd_printk(KERN_ERR "MTVAP port 0x%lx is busy\n", port);
                return -EBUSY;
        }
        mcard->port = port;
        if (request_irq(irq, snd_mtpav_irqh, IRQF_DISABLED, "MOTU MTPAV", mcard)) {
 -              snd_printk("MTVAP IRQ %d busy\n", irq);
 +              snd_printk(KERN_ERR "MTVAP IRQ %d busy\n", irq);
                return -EBUSY;
        }
        mcard->irq = irq;
@@@ -698,9 -696,9 +698,9 @@@ static int __devinit snd_mtpav_probe(st
        int err;
        struct mtpav *mtp_card;
  
-       card = snd_card_new(index, id, THIS_MODULE, sizeof(*mtp_card));
-       if (! card)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, sizeof(*mtp_card), &card);
+       if (err < 0)
+               return err;
  
        mtp_card = card->private_data;
        spin_lock_init(&mtp_card->spinlock);
diff --combined sound/drivers/mts64.c
index 1a05b2d64c9b3b278175654c643c2a7bbb5ed00d,33d9db782e07e4d85ac62c9c89a4ee485a894056..9284829bf9275e9c2afabbbe8e2026c35c2dfb60
@@@ -957,10 -957,10 +957,10 @@@ static int __devinit snd_mts64_probe(st
        if ((err = snd_mts64_probe_port(p)) < 0)
                return err;
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL) {
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0) {
                snd_printd("Cannot create card\n");
-               return -ENOMEM;
+               return err;
        }
        strcpy(card->driver, DRIVER_NAME);
        strcpy(card->shortname, "ESI " CARD_NAME);
                goto __err;
        }
  
 -      snd_printk("ESI Miditerminal 4140 on 0x%lx\n", p->base);
 +      snd_printk(KERN_INFO "ESI Miditerminal 4140 on 0x%lx\n", p->base);
        return 0;
  
  __err:
index c7c744c6fc0b39b34c01855f052bcb86fc91b609,aa2ae07a76d563fb5e8d64fdec7606570a0ed569..b60cef257b589288a7339157bfdbc9e009b5c5bb
@@@ -57,7 -57,7 +57,7 @@@ static int __devinit snd_pcsp_create(st
        else
                min_div = MAX_DIV;
  #if PCSP_DEBUG
 -      printk("PCSP: lpj=%li, min_div=%i, res=%li\n",
 +      printk(KERN_DEBUG "PCSP: lpj=%li, min_div=%i, res=%li\n",
               loops_per_jiffy, min_div, tp.tv_nsec);
  #endif
  
@@@ -98,9 -98,9 +98,9 @@@ static int __devinit snd_card_pcsp_prob
        hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        pcsp_chip.timer.function = pcsp_do_timer;
  
-       card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (!card)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
  
        err = snd_pcsp_create(card);
        if (err < 0) {
index ff0a41510945d1056de78797d18626e4570e1c1c,891d081e4825d780f3ce78e3622477bf2e24060d..b2b6d50c942559fcb14474ff1e8281ae947e4db4
@@@ -241,8 -241,7 +241,8 @@@ static void snd_uart16550_io_loop(struc
                        snd_rawmidi_receive(uart->midi_input[substream], &c, 1);
  
                if (status & UART_LSR_OE)
 -                      snd_printk("%s: Overrun on device at 0x%lx\n",
 +                      snd_printk(KERN_WARNING
 +                                 "%s: Overrun on device at 0x%lx\n",
                               uart->rmidi->name, uart->base);
        }
  
@@@ -637,8 -636,7 +637,8 @@@ static int snd_uart16550_output_byte(st
                }
        } else {
                if (!snd_uart16550_write_buffer(uart, midi_byte)) {
 -                      snd_printk("%s: Buffer overrun on device at 0x%lx\n",
 +                      snd_printk(KERN_WARNING
 +                                 "%s: Buffer overrun on device at 0x%lx\n",
                                   uart->rmidi->name, uart->base);
                        return 0;
                }
@@@ -817,8 -815,7 +817,8 @@@ static int __devinit snd_uart16550_crea
        if (irq >= 0 && irq != SNDRV_AUTO_IRQ) {
                if (request_irq(irq, snd_uart16550_interrupt,
                                IRQF_DISABLED, "Serial MIDI", uart)) {
 -                      snd_printk("irq %d busy. Using Polling.\n", irq);
 +                      snd_printk(KERN_WARNING
 +                                 "irq %d busy. Using Polling.\n", irq);
                } else {
                        uart->irq = irq;
                }
@@@ -922,29 -919,26 +922,29 @@@ static int __devinit snd_serial_probe(s
        case SNDRV_SERIAL_GENERIC:
                break;
        default:
 -              snd_printk("Adaptor type is out of range 0-%d (%d)\n",
 +              snd_printk(KERN_ERR
 +                         "Adaptor type is out of range 0-%d (%d)\n",
                           SNDRV_SERIAL_MAX_ADAPTOR, adaptor[dev]);
                return -ENODEV;
        }
  
        if (outs[dev] < 1 || outs[dev] > SNDRV_SERIAL_MAX_OUTS) {
 -              snd_printk("Count of outputs is out of range 1-%d (%d)\n",
 +              snd_printk(KERN_ERR
 +                         "Count of outputs is out of range 1-%d (%d)\n",
                           SNDRV_SERIAL_MAX_OUTS, outs[dev]);
                return -ENODEV;
        }
  
        if (ins[dev] < 1 || ins[dev] > SNDRV_SERIAL_MAX_INS) {
 -              snd_printk("Count of inputs is out of range 1-%d (%d)\n",
 +              snd_printk(KERN_ERR
 +                         "Count of inputs is out of range 1-%d (%d)\n",
                           SNDRV_SERIAL_MAX_INS, ins[dev]);
                return -ENODEV;
        }
  
-       card  = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err  = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
  
        strcpy(card->driver, "Serial");
        strcpy(card->shortname, "Serial MIDI (UART16550A)");
diff --combined sound/drivers/virmidi.c
index 1022e365606ff6c5607017c3b467cac0168aba83,6f48711818f33eff1ea78d7ec5cca29b6e6dd835..0e631c3221e3b72f46b2b1b11569d5931ead1097
@@@ -90,17 -90,15 +90,17 @@@ static int __devinit snd_virmidi_probe(
        int idx, err;
        int dev = devptr->id;
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                           sizeof(struct snd_card_virmidi));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct snd_card_virmidi), &card);
+       if (err < 0)
+               return err;
        vmidi = (struct snd_card_virmidi *)card->private_data;
        vmidi->card = card;
  
        if (midi_devs[dev] > MAX_MIDI_DEVICES) {
 -              snd_printk("too much midi devices for virmidi %d: force to use %d\n", dev, MAX_MIDI_DEVICES);
 +              snd_printk(KERN_WARNING
 +                         "too much midi devices for virmidi %d: "
 +                         "force to use %d\n", dev, MAX_MIDI_DEVICES);
                midi_devs[dev] = MAX_MIDI_DEVICES;
        }
        for (idx = 0; idx < midi_devs[dev]; idx++) {
diff --combined sound/mips/au1x00.c
index 7c1afc96ab87c575d6b68921376728bb0332eaa7,99e1391b2eb42ffce2d7425621afa0c26134e770..3e763d6a5d67802d6f736e4df0dccfd88eff2224
@@@ -636,9 -636,10 +636,10 @@@ au1000_init(void
        struct snd_card *card;
        struct snd_au1000 *au1000;
  
-       card = snd_card_new(-1, "AC97", THIS_MODULE, sizeof(struct snd_au1000));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(-1, "AC97", THIS_MODULE,
+                             sizeof(struct snd_au1000), &card);
+       if (err < 0)
+               return err;
  
        card->private_free = snd_au1000_free;
        au1000 = card->private_data;
                return err;
        }
  
 -      printk( KERN_INFO "ALSA AC97: Driver Initialized\n" );
 +      printk(KERN_INFO "ALSA AC97: Driver Initialized\n");
        au1000_card = card;
        return 0;
  }
diff --combined sound/pci/als300.c
index a2c35c1081c3c39977b40830884f52d3967dd552,f557c155db482da8e83d163bd6059d9930621ad4..009b4c8225a5b976f6f2437c70c8664bfeb81daf
@@@ -91,7 -91,7 +91,7 @@@
  #define DEBUG_PLAY_REC        0
  
  #if DEBUG_CALLS
 -#define snd_als300_dbgcalls(format, args...) printk(format, ##args)
 +#define snd_als300_dbgcalls(format, args...) printk(KERN_DEBUG format, ##args)
  #define snd_als300_dbgcallenter() printk(KERN_ERR "--> %s\n", __func__)
  #define snd_als300_dbgcallleave() printk(KERN_ERR "<-- %s\n", __func__)
  #else
@@@ -812,10 -812,10 +812,10 @@@ static int __devinit snd_als300_probe(s
                return -ENOENT;
        }
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
  
-       if (card == NULL)
-               return -ENOMEM;
+       if (err < 0)
+               return err;
  
        chip_type = pci_id->driver_data;
  
diff --combined sound/pci/azt3328.c
index 8121763b0c104d6145366372987729b7a8e8cb69,1df96e76c4832146eec9110be12f4fbe54b8099a..e9e9b5821d41f1c4287b96a1115a11a928b534e4
@@@ -211,25 -211,25 +211,25 @@@ MODULE_SUPPORTED_DEVICE("{{Aztech,AZF33
  #endif
  
  #if DEBUG_MIXER
 -#define snd_azf3328_dbgmixer(format, args...) printk(format, ##args)
 +#define snd_azf3328_dbgmixer(format, args...) printk(KERN_DEBUG format, ##args)
  #else
  #define snd_azf3328_dbgmixer(format, args...)
  #endif
  
  #if DEBUG_PLAY_REC
 -#define snd_azf3328_dbgplay(format, args...) printk(KERN_ERR format, ##args)
 +#define snd_azf3328_dbgplay(format, args...) printk(KERN_DEBUG format, ##args)
  #else
  #define snd_azf3328_dbgplay(format, args...)
  #endif
  
  #if DEBUG_MISC
 -#define snd_azf3328_dbgtimer(format, args...) printk(KERN_ERR format, ##args)
 +#define snd_azf3328_dbgtimer(format, args...) printk(KERN_DEBUG format, ##args)
  #else
  #define snd_azf3328_dbgtimer(format, args...)
  #endif
  
  #if DEBUG_GAME
 -#define snd_azf3328_dbggame(format, args...) printk(KERN_ERR format, ##args)
 +#define snd_azf3328_dbggame(format, args...) printk(KERN_DEBUG format, ##args)
  #else
  #define snd_azf3328_dbggame(format, args...)
  #endif
@@@ -2216,9 -2216,9 +2216,9 @@@ snd_azf3328_probe(struct pci_dev *pci, 
                return -ENOENT;
        }
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
  
        strcpy(card->driver, "AZF3328");
        strcpy(card->shortname, "Aztech AZF3328 (PCI168)");
index f2f8fd17ea4d372746195d0d3770147c0e0acef0,b116456e77071ea75ba27e995c98ca4adb933ca8..a38ff9dd07eb020b91eb7c259b03a5bf1d076f8d
@@@ -404,9 -404,7 +404,9 @@@ int snd_ca0106_i2c_write(struct snd_ca0
        }
  
        tmp = reg << 25 | value << 16;
 -      // snd_printk("I2C-write:reg=0x%x, value=0x%x\n", reg, value);
 +      /*
 +      snd_printk(KERN_DEBUG "I2C-write:reg=0x%x, value=0x%x\n", reg, value);
 +      */
        /* Not sure what this I2C channel controls. */
        /* snd_ca0106_ptr_write(emu, I2C_D0, 0, tmp); */
  
                /* Wait till the transaction ends */
                while (1) {
                        status = snd_ca0106_ptr_read(emu, I2C_A, 0);
 -                      //snd_printk("I2C:status=0x%x\n", status);
 +                      /*snd_printk(KERN_DEBUG "I2C:status=0x%x\n", status);*/
                        timeout++;
                        if ((status & I2C_A_ADC_START) == 0)
                                break;
@@@ -523,10 -521,7 +523,10 @@@ static int snd_ca0106_pcm_open_playback
          channel->number = channel_id;
  
        channel->use = 1;
 -        //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
 +      /*
 +      printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n",
 +             channel_id, chip, channel);
 +      */
          //channel->interrupt = snd_ca0106_pcm_channel_interrupt;
        channel->epcm = epcm;
        if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
@@@ -619,10 -614,7 +619,10 @@@ static int snd_ca0106_pcm_open_capture_
          channel->number = channel_id;
  
        channel->use = 1;
 -        //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
 +      /*
 +        printk(KERN_DEBUG "open:channel_id=%d, chip=%p, channel=%p\n",
 +             channel_id, chip, channel);
 +      */
          //channel->interrupt = snd_ca0106_pcm_channel_interrupt;
          channel->epcm = epcm;
        if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
@@@ -713,20 -705,9 +713,20 @@@ static int snd_ca0106_pcm_prepare_playb
        u32 reg71;
        int i;
        
 -        //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
 -        //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
 -      //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
 +#if 0 /* debug */
 +      snd_printk(KERN_DEBUG
 +                 "prepare:channel_number=%d, rate=%d, format=0x%x, "
 +                 "channels=%d, buffer_size=%ld, period_size=%ld, "
 +                 "periods=%u, frames_to_bytes=%d\n",
 +                 channel, runtime->rate, runtime->format,
 +                 runtime->channels, runtime->buffer_size,
 +                 runtime->period_size, runtime->periods,
 +                 frames_to_bytes(runtime, 1));
 +      snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n",
 +                 runtime->dma_addr, runtime->dma_area, table_base);
 +      snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",
 +                 emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
 +#endif /* debug */
        /* Rate can be set per channel. */
        /* reg40 control host to fifo */
        /* reg71 controls DAC rate. */
@@@ -818,20 -799,9 +818,20 @@@ static int snd_ca0106_pcm_prepare_captu
        u32 reg71_set = 0;
        u32 reg71;
        
 -        //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
 -        //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
 -      //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
 +#if 0 /* debug */
 +      snd_printk(KERN_DEBUG
 +                 "prepare:channel_number=%d, rate=%d, format=0x%x, "
 +                 "channels=%d, buffer_size=%ld, period_size=%ld, "
 +                 "periods=%u, frames_to_bytes=%d\n",
 +                 channel, runtime->rate, runtime->format,
 +                 runtime->channels, runtime->buffer_size,
 +                 runtime->period_size, runtime->periods,
 +                 frames_to_bytes(runtime, 1));
 +        snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, table_base=%p\n",
 +                 runtime->dma_addr, runtime->dma_area, table_base);
 +      snd_printk(KERN_DEBUG "dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",
 +                 emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
 +#endif /* debug */
        /* reg71 controls ADC rate. */
        switch (runtime->rate) {
        case 44100:
        }
  
  
 -        //printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size,  frames_to_bytes(runtime, 1));
 +      /*
 +      printk(KERN_DEBUG
 +             "prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, "
 +             "buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",
 +             channel, runtime->rate, runtime->format, runtime->channels,
 +             runtime->buffer_size, runtime->period_size,
 +             frames_to_bytes(runtime, 1));
 +      */
        snd_ca0106_ptr_write(emu, 0x13, channel, 0);
        snd_ca0106_ptr_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr);
        snd_ca0106_ptr_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes
@@@ -925,13 -888,13 +925,13 @@@ static int snd_ca0106_pcm_trigger_playb
                runtime = s->runtime;
                epcm = runtime->private_data;
                channel = epcm->channel_id;
 -              /* snd_printk("channel=%d\n",channel); */
 +              /* snd_printk(KERN_DEBUG "channel=%d\n", channel); */
                epcm->running = running;
                basic |= (0x1 << channel);
                extended |= (0x10 << channel);
                  snd_pcm_trigger_done(s, substream);
          }
 -      /* snd_printk("basic=0x%x, extended=0x%x\n",basic, extended); */
 +      /* snd_printk(KERN_DEBUG "basic=0x%x, extended=0x%x\n",basic, extended); */
  
        switch (cmd) {
        case SNDRV_PCM_TRIGGER_START:
@@@ -1009,13 -972,8 +1009,13 @@@ snd_ca0106_pcm_pointer_playback(struct 
        ptr=ptr2;
          if (ptr >= runtime->buffer_size)
                ptr -= runtime->buffer_size;
 -      //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate);
 -
 +      /*
 +      printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, "
 +             "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n",
 +             ptr1, ptr2, ptr, (int)runtime->buffer_size,
 +             (int)runtime->period_size, (int)runtime->frame_bits,
 +             (int)runtime->rate);
 +      */
        return ptr;
  }
  
@@@ -1037,13 -995,8 +1037,13 @@@ snd_ca0106_pcm_pointer_capture(struct s
        ptr=ptr2;
          if (ptr >= runtime->buffer_size)
                ptr -= runtime->buffer_size;
 -      //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate);
 -
 +      /*
 +      printk(KERN_DEBUG "ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, "
 +             "buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n",
 +             ptr1, ptr2, ptr, (int)runtime->buffer_size,
 +             (int)runtime->period_size, (int)runtime->frame_bits,
 +             (int)runtime->rate);
 +      */
        return ptr;
  }
  
@@@ -1228,12 -1181,8 +1228,12 @@@ static irqreturn_t snd_ca0106_interrupt
                return IRQ_NONE;
  
          stat76 = snd_ca0106_ptr_read(chip, EXTENDED_INT, 0);
 -      //snd_printk("interrupt status = 0x%08x, stat76=0x%08x\n", status, stat76);
 -      //snd_printk("ptr=0x%08x\n",snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0));
 +      /*
 +      snd_printk(KERN_DEBUG "interrupt status = 0x%08x, stat76=0x%08x\n",
 +                 status, stat76);
 +      snd_printk(KERN_DEBUG "ptr=0x%08x\n",
 +                 snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0));
 +      */
          mask = 0x11; /* 0x1 for one half, 0x10 for the other half period. */
        for(i = 0; i < 4; i++) {
                pchannel = &(chip->playback_channels[i]);
@@@ -1521,7 -1470,7 +1521,7 @@@ static void ca0106_init_chip(struct snd
                int size, n;
  
                size = ARRAY_SIZE(i2c_adc_init);
 -              /* snd_printk("I2C:array size=0x%x\n", size); */
 +              /* snd_printk(KERN_DEBUG "I2C:array size=0x%x\n", size); */
                for (n = 0; n < size; n++)
                        snd_ca0106_i2c_write(chip, i2c_adc_init[n][0],
                                             i2c_adc_init[n][1]);
@@@ -1758,9 -1707,9 +1758,9 @@@ static int __devinit snd_ca0106_probe(s
                return -ENOENT;
        }
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
  
        err = snd_ca0106_create(dev, card, pci, &chip);
        if (err < 0)
diff --combined sound/pci/cs4281.c
index 415e88f2c62fafa51520c168a270ffc543ac3cee,b9b07f464631ec84da04ebdac6c3a8c19806c10a..f6286f84a2213c1b08314de7b74f2bcd6a2469fb
@@@ -834,11 -834,7 +834,11 @@@ static snd_pcm_uframes_t snd_cs4281_poi
        struct cs4281_dma *dma = runtime->private_data;
        struct cs4281 *chip = snd_pcm_substream_chip(substream);
  
 -      // printk("DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n", snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size, jiffies);
 +      /*
 +      printk(KERN_DEBUG "DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n",
 +             snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size,
 +             jiffies);
 +      */
        return runtime->buffer_size -
               snd_cs4281_peekBA0(chip, dma->regDCC) - 1;
  }
@@@ -1929,9 -1925,9 +1929,9 @@@ static int __devinit snd_cs4281_probe(s
                return -ENOENT;
        }
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
  
        if ((err = snd_cs4281_create(card, pci, &chip, dual_codec[dev])) < 0) {
                snd_card_free(card);
index 6506201d56f699b6614068e38ac3365b323fc75e,ac1d72e0a1e4ba1233f1cc2e479e1b0eeae5456f..c89ed1f5bc2bd5e6f29f357944de60aca751bae0
@@@ -312,7 -312,7 +312,7 @@@ static int __devinit snd_cs5535audio_cr
  
        if (request_irq(pci->irq, snd_cs5535audio_interrupt,
                        IRQF_SHARED, "CS5535 Audio", cs5535au)) {
 -              snd_printk("unable to grab IRQ %d\n", pci->irq);
 +              snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                err = -EBUSY;
                goto sndfail;
        }
@@@ -353,9 -353,9 +353,9 @@@ static int __devinit snd_cs5535audio_pr
                return -ENOENT;
        }
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
  
        if ((err = snd_cs5535audio_create(card, pci, &cs5535au)) < 0)
                goto probefail_out;
diff --combined sound/pci/ens1370.c
index 17674b3406bd234b683e0ed1639af3ed9963da35,e00614cbceffbec319dbaf6b3ab39829c4d391ed..18f4d1e98c46945c63c0a2c80c64e1fcc198bde8
@@@ -584,8 -584,7 +584,8 @@@ static void snd_es1370_codec_write(stru
        unsigned long end_time = jiffies + HZ / 10;
  
  #if 0
 -      printk("CODEC WRITE: reg = 0x%x, val = 0x%x (0x%x), creg = 0x%x\n",
 +      printk(KERN_DEBUG
 +             "CODEC WRITE: reg = 0x%x, val = 0x%x (0x%x), creg = 0x%x\n",
               reg, val, ES_1370_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1370_CODEC));
  #endif
        do {
@@@ -2410,9 -2409,9 +2410,9 @@@ static int __devinit snd_audiopci_probe
                return -ENOENT;
        }
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
  
        if ((err = snd_ensoniq_create(card, pci, &ensoniq)) < 0) {
                snd_card_free(card);
diff --combined sound/pci/es1938.c
index e4ba84bed4ade88cee7d8d725dd93468896a481c,34a78afc26d0b33666c7b6cc6c9a3a65fe4a8ec2..dd63b132fb8efc0a3070976a2eca838e4812e550
@@@ -1673,22 -1673,18 +1673,22 @@@ static irqreturn_t snd_es1938_interrupt
  
        status = inb(SLIO_REG(chip, IRQCONTROL));
  #if 0
 -      printk("Es1938debug - interrupt status: =0x%x\n", status);
 +      printk(KERN_DEBUG "Es1938debug - interrupt status: =0x%x\n", status);
  #endif
        
        /* AUDIO 1 */
        if (status & 0x10) {
  #if 0
 -                printk("Es1938debug - AUDIO channel 1 interrupt\n");
 -              printk("Es1938debug - AUDIO channel 1 DMAC DMA count: %u\n",
 +                printk(KERN_DEBUG
 +                     "Es1938debug - AUDIO channel 1 interrupt\n");
 +              printk(KERN_DEBUG
 +                     "Es1938debug - AUDIO channel 1 DMAC DMA count: %u\n",
                       inw(SLDM_REG(chip, DMACOUNT)));
 -              printk("Es1938debug - AUDIO channel 1 DMAC DMA base: %u\n",
 +              printk(KERN_DEBUG
 +                     "Es1938debug - AUDIO channel 1 DMAC DMA base: %u\n",
                       inl(SLDM_REG(chip, DMAADDR)));
 -              printk("Es1938debug - AUDIO channel 1 DMAC DMA status: 0x%x\n",
 +              printk(KERN_DEBUG
 +                     "Es1938debug - AUDIO channel 1 DMAC DMA status: 0x%x\n",
                       inl(SLDM_REG(chip, DMASTATUS)));
  #endif
                /* clear irq */
        /* AUDIO 2 */
        if (status & 0x20) {
  #if 0
 -                printk("Es1938debug - AUDIO channel 2 interrupt\n");
 -              printk("Es1938debug - AUDIO channel 2 DMAC DMA count: %u\n",
 +                printk(KERN_DEBUG
 +                     "Es1938debug - AUDIO channel 2 interrupt\n");
 +              printk(KERN_DEBUG
 +                     "Es1938debug - AUDIO channel 2 DMAC DMA count: %u\n",
                       inw(SLIO_REG(chip, AUDIO2DMACOUNT)));
 -              printk("Es1938debug - AUDIO channel 2 DMAC DMA base: %u\n",
 +              printk(KERN_DEBUG
 +                     "Es1938debug - AUDIO channel 2 DMAC DMA base: %u\n",
                       inl(SLIO_REG(chip, AUDIO2DMAADDR)));
  
  #endif
@@@ -1806,9 -1799,9 +1806,9 @@@ static int __devinit snd_es1938_probe(s
                return -ENOENT;
        }
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
        for (idx = 0; idx < 5; idx++) {
                if (pci_resource_start(pci, idx) == 0 ||
                    !(pci_resource_flags(pci, idx) & IORESOURCE_IO)) {
index 11e791b965f6a772588ac7dff64437b3ec836e70,ad5df2ae6f7d6d638611e7cbf8d60af1105e1e60..f9603443f08679be8a2b3b66aabfaf22eb30256c
@@@ -996,11 -996,10 +996,11 @@@ static irqreturn_t azx_interrupt(int ir
                                spin_unlock(&chip->reg_lock);
                                snd_pcm_period_elapsed(azx_dev->substream);
                                spin_lock(&chip->reg_lock);
 -                      } else {
 +                      } else if (chip->bus && chip->bus->workq) {
                                /* bogus IRQ, process it later */
                                azx_dev->irq_pending = 1;
 -                              schedule_work(&chip->irq_pending_work);
 +                              queue_work(chip->bus->workq,
 +                                         &chip->irq_pending_work);
                        }
                }
        }
@@@ -1742,6 -1741,7 +1742,6 @@@ static void azx_clear_irq_pending(struc
        for (i = 0; i < chip->num_streams; i++)
                chip->azx_dev[i].irq_pending = 0;
        spin_unlock_irq(&chip->reg_lock);
 -      flush_scheduled_work();
  }
  
  static struct snd_pcm_ops azx_pcm_ops = {
@@@ -2335,10 -2335,10 +2335,10 @@@ static int __devinit azx_probe(struct p
                return -ENOENT;
        }
  
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (!card) {
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0) {
                snd_printk(KERN_ERR SFX "Error creating card!\n");
-               return -ENOMEM;
+               return err;
        }
  
        err = azx_create(card, pci, dev, pci_id->driver_data, &chip);
diff --combined sound/pci/sonicvibes.c
index e922b1887b1d67cccacaabd356d18f271970921c,c5601b0ad7cc4b8c52142d5f1da3e1ffad536dbb..d989215f35563cbbe3b4cfde16cc3256391d3ba5
@@@ -273,8 -273,7 +273,8 @@@ static inline void snd_sonicvibes_setdm
        outl(count, sonic->dmaa_port + SV_DMA_COUNT0);
        outb(0x18, sonic->dmaa_port + SV_DMA_MODE);
  #if 0
 -      printk("program dmaa: addr = 0x%x, paddr = 0x%x\n", addr, inl(sonic->dmaa_port + SV_DMA_ADDR0));
 +      printk(KERN_DEBUG "program dmaa: addr = 0x%x, paddr = 0x%x\n",
 +             addr, inl(sonic->dmaa_port + SV_DMA_ADDR0));
  #endif
  }
  
@@@ -289,8 -288,7 +289,8 @@@ static inline void snd_sonicvibes_setdm
        outl(count, sonic->dmac_port + SV_DMA_COUNT0);
        outb(0x14, sonic->dmac_port + SV_DMA_MODE);
  #if 0
 -      printk("program dmac: addr = 0x%x, paddr = 0x%x\n", addr, inl(sonic->dmac_port + SV_DMA_ADDR0));
 +      printk(KERN_DEBUG "program dmac: addr = 0x%x, paddr = 0x%x\n",
 +             addr, inl(sonic->dmac_port + SV_DMA_ADDR0));
  #endif
  }
  
@@@ -357,104 -355,71 +357,104 @@@ static unsigned char snd_sonicvibes_in(
  #if 0
  static void snd_sonicvibes_debug(struct sonicvibes * sonic)
  {
 -      printk("SV REGS:          INDEX = 0x%02x  ", inb(SV_REG(sonic, INDEX)));
 +      printk(KERN_DEBUG
 +             "SV REGS:          INDEX = 0x%02x  ", inb(SV_REG(sonic, INDEX)));
        printk("                 STATUS = 0x%02x\n", inb(SV_REG(sonic, STATUS)));
 -      printk("  0x00: left input      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x00));
 +      printk(KERN_DEBUG
 +             "  0x00: left input      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x00));
        printk("  0x20: synth rate low  = 0x%02x\n", snd_sonicvibes_in(sonic, 0x20));
 -      printk("  0x01: right input     = 0x%02x  ", snd_sonicvibes_in(sonic, 0x01));
 +      printk(KERN_DEBUG
 +             "  0x01: right input     = 0x%02x  ", snd_sonicvibes_in(sonic, 0x01));
        printk("  0x21: synth rate high = 0x%02x\n", snd_sonicvibes_in(sonic, 0x21));
 -      printk("  0x02: left AUX1       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x02));
 +      printk(KERN_DEBUG
 +             "  0x02: left AUX1       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x02));
        printk("  0x22: ADC clock       = 0x%02x\n", snd_sonicvibes_in(sonic, 0x22));
 -      printk("  0x03: right AUX1      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x03));
 +      printk(KERN_DEBUG
 +             "  0x03: right AUX1      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x03));
        printk("  0x23: ADC alt rate    = 0x%02x\n", snd_sonicvibes_in(sonic, 0x23));
 -      printk("  0x04: left CD         = 0x%02x  ", snd_sonicvibes_in(sonic, 0x04));
 +      printk(KERN_DEBUG
 +             "  0x04: left CD         = 0x%02x  ", snd_sonicvibes_in(sonic, 0x04));
        printk("  0x24: ADC pll M       = 0x%02x\n", snd_sonicvibes_in(sonic, 0x24));
 -      printk("  0x05: right CD        = 0x%02x  ", snd_sonicvibes_in(sonic, 0x05));
 +      printk(KERN_DEBUG
 +             "  0x05: right CD        = 0x%02x  ", snd_sonicvibes_in(sonic, 0x05));
        printk("  0x25: ADC pll N       = 0x%02x\n", snd_sonicvibes_in(sonic, 0x25));
 -      printk("  0x06: left line       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x06));
 +      printk(KERN_DEBUG
 +             "  0x06: left line       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x06));
        printk("  0x26: Synth pll M     = 0x%02x\n", snd_sonicvibes_in(sonic, 0x26));
 -      printk("  0x07: right line      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x07));
 +      printk(KERN_DEBUG
 +             "  0x07: right line      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x07));
        printk("  0x27: Synth pll N     = 0x%02x\n", snd_sonicvibes_in(sonic, 0x27));
 -      printk("  0x08: MIC             = 0x%02x  ", snd_sonicvibes_in(sonic, 0x08));
 +      printk(KERN_DEBUG
 +             "  0x08: MIC             = 0x%02x  ", snd_sonicvibes_in(sonic, 0x08));
        printk("  0x28: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x28));
 -      printk("  0x09: Game port       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x09));
 +      printk(KERN_DEBUG
 +             "  0x09: Game port       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x09));
        printk("  0x29: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x29));
 -      printk("  0x0a: left synth      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0a));
 +      printk(KERN_DEBUG
 +             "  0x0a: left synth      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0a));
        printk("  0x2a: MPU401          = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2a));
 -      printk("  0x0b: right synth     = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0b));
 +      printk(KERN_DEBUG
 +             "  0x0b: right synth     = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0b));
        printk("  0x2b: drive ctrl      = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2b));
 -      printk("  0x0c: left AUX2       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0c));
 +      printk(KERN_DEBUG
 +             "  0x0c: left AUX2       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0c));
        printk("  0x2c: SRS space       = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2c));
 -      printk("  0x0d: right AUX2      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0d));
 +      printk(KERN_DEBUG
 +             "  0x0d: right AUX2      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0d));
        printk("  0x2d: SRS center      = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2d));
 -      printk("  0x0e: left analog     = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0e));
 +      printk(KERN_DEBUG
 +             "  0x0e: left analog     = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0e));
        printk("  0x2e: wave source     = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2e));
 -      printk("  0x0f: right analog    = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0f));
 +      printk(KERN_DEBUG
 +             "  0x0f: right analog    = 0x%02x  ", snd_sonicvibes_in(sonic, 0x0f));
        printk("  0x2f: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x2f));
 -      printk("  0x10: left PCM        = 0x%02x  ", snd_sonicvibes_in(sonic, 0x10));
 +      printk(KERN_DEBUG
 +             "  0x10: left PCM        = 0x%02x  ", snd_sonicvibes_in(sonic, 0x10));
        printk("  0x30: analog power    = 0x%02x\n", snd_sonicvibes_in(sonic, 0x30));
 -      printk("  0x11: right PCM       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x11));
 +      printk(KERN_DEBUG
 +             "  0x11: right PCM       = 0x%02x  ", snd_sonicvibes_in(sonic, 0x11));
        printk("  0x31: analog power    = 0x%02x\n", snd_sonicvibes_in(sonic, 0x31));
 -      printk("  0x12: DMA data format = 0x%02x  ", snd_sonicvibes_in(sonic, 0x12));
 +      printk(KERN_DEBUG
 +             "  0x12: DMA data format = 0x%02x  ", snd_sonicvibes_in(sonic, 0x12));
        printk("  0x32: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x32));
 -      printk("  0x13: P/C enable      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x13));
 +      printk(KERN_DEBUG
 +             "  0x13: P/C enable      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x13));
        printk("  0x33: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x33));
 -      printk("  0x14: U/D button      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x14));
 +      printk(KERN_DEBUG
 +             "  0x14: U/D button      = 0x%02x  ", snd_sonicvibes_in(sonic, 0x14));
        printk("  0x34: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x34));
 -      printk("  0x15: revision        = 0x%02x  ", snd_sonicvibes_in(sonic, 0x15));
 +      printk(KERN_DEBUG
 +             "  0x15: revision        = 0x%02x  ", snd_sonicvibes_in(sonic, 0x15));
        printk("  0x35: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x35));
 -      printk("  0x16: ADC output ctrl = 0x%02x  ", snd_sonicvibes_in(sonic, 0x16));
 +      printk(KERN_DEBUG
 +             "  0x16: ADC output ctrl = 0x%02x  ", snd_sonicvibes_in(sonic, 0x16));
        printk("  0x36: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x36));
 -      printk("  0x17: ---             = 0x%02x  ", snd_sonicvibes_in(sonic, 0x17));
 +      printk(KERN_DEBUG
 +             "  0x17: ---             = 0x%02x  ", snd_sonicvibes_in(sonic, 0x17));
        printk("  0x37: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x37));
 -      printk("  0x18: DMA A upper cnt = 0x%02x  ", snd_sonicvibes_in(sonic, 0x18));
 +      printk(KERN_DEBUG
 +             "  0x18: DMA A upper cnt = 0x%02x  ", snd_sonicvibes_in(sonic, 0x18));
        printk("  0x38: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x38));
 -      printk("  0x19: DMA A lower cnt = 0x%02x  ", snd_sonicvibes_in(sonic, 0x19));
 +      printk(KERN_DEBUG
 +             "  0x19: DMA A lower cnt = 0x%02x  ", snd_sonicvibes_in(sonic, 0x19));
        printk("  0x39: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x39));
 -      printk("  0x1a: ---             = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1a));
 +      printk(KERN_DEBUG
 +             "  0x1a: ---             = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1a));
        printk("  0x3a: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3a));
 -      printk("  0x1b: ---             = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1b));
 +      printk(KERN_DEBUG
 +             "  0x1b: ---             = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1b));
        printk("  0x3b: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3b));
 -      printk("  0x1c: DMA C upper cnt = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1c));
 +      printk(KERN_DEBUG
 +             "  0x1c: DMA C upper cnt = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1c));
        printk("  0x3c: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3c));
 -      printk("  0x1d: DMA C upper cnt = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1d));
 +      printk(KERN_DEBUG
 +             "  0x1d: DMA C upper cnt = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1d));
        printk("  0x3d: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3d));
 -      printk("  0x1e: PCM rate low    = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1e));
 +      printk(KERN_DEBUG
 +             "  0x1e: PCM rate low    = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1e));
        printk("  0x3e: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3e));
 -      printk("  0x1f: PCM rate high   = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1f));
 +      printk(KERN_DEBUG
 +             "  0x1f: PCM rate high   = 0x%02x  ", snd_sonicvibes_in(sonic, 0x1f));
        printk("  0x3f: ---             = 0x%02x\n", snd_sonicvibes_in(sonic, 0x3f));
  }
  
@@@ -511,8 -476,8 +511,8 @@@ static void snd_sonicvibes_pll(unsigne
        *res_m = m;
        *res_n = n;
  #if 0
 -      printk("metric = %i, xm = %i, xn = %i\n", metric, xm, xn);
 -      printk("pll: m = 0x%x, r = 0x%x, n = 0x%x\n", reg, m, r, n);
 +      printk(KERN_DEBUG "metric = %i, xm = %i, xn = %i\n", metric, xm, xn);
 +      printk(KERN_DEBUG "pll: m = 0x%x, r = 0x%x, n = 0x%x\n", reg, m, r, n);
  #endif
  }
  
@@@ -1458,9 -1423,9 +1458,9 @@@ static int __devinit snd_sonic_probe(st
                return -ENOENT;
        }
   
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
        for (idx = 0; idx < 5; idx++) {
                if (pci_resource_start(pci, idx) == 0 ||
                    !(pci_resource_flags(pci, idx) & IORESOURCE_IO)) {
diff --combined sound/pci/via82xx.c
index fc62d6380f86f3bf7fc1da244d92618899e92beb,d8705547dae106fb203193e0a3a8d892bbe48bb5..8dbffe6a4af2db9add7e2af671b324f77602f8eb
@@@ -466,10 -466,7 +466,10 @@@ static int build_via_table(struct viade
                                        flag = VIA_TBL_BIT_FLAG; /* period boundary */
                        } else
                                flag = 0; /* period continues to the next */
 -                      // printk("via: tbl %d: at %d  size %d (rest %d)\n", idx, ofs, r, rest);
 +                      /*
 +                      printk(KERN_DEBUG "via: tbl %d: at %d  size %d "
 +                             "(rest %d)\n", idx, ofs, r, rest);
 +                      */
                        ((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag);
                        dev->idx_table[idx].offset = ofs;
                        dev->idx_table[idx].size = r;
@@@ -2436,9 -2433,9 +2436,9 @@@ static int __devinit snd_via82xx_probe(
        unsigned int i;
        int err;
  
-       card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
  
        card_type = pci_id->driver_data;
        switch (card_type) {
index c0d9cc9dad4437974a1238b0741ccb95bc0bbece,c086b762c150a30cfa651c7ff5b7805ad2c461da..0d54e3503c1e6edc4ad80d23f246aa3b034aab12
@@@ -328,10 -328,7 +328,10 @@@ static int build_via_table(struct viade
                                        flag = VIA_TBL_BIT_FLAG; /* period boundary */
                        } else
                                flag = 0; /* period continues to the next */
 -                      // printk("via: tbl %d: at %d  size %d (rest %d)\n", idx, ofs, r, rest);
 +                      /*
 +                      printk(KERN_DEBUG "via: tbl %d: at %d  size %d "
 +                             "(rest %d)\n", idx, ofs, r, rest);
 +                      */
                        ((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag);
                        dev->idx_table[idx].offset = ofs;
                        dev->idx_table[idx].size = r;
@@@ -1170,9 -1167,9 +1170,9 @@@ static int __devinit snd_via82xx_probe(
        unsigned int i;
        int err;
  
-       card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
  
        card_type = pci_id->driver_data;
        switch (card_type) {
diff --combined sound/ppc/snd_ps3.c
index ff321110ec029604bd8cd0e4862940fe1e1b88c4,ef2c3f417175aaec7b2cd656e43866f28f9289db..f361c26506aacefd1b5a683c232163294c6f9480
@@@ -477,7 -477,7 +477,7 @@@ static int snd_ps3_pcm_prepare(struct s
                card->dma_start_bus_addr[SND_PS3_CH_R] =
                        runtime->dma_addr + (runtime->dma_bytes / 2);
  
 -              pr_debug("%s: vaddr=%p bus=%#lx\n", __func__,
 +              pr_debug("%s: vaddr=%p bus=%#llx\n", __func__,
                         card->dma_start_vaddr[SND_PS3_CH_L],
                         card->dma_start_bus_addr[SND_PS3_CH_L]);
  
@@@ -969,11 -969,9 +969,9 @@@ static int __init snd_ps3_driver_probe(
        }
  
        /* create card instance */
-       the_card.card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (!the_card.card) {
-               ret = -ENXIO;
+       ret = snd_card_create(index, id, THIS_MODULE, 0, &the_card.card);
+       if (ret < 0)
                goto clean_irq;
-       }
  
        strcpy(the_card.card->driver, "PS3");
        strcpy(the_card.card->shortname, "PS3");
                pr_info("%s: nullbuffer alloc failed\n", __func__);
                goto clean_preallocate;
        }
 -      pr_debug("%s: null vaddr=%p dma=%#lx\n", __func__,
 +      pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__,
                 the_card.null_buffer_start_vaddr,
                 the_card.null_buffer_start_dma_addr);
        /* set default sample rate/word width */
diff --combined sound/soc/soc-core.c
index 55fdb4abb1796dc728dfedd147dc09eaf01298fc,318dfdd54d7f00065002d1d834e382bd827dea07..8592d95023ed65fc459cd97df1bc3f4dcdea73e9
@@@ -1311,17 -1311,17 +1311,17 @@@ int snd_soc_new_pcms(struct snd_soc_dev
  {
        struct snd_soc_codec *codec = socdev->codec;
        struct snd_soc_card *card = socdev->card;
-       int ret = 0, i;
+       int ret, i;
  
        mutex_lock(&codec->mutex);
  
        /* register a sound card */
-       codec->card = snd_card_new(idx, xid, codec->owner, 0);
-       if (!codec->card) {
+       ret = snd_card_create(idx, xid, codec->owner, 0, &codec->card);
+       if (ret < 0) {
                printk(KERN_ERR "asoc: can't create sound card for codec %s\n",
                        codec->name);
                mutex_unlock(&codec->mutex);
-               return -ENODEV;
+               return ret;
        }
  
        codec->card->dev = socdev->dev;
@@@ -1584,6 -1584,37 +1584,6 @@@ int snd_soc_put_enum_double(struct snd_
  }
  EXPORT_SYMBOL_GPL(snd_soc_put_enum_double);
  
 -/**
 - * snd_soc_info_value_enum_double - semi enumerated double mixer info callback
 - * @kcontrol: mixer control
 - * @uinfo: control element information
 - *
 - * Callback to provide information about a double semi enumerated
 - * mixer control.
 - *
 - * Semi enumerated mixer: the enumerated items are referred as values. Can be
 - * used for handling bitfield coded enumeration for example.
 - *
 - * Returns 0 for success.
 - */
 -int snd_soc_info_value_enum_double(struct snd_kcontrol *kcontrol,
 -      struct snd_ctl_elem_info *uinfo)
 -{
 -      struct soc_value_enum *e = (struct soc_value_enum *)
 -                      kcontrol->private_value;
 -
 -      uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
 -      uinfo->count = e->shift_l == e->shift_r ? 1 : 2;
 -      uinfo->value.enumerated.items = e->max;
 -
 -      if (uinfo->value.enumerated.item > e->max - 1)
 -              uinfo->value.enumerated.item = e->max - 1;
 -      strcpy(uinfo->value.enumerated.name,
 -              e->texts[uinfo->value.enumerated.item]);
 -      return 0;
 -}
 -EXPORT_SYMBOL_GPL(snd_soc_info_value_enum_double);
 -
  /**
   * snd_soc_get_value_enum_double - semi enumerated double mixer get callback
   * @kcontrol: mixer control
@@@ -1600,7 -1631,8 +1600,7 @@@ int snd_soc_get_value_enum_double(struc
        struct snd_ctl_elem_value *ucontrol)
  {
        struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
 -      struct soc_value_enum *e = (struct soc_value_enum *)
 -                      kcontrol->private_value;
 +      struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
        unsigned short reg_val, val, mux;
  
        reg_val = snd_soc_read(codec, e->reg);
@@@ -1639,7 -1671,8 +1639,7 @@@ int snd_soc_put_value_enum_double(struc
        struct snd_ctl_elem_value *ucontrol)
  {
        struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
 -      struct soc_value_enum *e = (struct soc_value_enum *)
 -                      kcontrol->private_value;
 +      struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
        unsigned short val;
        unsigned short mask;
  
diff --combined sound/sparc/amd7930.c
index 7cbc725934e57a1ddd96200fa7b98cae5e28a519,ba38912614b4f90fca9444611ddb2fa1944e87bc..574af56ba8a6fa6d4b690f4b2079ea459281712c
@@@ -954,8 -954,7 +954,8 @@@ static int __devinit snd_amd7930_create
        amd->regs = of_ioremap(&op->resource[0], 0,
                               resource_size(&op->resource[0]), "amd7930");
        if (!amd->regs) {
 -              snd_printk("amd7930-%d: Unable to map chip registers.\n", dev);
 +              snd_printk(KERN_ERR
 +                         "amd7930-%d: Unable to map chip registers.\n", dev);
                return -EIO;
        }
  
  
        if (request_irq(irq, snd_amd7930_interrupt,
                        IRQF_DISABLED | IRQF_SHARED, "amd7930", amd)) {
 -              snd_printk("amd7930-%d: Unable to grab IRQ %d\n",
 +              snd_printk(KERN_ERR "amd7930-%d: Unable to grab IRQ %d\n",
                           dev, irq);
                snd_amd7930_free(amd);
                return -EBUSY;
@@@ -1019,9 -1018,10 +1019,10 @@@ static int __devinit amd7930_sbus_probe
                return -ENOENT;
        }
  
-       card = snd_card_new(index[dev_num], id[dev_num], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev_num], id[dev_num], THIS_MODULE, 0,
+                             &card);
+       if (err < 0)
+               return err;
  
        strcpy(card->driver, "AMD7930");
        strcpy(card->shortname, "Sun AMD7930");
index 41c36b055f6b3f980b7c8217ce6b1496efe6bc43,55a9075cb097371e67a86fd3558e80047f128f1d..09aed2363cc94f466aca559730f64f03f5e0ac08
@@@ -42,7 -42,7 +42,7 @@@
  #endif
  
  MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
 -MODULE_DESCRIPTION("caiaq USB audio, version 1.3.9");
 +MODULE_DESCRIPTION("caiaq USB audio, version 1.3.10");
  MODULE_LICENSE("GPL");
  MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2},"
                         "{Native Instruments, RigKontrol3},"
@@@ -336,9 -336,10 +336,10 @@@ static void __devinit setup_card(struc
                log("Unable to set up control system (ret=%d)\n", ret);
  }
  
- static struct snd_card* create_card(struct usb_device* usb_dev)
+ static int create_card(struct usb_device* usb_dev, struct snd_card **cardp)
  {
        int devnum;
+       int err;
        struct snd_card *card;
        struct snd_usb_caiaqdev *dev;
  
                        break;
  
        if (devnum >= SNDRV_CARDS)
-               return NULL;
+               return -ENODEV;
  
-       card = snd_card_new(index[devnum], id[devnum], THIS_MODULE, 
-                                       sizeof(struct snd_usb_caiaqdev));
-       if (!card)
-               return NULL;
+       err = snd_card_create(index[devnum], id[devnum], THIS_MODULE, 
+                             sizeof(struct snd_usb_caiaqdev), &card);
+       if (err < 0)
+               return err;
  
        dev = caiaqdev(card);
        dev->chip.dev = usb_dev;
        spin_lock_init(&dev->spinlock);
        snd_card_set_dev(card, &usb_dev->dev);
  
-       return card;
+       *cardp = card;
+       return 0;
  }
  
  static int __devinit init_card(struct snd_usb_caiaqdev *dev)
@@@ -441,10 -443,10 +443,10 @@@ static int __devinit snd_probe(struct u
        struct snd_card *card;
        struct usb_device *device = interface_to_usbdev(intf);
        
-       card = create_card(device);
+       ret = create_card(device, &card);
        
-       if (!card)
-               return -ENOMEM;
+       if (ret < 0)
+               return ret;
                        
        usb_set_intfdata(intf, card);
        ret = init_card(caiaqdev(card));