as pr_* macros are more preffered over printk, so printk replaced with corresponding pr_err and pr_alert
this patch will generate a warning from checkpatch for an unnecessary space before new line and has not been fixed as this patch is only for printk replacement.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
}
spin_unlock_irqrestore(&mgr->mgr_lock, flags);
if (err) {
- printk(KERN_ERR "ctxfi: Can't meet AMIXER resource request!\n");
+ pr_err("ctxfi: Can't meet AMIXER resource request!\n");
goto error;
}
}
spin_unlock_irqrestore(&mgr->mgr_lock, flags);
if (err) {
- printk(KERN_ERR "ctxfi: Can't meet SUM resource request!\n");
+ pr_err("ctxfi: Can't meet SUM resource request!\n");
goto error;
}
case SNDRV_PCM_FORMAT_FLOAT_LE:
return SRC_SF_F32;
default:
- printk(KERN_ERR "ctxfi: not recognized snd format is %d \n",
+ pr_err("ctxfi: not recognized snd format is %d \n",
snd_format);
return SRC_SF_S16;
}
p = snd_pci_quirk_lookup_id(vendor_id, device_id, list);
if (p) {
if (p->value < 0) {
- printk(KERN_ERR "ctxfi: "
+ pr_err("ctxfi: "
"Device %04x:%04x is black-listed\n",
vendor_id, device_id);
return -ENOENT;
err = alsa_dev_funcs[i].create(atc, i,
alsa_dev_funcs[i].public_name);
if (err) {
- printk(KERN_ERR "ctxfi: "
+ pr_err("ctxfi: "
"Creating alsa device %d failed!\n", i);
return err;
}
err = create_hw_obj(atc->pci, atc->chip_type, atc->model, &hw);
if (err) {
- printk(KERN_ERR "Failed to create hw obj!!!\n");
+ pr_err("Failed to create hw obj!!!\n");
return err;
}
atc->hw = hw;
err = rsc_mgr_funcs[i].create(atc->hw, &atc->rsc_mgrs[i]);
if (err) {
- printk(KERN_ERR "ctxfi: "
+ pr_err("ctxfi: "
"Failed to create rsc_mgr %d!!!\n", i);
return err;
}
err = daio_mgr->get_daio(daio_mgr, &da_desc,
(struct daio **)&atc->daios[i]);
if (err) {
- printk(KERN_ERR "ctxfi: Failed to get DAIO "
+ pr_err("ctxfi: Failed to get DAIO "
"resource %d!!!\n", i);
return err;
}
/* Do hardware resume. */
err = atc_hw_resume(atc);
if (err < 0) {
- printk(KERN_ERR "ctxfi: pci_enable_device failed, "
+ pr_err("ctxfi: pci_enable_device failed, "
"disabling device\n");
snd_card_disconnect(atc->card);
return err;
/* Find card model */
err = atc_identify_card(atc, ssid);
if (err < 0) {
- printk(KERN_ERR "ctatc: Card not recognised\n");
+ pr_err("ctatc: Card not recognised\n");
goto error1;
}
err = ct_mixer_create(atc, (struct ct_mixer **)&atc->mixer);
if (err) {
- printk(KERN_ERR "ctxfi: Failed to create mixer obj!!!\n");
+ pr_err("ctxfi: Failed to create mixer obj!!!\n");
goto error1;
}
error1:
ct_atc_destroy(atc);
- printk(KERN_ERR "ctxfi: Something wrong!!!\n");
+ pr_err("ctxfi: Something wrong!!!\n");
return err;
}
err = daio_mgr_get_rsc(&mgr->mgr, desc->type);
spin_unlock_irqrestore(&mgr->mgr_lock, flags);
if (err) {
- printk(KERN_ERR "Can't meet DAIO resource request!\n");
+ pr_err("Can't meet DAIO resource request!\n");
return err;
}
/* Set up device page table */
if ((~0UL) == info->vm_pgt_phys) {
- printk(KERN_ERR "Wrong device page table page address!\n");
+ pr_err("Wrong device page table page address!\n");
return -1;
}
mdelay(40);
}
if (i >= 3) {
- printk(KERN_ALERT "PLL initialization failed!!!\n");
+ pr_alert("PLL initialization failed!!!\n");
return -EBUSY;
}
break;
}
if (!get_field(gctl, GCTL_AID)) {
- printk(KERN_ALERT "Card Auto-init failed!!!\n");
+ pr_alert("Card Auto-init failed!!!\n");
return -EBUSY;
}
/* Set DMA transfer mask */
if (pci_set_dma_mask(pci, CT_XFI_DMA_MASK) < 0 ||
pci_set_consistent_dma_mask(pci, CT_XFI_DMA_MASK) < 0) {
- printk(KERN_ERR "architecture does not support PCI "
+ pr_err("architecture does not support PCI "
"busmaster DMA with mask 0x%llx\n",
CT_XFI_DMA_MASK);
err = -ENXIO;
err = request_irq(pci->irq, ct_20k1_interrupt, IRQF_SHARED,
KBUILD_MODNAME, hw);
if (err < 0) {
- printk(KERN_ERR "XFi: Cannot get irq %d\n", pci->irq);
+ pr_err("XFi: Cannot get irq %d\n", pci->irq);
goto error2;
}
hw->irq = pci->irq;
hw_write_20kx(hw, AUDIO_IO_TX_BLRCLK, 0x21212121);
hw_write_20kx(hw, AUDIO_IO_RX_BLRCLK, 0);
} else {
- printk(KERN_ALERT "ctxfi: ERROR!!! Invalid sampling rate!!!\n");
+ pr_alert("ctxfi: ERROR!!! Invalid sampling rate!!!\n");
return -EINVAL;
}
/* Set up device page table */
if ((~0UL) == info->vm_pgt_phys) {
- printk(KERN_ALERT "ctxfi: "
+ pr_alert("ctxfi: "
"Wrong device page table page address!!!\n");
return -1;
}
break;
}
if (i >= 1000) {
- printk(KERN_ALERT "ctxfi: PLL initialization failed!!!\n");
+ pr_alert("ctxfi: PLL initialization failed!!!\n");
return -EBUSY;
}
break;
}
if (!get_field(gctl, GCTL_AID)) {
- printk(KERN_ALERT "ctxfi: Card Auto-init failed!!!\n");
+ pr_alert("ctxfi: Card Auto-init failed!!!\n");
return -EBUSY;
}
/* Initialize I2C */
err = hw20k2_i2c_init(hw, 0x1A, 1, 1);
if (err < 0) {
- printk(KERN_ALERT "ctxfi: Failure to acquire I2C!!!\n");
+ pr_alert("ctxfi: Failure to acquire I2C!!!\n");
goto error;
}
hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_MMC, 0x0A),
MAKE_WM8775_DATA(0x0A));
} else {
- printk(KERN_ALERT "ctxfi: Invalid master sampling "
+ pr_alert("ctxfi: Invalid master sampling "
"rate (msr %d)!!!\n", info->msr);
err = -EINVAL;
goto error;
/* Set DMA transfer mask */
if (pci_set_dma_mask(pci, CT_XFI_DMA_MASK) < 0 ||
pci_set_consistent_dma_mask(pci, CT_XFI_DMA_MASK) < 0) {
- printk(KERN_ERR "ctxfi: architecture does not support PCI "
+ pr_err("ctxfi: architecture does not support PCI "
"busmaster DMA with mask 0x%llx\n", CT_XFI_DMA_MASK);
err = -ENXIO;
goto error1;
err = request_irq(pci->irq, ct_20k2_interrupt, IRQF_SHARED,
KBUILD_MODNAME, hw);
if (err < 0) {
- printk(KERN_ERR "XFi: Cannot get irq %d\n", pci->irq);
+ pr_err("XFi: Cannot get irq %d\n", pci->irq);
goto error2;
}
hw->irq = pci->irq;
for (i = 0; i < (NUM_CT_SUMS * CHN_NUM); i++) {
err = sum_mgr->get_sum(sum_mgr, &sum_desc, &sum);
if (err) {
- printk(KERN_ERR "ctxfi:Failed to get sum resources for "
+ pr_err("ctxfi:Failed to get sum resources for "
"front output!\n");
break;
}
for (i = 0; i < (NUM_CT_AMIXERS * CHN_NUM); i++) {
err = amixer_mgr->get_amixer(amixer_mgr, &am_desc, &amixer);
if (err) {
- printk(KERN_ERR "ctxfi:Failed to get amixer resources "
+ pr_err("ctxfi:Failed to get amixer resources "
"for mixer obj!\n");
break;
}
case DAIO:
break;
default:
- printk(KERN_ERR
+ pr_err(
"ctxfi: Invalid resource type value %d!\n", type);
return -EINVAL;
}
if (err) {
- printk(KERN_ERR
+ pr_err(
"ctxfi: Failed to get resource control block!\n");
return err;
}
case DAIO:
break;
default:
- printk(KERN_ERR "ctxfi: "
+ pr_err("ctxfi: "
"Invalid resource type value %d!\n", rsc->type);
break;
}
case SUM:
break;
default:
- printk(KERN_ERR
+ pr_err(
"ctxfi: Invalid resource type value %d!\n", type);
err = -EINVAL;
goto error;
}
if (err) {
- printk(KERN_ERR
+ pr_err(
"ctxfi: Failed to get manager control block!\n");
goto error;
}
case SUM:
break;
default:
- printk(KERN_ERR "ctxfi: "
+ pr_err("ctxfi: "
"Invalid resource type value %d!\n", mgr->type);
break;
}
spin_unlock_irqrestore(&mgr->mgr_lock, flags);
if (err) {
- printk(KERN_ERR "ctxfi: Can't meet SRC resource request!\n");
+ pr_err("ctxfi: Can't meet SRC resource request!\n");
return err;
}
}
spin_unlock_irqrestore(&mgr->mgr_lock, flags);
if (err) {
- printk(KERN_ERR "ctxfi: Can't meet SRCIMP resource request!\n");
+ pr_err("ctxfi: Can't meet SRCIMP resource request!\n");
goto error1;
}
size = CT_PAGE_ALIGN(size);
if (size > vm->size) {
- printk(KERN_ERR "ctxfi: Fail! No sufficient device virtual "
+ pr_err("ctxfi: Fail! No sufficient device virtual "
"memory space available!\n");
return NULL;
}
block = get_vm_block(vm, size);
if (block == NULL) {
- printk(KERN_ERR "ctxfi: No virtual memory block that is big "
+ pr_err("ctxfi: No virtual memory block that is big "
"enough to allocate!\n");
return NULL;
}
if (err)
return err;
if ((reference_rate != 48000) && (reference_rate != 44100)) {
- printk(KERN_ERR "ctxfi: Invalid reference_rate value %u!!!\n",
+ pr_err("ctxfi: Invalid reference_rate value %u!!!\n",
reference_rate);
- printk(KERN_ERR "ctxfi: The valid values for reference_rate "
+ pr_err("ctxfi: The valid values for reference_rate "
"are 48000 and 44100, Value 48000 is assumed.\n");
reference_rate = 48000;
}
if ((multiple != 1) && (multiple != 2) && (multiple != 4)) {
- printk(KERN_ERR "ctxfi: Invalid multiple value %u!!!\n",
+ pr_err("ctxfi: Invalid multiple value %u!!!\n",
multiple);
- printk(KERN_ERR "ctxfi: The valid values for multiple are "
+ pr_err("ctxfi: The valid values for multiple are "
"1, 2 and 4, Value 2 is assumed.\n");
multiple = 2;
}