--- zzzz-none-000/linux-3.10.107/sound/pci/lx6464es/lx6464es.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/pci/lx6464es/lx6464es.c 2021-02-04 17:41:59.000000000 +0000 @@ -56,14 +56,14 @@ #define PCI_DEVICE_ID_PLX_LX6464ES PCI_DEVICE_ID_PLX_9056 -static DEFINE_PCI_DEVICE_TABLE(snd_lx6464es_ids) = { - { PCI_DEVICE(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_LX6464ES), - .subvendor = PCI_VENDOR_ID_DIGIGRAM, - .subdevice = PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_SERIAL_SUBSYSTEM +static const struct pci_device_id snd_lx6464es_ids[] = { + { PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_LX6464ES, + PCI_VENDOR_ID_DIGIGRAM, + PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_SERIAL_SUBSYSTEM), }, /* LX6464ES */ - { PCI_DEVICE(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_LX6464ES), - .subvendor = PCI_VENDOR_ID_DIGIGRAM, - .subdevice = PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_CAE_SERIAL_SUBSYSTEM + { PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_LX6464ES, + PCI_VENDOR_ID_DIGIGRAM, + PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_CAE_SERIAL_SUBSYSTEM), }, /* LX6464ES-CAE */ { 0, }, }; @@ -112,16 +112,16 @@ snd_pcm_uframes_t period_size = runtime->period_size; - snd_printd(LXP "allocating pipe for %d channels\n", channels); + dev_dbg(chip->card->dev, "allocating pipe for %d channels\n", channels); err = lx_pipe_allocate(chip, 0, is_capture, channels); if (err < 0) { - snd_printk(KERN_ERR LXP "allocating pipe failed\n"); + dev_err(chip->card->dev, LXP "allocating pipe failed\n"); return err; } err = lx_set_granularity(chip, period_size); if (err < 0) { - snd_printk(KERN_ERR LXP "setting granularity to %ld failed\n", + dev_err(chip->card->dev, "setting granularity to %ld failed\n", period_size); return err; } @@ -136,24 +136,24 @@ struct snd_pcm_runtime *runtime = substream->runtime; int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); - snd_printd(LXP "setting stream format\n"); + dev_dbg(chip->card->dev, "setting stream format\n"); err = lx_stream_set_format(chip, runtime, 0, is_capture); if (err < 0) { - snd_printk(KERN_ERR LXP "setting stream format failed\n"); + dev_err(chip->card->dev, "setting stream format failed\n"); return err; } - snd_printd(LXP "starting pipe\n"); + dev_dbg(chip->card->dev, "starting pipe\n"); err = lx_pipe_start(chip, 0, is_capture); if (err < 0) { - snd_printk(KERN_ERR LXP "starting pipe failed\n"); + dev_err(chip->card->dev, "starting pipe failed\n"); return err; } - snd_printd(LXP "waiting for pipe to start\n"); + dev_dbg(chip->card->dev, "waiting for pipe to start\n"); err = lx_pipe_wait_for_start(chip, 0, is_capture); if (err < 0) { - snd_printk(KERN_ERR LXP "waiting for pipe failed\n"); + dev_err(chip->card->dev, "waiting for pipe failed\n"); return err; } @@ -167,24 +167,24 @@ int err = 0; int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); - snd_printd(LXP "pausing pipe\n"); + dev_dbg(chip->card->dev, "pausing pipe\n"); err = lx_pipe_pause(chip, 0, is_capture); if (err < 0) { - snd_printk(KERN_ERR LXP "pausing pipe failed\n"); + dev_err(chip->card->dev, "pausing pipe failed\n"); return err; } - snd_printd(LXP "waiting for pipe to become idle\n"); + dev_dbg(chip->card->dev, "waiting for pipe to become idle\n"); err = lx_pipe_wait_for_idle(chip, 0, is_capture); if (err < 0) { - snd_printk(KERN_ERR LXP "waiting for pipe failed\n"); + dev_err(chip->card->dev, "waiting for pipe failed\n"); return err; } - snd_printd(LXP "stopping pipe\n"); + dev_dbg(chip->card->dev, "stopping pipe\n"); err = lx_pipe_stop(chip, 0, is_capture); if (err < 0) { - snd_printk(LXP "stopping pipe failed\n"); + dev_err(chip->card->dev, "stopping pipe failed\n"); return err; } @@ -198,10 +198,10 @@ int err = 0; int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); - snd_printd(LXP "releasing pipe\n"); + dev_dbg(chip->card->dev, "releasing pipe\n"); err = lx_pipe_release(chip, 0, is_capture); if (err < 0) { - snd_printk(LXP "releasing pipe failed\n"); + dev_err(chip->card->dev, "releasing pipe failed\n"); return err; } @@ -216,7 +216,7 @@ int err = 0; int board_rate; - snd_printdd("->lx_pcm_open\n"); + dev_dbg(chip->card->dev, "->lx_pcm_open\n"); mutex_lock(&chip->setup_mutex); /* copy the struct snd_pcm_hardware struct */ @@ -227,18 +227,18 @@ err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); if (err < 0) { - snd_printk(KERN_WARNING LXP "could not constrain periods\n"); + dev_warn(chip->card->dev, "could not constrain periods\n"); goto exit; } #endif /* the clock rate cannot be changed */ board_rate = chip->board_sample_rate; - err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_RATE, - board_rate, board_rate); + err = snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_RATE, + board_rate); if (err < 0) { - snd_printk(KERN_WARNING LXP "could not constrain periods\n"); + dev_warn(chip->card->dev, "could not constrain periods\n"); goto exit; } @@ -248,7 +248,7 @@ MICROBLAZE_IBL_MIN, MICROBLAZE_IBL_MAX); if (err < 0) { - snd_printk(KERN_WARNING LXP + dev_warn(chip->card->dev, "could not constrain period size\n"); goto exit; } @@ -263,14 +263,14 @@ runtime->private_data = chip; mutex_unlock(&chip->setup_mutex); - snd_printdd("<-lx_pcm_open, %d\n", err); + dev_dbg(chip->card->dev, "<-lx_pcm_open, %d\n", err); return err; } static int lx_pcm_close(struct snd_pcm_substream *substream) { int err = 0; - snd_printdd("->lx_pcm_close\n"); + dev_dbg(substream->pcm->card->dev, "->lx_pcm_close\n"); return err; } @@ -279,19 +279,18 @@ { struct lx6464es *chip = snd_pcm_substream_chip(substream); snd_pcm_uframes_t pos; - unsigned long flags; int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); struct lx_stream *lx_stream = is_capture ? &chip->capture_stream : &chip->playback_stream; - snd_printdd("->lx_pcm_stream_pointer\n"); + dev_dbg(chip->card->dev, "->lx_pcm_stream_pointer\n"); - spin_lock_irqsave(&chip->lock, flags); + mutex_lock(&chip->lock); pos = lx_stream->frame_pos * substream->runtime->period_size; - spin_unlock_irqrestore(&chip->lock, flags); + mutex_unlock(&chip->lock); - snd_printdd(LXP "stream_pointer at %ld\n", pos); + dev_dbg(chip->card->dev, "stream_pointer at %ld\n", pos); return pos; } @@ -301,37 +300,37 @@ int err = 0; const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); - snd_printdd("->lx_pcm_prepare\n"); + dev_dbg(chip->card->dev, "->lx_pcm_prepare\n"); mutex_lock(&chip->setup_mutex); if (chip->hardware_running[is_capture]) { err = lx_hardware_stop(chip, substream); if (err < 0) { - snd_printk(KERN_ERR LXP "failed to stop hardware. " + dev_err(chip->card->dev, "failed to stop hardware. " "Error code %d\n", err); goto exit; } err = lx_hardware_close(chip, substream); if (err < 0) { - snd_printk(KERN_ERR LXP "failed to close hardware. " + dev_err(chip->card->dev, "failed to close hardware. " "Error code %d\n", err); goto exit; } } - snd_printd(LXP "opening hardware\n"); + dev_dbg(chip->card->dev, "opening hardware\n"); err = lx_hardware_open(chip, substream); if (err < 0) { - snd_printk(KERN_ERR LXP "failed to open hardware. " + dev_err(chip->card->dev, "failed to open hardware. " "Error code %d\n", err); goto exit; } err = lx_hardware_start(chip, substream); if (err < 0) { - snd_printk(KERN_ERR LXP "failed to start hardware. " + dev_err(chip->card->dev, "failed to start hardware. " "Error code %d\n", err); goto exit; } @@ -354,7 +353,7 @@ struct lx6464es *chip = snd_pcm_substream_chip(substream); int err = 0; - snd_printdd("->lx_pcm_hw_params\n"); + dev_dbg(chip->card->dev, "->lx_pcm_hw_params\n"); mutex_lock(&chip->setup_mutex); @@ -389,20 +388,20 @@ int err = 0; int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); - snd_printdd("->lx_pcm_hw_free\n"); + dev_dbg(chip->card->dev, "->lx_pcm_hw_free\n"); mutex_lock(&chip->setup_mutex); if (chip->hardware_running[is_capture]) { err = lx_hardware_stop(chip, substream); if (err < 0) { - snd_printk(KERN_ERR LXP "failed to stop hardware. " + dev_err(chip->card->dev, "failed to stop hardware. " "Error code %d\n", err); goto exit; } err = lx_hardware_close(chip, substream); if (err < 0) { - snd_printk(KERN_ERR LXP "failed to close hardware. " + dev_err(chip->card->dev, "failed to close hardware. " "Error code %d\n", err); goto exit; } @@ -413,9 +412,9 @@ err = snd_pcm_lib_free_pages(substream); if (is_capture) - chip->capture_stream.stream = 0; + chip->capture_stream.stream = NULL; else - chip->playback_stream.stream = 0; + chip->playback_stream.stream = NULL; exit: mutex_unlock(&chip->setup_mutex); @@ -446,25 +445,25 @@ err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed, size_array); - snd_printdd(LXP "starting: needed %d, freed %d\n", + dev_dbg(chip->card->dev, "starting: needed %d, freed %d\n", needed, freed); err = lx_buffer_give(chip, 0, is_capture, period_bytes, lower_32_bits(buf), upper_32_bits(buf), &buffer_index); - snd_printdd(LXP "starting: buffer index %x on %p (%d bytes)\n", - buffer_index, (void *)buf, period_bytes); + dev_dbg(chip->card->dev, "starting: buffer index %x on 0x%lx (%d bytes)\n", + buffer_index, (unsigned long)buf, period_bytes); buf += period_bytes; } err = lx_buffer_ask(chip, 0, is_capture, &needed, &freed, size_array); - snd_printdd(LXP "starting: needed %d, freed %d\n", needed, freed); + dev_dbg(chip->card->dev, "starting: needed %d, freed %d\n", needed, freed); - snd_printd(LXP "starting: starting stream\n"); + dev_dbg(chip->card->dev, "starting: starting stream\n"); err = lx_stream_start(chip, 0, is_capture); if (err < 0) - snd_printk(KERN_ERR LXP "couldn't start stream\n"); + dev_err(chip->card->dev, "couldn't start stream\n"); else lx_stream->status = LX_STREAM_STATUS_RUNNING; @@ -476,17 +475,17 @@ const unsigned int is_capture = lx_stream->is_capture; int err; - snd_printd(LXP "stopping: stopping stream\n"); + dev_dbg(chip->card->dev, "stopping: stopping stream\n"); err = lx_stream_stop(chip, 0, is_capture); if (err < 0) - snd_printk(KERN_ERR LXP "couldn't stop stream\n"); + dev_err(chip->card->dev, "couldn't stop stream\n"); else lx_stream->status = LX_STREAM_STATUS_FREE; } -static void lx_trigger_tasklet_dispatch_stream(struct lx6464es *chip, - struct lx_stream *lx_stream) +static void lx_trigger_dispatch_stream(struct lx6464es *chip, + struct lx_stream *lx_stream) { switch (lx_stream->status) { case LX_STREAM_STATUS_SCHEDULE_RUN: @@ -502,24 +501,12 @@ } } -static void lx_trigger_tasklet(unsigned long data) -{ - struct lx6464es *chip = (struct lx6464es *)data; - unsigned long flags; - - snd_printdd("->lx_trigger_tasklet\n"); - - spin_lock_irqsave(&chip->lock, flags); - lx_trigger_tasklet_dispatch_stream(chip, &chip->capture_stream); - lx_trigger_tasklet_dispatch_stream(chip, &chip->playback_stream); - spin_unlock_irqrestore(&chip->lock, flags); -} - static int lx_pcm_trigger_dispatch(struct lx6464es *chip, struct lx_stream *lx_stream, int cmd) { int err = 0; + mutex_lock(&chip->lock); switch (cmd) { case SNDRV_PCM_TRIGGER_START: lx_stream->status = LX_STREAM_STATUS_SCHEDULE_RUN; @@ -533,9 +520,12 @@ err = -EINVAL; goto exit; } - tasklet_schedule(&chip->trigger_tasklet); + + lx_trigger_dispatch_stream(chip, &chip->capture_stream); + lx_trigger_dispatch_stream(chip, &chip->playback_stream); exit: + mutex_unlock(&chip->lock); return err; } @@ -547,14 +537,14 @@ struct lx_stream *stream = is_capture ? &chip->capture_stream : &chip->playback_stream; - snd_printdd("->lx_pcm_trigger\n"); + dev_dbg(chip->card->dev, "->lx_pcm_trigger\n"); return lx_pcm_trigger_dispatch(chip, stream, cmd); } static int snd_lx6464es_free(struct lx6464es *chip) { - snd_printdd("->snd_lx6464es_free\n"); + dev_dbg(chip->card->dev, "->snd_lx6464es_free\n"); lx_irq_disable(chip); @@ -583,7 +573,7 @@ int i; u32 plx_reg = lx_plx_reg_read(chip, ePLX_CHIPSC); - snd_printdd("->lx_init_xilinx_reset\n"); + dev_dbg(chip->card->dev, "->lx_init_xilinx_reset\n"); /* activate reset of xilinx */ plx_reg &= ~CHIPSC_RESET_XILINX; @@ -603,8 +593,8 @@ msleep(10); reg_mbox3 = lx_plx_reg_read(chip, ePLX_MBOX3); if (reg_mbox3) { - snd_printd(LXP "xilinx reset done\n"); - snd_printdd(LXP "xilinx took %d loops\n", i); + dev_dbg(chip->card->dev, "xilinx reset done\n"); + dev_dbg(chip->card->dev, "xilinx took %d loops\n", i); break; } } @@ -624,7 +614,7 @@ { u32 reg; - snd_printdd("->lx_init_xilinx_test\n"); + dev_dbg(chip->card->dev, "->lx_init_xilinx_test\n"); /* TEST if we have access to Xilinx/MicroBlaze */ lx_dsp_reg_write(chip, eReg_CSM, 0); @@ -632,19 +622,19 @@ reg = lx_dsp_reg_read(chip, eReg_CSM); if (reg) { - snd_printk(KERN_ERR LXP "Problem: Reg_CSM %x.\n", reg); + dev_err(chip->card->dev, "Problem: Reg_CSM %x.\n", reg); /* PCI9056_SPACE0_REMAP */ lx_plx_reg_write(chip, ePLX_PCICR, 1); reg = lx_dsp_reg_read(chip, eReg_CSM); if (reg) { - snd_printk(KERN_ERR LXP "Error: Reg_CSM %x.\n", reg); + dev_err(chip->card->dev, "Error: Reg_CSM %x.\n", reg); return -EAGAIN; /* seems to be appropriate */ } } - snd_printd(LXP "Xilinx/MicroBlaze access test successful\n"); + dev_dbg(chip->card->dev, "Xilinx/MicroBlaze access test successful\n"); return 0; } @@ -661,7 +651,7 @@ (64 << IOCR_OUTPUTS_OFFSET) | (FREQ_RATIO_SINGLE_MODE << FREQ_RATIO_OFFSET); - snd_printdd("->lx_init_ethersound\n"); + dev_dbg(chip->card->dev, "->lx_init_ethersound\n"); chip->freq_ratio = FREQ_RATIO_SINGLE_MODE; @@ -675,18 +665,18 @@ for (i = 0; i != 1000; ++i) { if (lx_dsp_reg_read(chip, eReg_CSES) & 4) { - snd_printd(LXP "ethersound initialized after %dms\n", + dev_dbg(chip->card->dev, "ethersound initialized after %dms\n", i); goto ethersound_initialized; } msleep(1); } - snd_printk(KERN_WARNING LXP + dev_warn(chip->card->dev, "ethersound could not be initialized after %dms\n", i); return -ETIMEDOUT; ethersound_initialized: - snd_printd(LXP "ethersound initialized\n"); + dev_dbg(chip->card->dev, "ethersound initialized\n"); return 0; } @@ -696,14 +686,14 @@ int err; - snd_printdd("->lx_init_get_version_features\n"); + dev_dbg(chip->card->dev, "->lx_init_get_version_features\n"); err = lx_dsp_get_version(chip, &dsp_version); if (err == 0) { u32 freq; - snd_printk(LXP "DSP version: V%02d.%02d #%d\n", + dev_info(chip->card->dev, "DSP version: V%02d.%02d #%d\n", (dsp_version>>16) & 0xff, (dsp_version>>8) & 0xff, dsp_version & 0xff); @@ -718,9 +708,9 @@ err = lx_dsp_get_clock_frequency(chip, &freq); if (err == 0) chip->board_sample_rate = freq; - snd_printd(LXP "actual clock frequency %d\n", freq); + dev_dbg(chip->card->dev, "actual clock frequency %d\n", freq); } else { - snd_printk(KERN_ERR LXP "DSP corrupted \n"); + dev_err(chip->card->dev, "DSP corrupted \n"); err = -EAGAIN; } @@ -732,7 +722,7 @@ int err = 0; u32 snapped_gran = MICROBLAZE_IBL_MIN; - snd_printdd("->lx_set_granularity\n"); + dev_dbg(chip->card->dev, "->lx_set_granularity\n"); /* blocksize is a power of 2 */ while ((snapped_gran < gran) && @@ -745,14 +735,14 @@ err = lx_dsp_set_granularity(chip, snapped_gran); if (err < 0) { - snd_printk(KERN_WARNING LXP "could not set granularity\n"); + dev_warn(chip->card->dev, "could not set granularity\n"); err = -EAGAIN; } if (snapped_gran != gran) - snd_printk(LXP "snapped blocksize to %d\n", snapped_gran); + dev_err(chip->card->dev, "snapped blocksize to %d\n", snapped_gran); - snd_printd(LXP "set blocksize on board %d\n", snapped_gran); + dev_dbg(chip->card->dev, "set blocksize on board %d\n", snapped_gran); chip->pcm_granularity = snapped_gran; return err; @@ -764,19 +754,19 @@ int err; int i; - snd_printdd("->lx_init_dsp\n"); + dev_dbg(chip->card->dev, "->lx_init_dsp\n"); - snd_printd(LXP "initialize board\n"); + dev_dbg(chip->card->dev, "initialize board\n"); err = lx_init_xilinx_reset(chip); if (err) return err; - snd_printd(LXP "testing board\n"); + dev_dbg(chip->card->dev, "testing board\n"); err = lx_init_xilinx_test(chip); if (err) return err; - snd_printd(LXP "initialize ethersound configuration\n"); + dev_dbg(chip->card->dev, "initialize ethersound configuration\n"); err = lx_init_ethersound_config(chip); if (err) return err; @@ -797,8 +787,9 @@ return -ETIMEDOUT; mac_ready: - snd_printd(LXP "mac address ready read after: %dms\n", i); - snd_printk(LXP "mac address: %02X.%02X.%02X.%02X.%02X.%02X\n", + dev_dbg(chip->card->dev, "mac address ready read after: %dms\n", i); + dev_info(chip->card->dev, + "mac address: %02X.%02X.%02X.%02X.%02X.%02X\n", chip->mac_address[0], chip->mac_address[1], chip->mac_address[2], chip->mac_address[3], chip->mac_address[4], chip->mac_address[5]); @@ -860,6 +851,7 @@ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &lx_ops_capture); pcm->info_flags = 0; + pcm->nonatomic = true; strcpy(pcm->name, card_name); err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, @@ -977,7 +969,7 @@ .dev_free = snd_lx6464es_dev_free, }; - snd_printdd("->snd_lx6464es_create\n"); + dev_dbg(card->dev, "->snd_lx6464es_create\n"); *rchip = NULL; @@ -989,10 +981,10 @@ pci_set_master(pci); /* check if we can restrict PCI DMA transfers to 32 bits */ - err = pci_set_dma_mask(pci, DMA_BIT_MASK(32)); + err = dma_set_mask(&pci->dev, DMA_BIT_MASK(32)); if (err < 0) { - snd_printk(KERN_ERR "architecture does not support " - "32bit PCI busmaster DMA\n"); + dev_err(card->dev, + "architecture does not support 32bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; } @@ -1008,15 +1000,9 @@ chip->irq = -1; /* initialize synchronization structs */ - spin_lock_init(&chip->lock); - spin_lock_init(&chip->msg_lock); + mutex_init(&chip->lock); + mutex_init(&chip->msg_lock); mutex_init(&chip->setup_mutex); - tasklet_init(&chip->trigger_tasklet, lx_trigger_tasklet, - (unsigned long)chip); - tasklet_init(&chip->tasklet_capture, lx_tasklet_capture, - (unsigned long)chip); - tasklet_init(&chip->tasklet_playback, lx_tasklet_playback, - (unsigned long)chip); /* request resources */ err = pci_request_regions(pci, card_name); @@ -1031,10 +1017,10 @@ /* dsp port */ chip->port_dsp_bar = pci_ioremap_bar(pci, 2); - err = request_irq(pci->irq, lx_interrupt, IRQF_SHARED, - KBUILD_MODNAME, chip); + err = request_threaded_irq(pci->irq, lx_interrupt, lx_threaded_irq, + IRQF_SHARED, KBUILD_MODNAME, chip); if (err) { - snd_printk(KERN_ERR LXP "unable to grab IRQ %d\n", pci->irq); + dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); goto request_irq_failed; } chip->irq = pci->irq; @@ -1045,7 +1031,7 @@ err = lx_init_dsp(chip); if (err < 0) { - snd_printk(KERN_ERR LXP "error during DSP initialization\n"); + dev_err(card->dev, "error during DSP initialization\n"); return err; } @@ -1062,8 +1048,6 @@ if (err < 0) return err; - snd_card_set_dev(card, &pci->dev); - *rchip = chip; return 0; @@ -1090,7 +1074,7 @@ struct lx6464es *chip; int err; - snd_printdd("->snd_lx6464es_probe\n"); + dev_dbg(&pci->dev, "->snd_lx6464es_probe\n"); if (dev >= SNDRV_CARDS) return -ENODEV; @@ -1099,13 +1083,14 @@ return -ENOENT; } - err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); + err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, + 0, &card); if (err < 0) return err; err = snd_lx6464es_create(card, pci, &chip); if (err < 0) { - snd_printk(KERN_ERR LXP "error during snd_lx6464es_create\n"); + dev_err(card->dev, "error during snd_lx6464es_create\n"); goto out_free; } @@ -1125,7 +1110,7 @@ if (err < 0) goto out_free; - snd_printdd(LXP "initialization successful\n"); + dev_dbg(chip->card->dev, "initialization successful\n"); pci_set_drvdata(pci, card); dev++; return 0; @@ -1139,7 +1124,6 @@ static void snd_lx6464es_remove(struct pci_dev *pci) { snd_card_free(pci_get_drvdata(pci)); - pci_set_drvdata(pci, NULL); }