aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2014-09-29 05:03:26 -0400
committerTakashi Iwai <tiwai@suse.de>2014-09-30 04:36:59 -0400
commit0cae90a96c15f2fd3bd139ba5505755c9c9ef2eb (patch)
tree36432fccc1f0898a62bcc083d41cbe10e3075f4c
parenta45c4d5142595a9b7907499f6d67f702bc20aeb4 (diff)
ALSA: ctxfi: pr_* replaced with dev_*
pr_* macros replaced with dev_* as they are more preffered over pr_*. each file which had pr_* was reviewed manually and replaced with dev_*. here we have actually used the various snd_card which was added to some structures of ctxfi via a previous patch of this series. in the ctvmem.c file we have passed a reference of ct_atc as an argument to get_vm_block function so that it can be used from dev_*. since dev_* will print the device information , so the prefix of "ctxfi" from the various pr_* were also removed. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/ctxfi/ctamixer.c6
-rw-r--r--sound/pci/ctxfi/ctatc.c27
-rw-r--r--sound/pci/ctxfi/ctdaio.c3
-rw-r--r--sound/pci/ctxfi/cthw20k1.c15
-rw-r--r--sound/pci/ctxfi/cthw20k2.c24
-rw-r--r--sound/pci/ctxfi/ctmixer.c6
-rw-r--r--sound/pci/ctxfi/ctpcm.c9
-rw-r--r--sound/pci/ctxfi/ctresource.c18
-rw-r--r--sound/pci/ctxfi/ctsrc.c6
-rw-r--r--sound/pci/ctxfi/ctvmem.c12
-rw-r--r--sound/pci/ctxfi/xfi.c15
11 files changed, 89 insertions, 52 deletions
diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c
index 4d389c330978..c7dc38d41b7f 100644
--- a/sound/pci/ctxfi/ctamixer.c
+++ b/sound/pci/ctxfi/ctamixer.c
@@ -258,7 +258,8 @@ static int get_amixer_rsc(struct amixer_mgr *mgr,
258 } 258 }
259 spin_unlock_irqrestore(&mgr->mgr_lock, flags); 259 spin_unlock_irqrestore(&mgr->mgr_lock, flags);
260 if (err) { 260 if (err) {
261 pr_err("ctxfi: Can't meet AMIXER resource request!\n"); 261 dev_err(mgr->card->dev,
262 "Can't meet AMIXER resource request!\n");
262 goto error; 263 goto error;
263 } 264 }
264 265
@@ -412,7 +413,8 @@ static int get_sum_rsc(struct sum_mgr *mgr,
412 } 413 }
413 spin_unlock_irqrestore(&mgr->mgr_lock, flags); 414 spin_unlock_irqrestore(&mgr->mgr_lock, flags);
414 if (err) { 415 if (err) {
415 pr_err("ctxfi: Can't meet SUM resource request!\n"); 416 dev_err(mgr->card->dev,
417 "Can't meet SUM resource request!\n");
416 goto error; 418 goto error;
417 } 419 }
418 420
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index d62aa9e2adcd..454659074390 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -186,7 +186,7 @@ static unsigned int convert_format(snd_pcm_format_t snd_format,
186 case SNDRV_PCM_FORMAT_FLOAT_LE: 186 case SNDRV_PCM_FORMAT_FLOAT_LE:
187 return SRC_SF_F32; 187 return SRC_SF_F32;
188 default: 188 default:
189 pr_err("ctxfi: not recognized snd format is %d\n", 189 dev_err(card->dev, "not recognized snd format is %d\n",
190 snd_format); 190 snd_format);
191 return SRC_SF_S16; 191 return SRC_SF_S16;
192 } 192 }
@@ -1286,8 +1286,9 @@ static int atc_identify_card(struct ct_atc *atc, unsigned int ssid)
1286 p = snd_pci_quirk_lookup_id(vendor_id, device_id, list); 1286 p = snd_pci_quirk_lookup_id(vendor_id, device_id, list);
1287 if (p) { 1287 if (p) {
1288 if (p->value < 0) { 1288 if (p->value < 0) {
1289 pr_err("ctxfi: Device %04x:%04x is black-listed\n", 1289 dev_err(atc->card->dev,
1290 vendor_id, device_id); 1290 "Device %04x:%04x is black-listed\n",
1291 vendor_id, device_id);
1291 return -ENOENT; 1292 return -ENOENT;
1292 } 1293 }
1293 atc->model = p->value; 1294 atc->model = p->value;
@@ -1318,7 +1319,8 @@ int ct_atc_create_alsa_devs(struct ct_atc *atc)
1318 err = alsa_dev_funcs[i].create(atc, i, 1319 err = alsa_dev_funcs[i].create(atc, i,
1319 alsa_dev_funcs[i].public_name); 1320 alsa_dev_funcs[i].public_name);
1320 if (err) { 1321 if (err) {
1321 pr_err("ctxfi: Creating alsa device %d failed!\n", i); 1322 dev_err(atc->card->dev,
1323 "Creating alsa device %d failed!\n", i);
1322 return err; 1324 return err;
1323 } 1325 }
1324 } 1326 }
@@ -1334,7 +1336,7 @@ static int atc_create_hw_devs(struct ct_atc *atc)
1334 1336
1335 err = create_hw_obj(atc->pci, atc->chip_type, atc->model, &hw); 1337 err = create_hw_obj(atc->pci, atc->chip_type, atc->model, &hw);
1336 if (err) { 1338 if (err) {
1337 pr_err("Failed to create hw obj!!!\n"); 1339 dev_err(atc->card->dev, "Failed to create hw obj!!!\n");
1338 return err; 1340 return err;
1339 } 1341 }
1340 hw->card = atc->card; 1342 hw->card = atc->card;
@@ -1354,7 +1356,8 @@ static int atc_create_hw_devs(struct ct_atc *atc)
1354 1356
1355 err = rsc_mgr_funcs[i].create(atc->hw, &atc->rsc_mgrs[i]); 1357 err = rsc_mgr_funcs[i].create(atc->hw, &atc->rsc_mgrs[i]);
1356 if (err) { 1358 if (err) {
1357 pr_err("ctxfi: Failed to create rsc_mgr %d!!!\n", i); 1359 dev_err(atc->card->dev,
1360 "Failed to create rsc_mgr %d!!!\n", i);
1358 return err; 1361 return err;
1359 } 1362 }
1360 } 1363 }
@@ -1401,7 +1404,8 @@ static int atc_get_resources(struct ct_atc *atc)
1401 err = daio_mgr->get_daio(daio_mgr, &da_desc, 1404 err = daio_mgr->get_daio(daio_mgr, &da_desc,
1402 (struct daio **)&atc->daios[i]); 1405 (struct daio **)&atc->daios[i]);
1403 if (err) { 1406 if (err) {
1404 pr_err("ctxfi: Failed to get DAIO resource %d!!!\n", 1407 dev_err(atc->card->dev,
1408 "Failed to get DAIO resource %d!!!\n",
1405 i); 1409 i);
1406 return err; 1410 return err;
1407 } 1411 }
@@ -1605,7 +1609,8 @@ static int atc_resume(struct ct_atc *atc)
1605 /* Do hardware resume. */ 1609 /* Do hardware resume. */
1606 err = atc_hw_resume(atc); 1610 err = atc_hw_resume(atc);
1607 if (err < 0) { 1611 if (err < 0) {
1608 pr_err("ctxfi: pci_enable_device failed, disabling device\n"); 1612 dev_err(atc->card->dev,
1613 "pci_enable_device failed, disabling device\n");
1609 snd_card_disconnect(atc->card); 1614 snd_card_disconnect(atc->card);
1610 return err; 1615 return err;
1611 } 1616 }
@@ -1702,7 +1707,7 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
1702 /* Find card model */ 1707 /* Find card model */
1703 err = atc_identify_card(atc, ssid); 1708 err = atc_identify_card(atc, ssid);
1704 if (err < 0) { 1709 if (err < 0) {
1705 pr_err("ctatc: Card not recognised\n"); 1710 dev_err(card->dev, "ctatc: Card not recognised\n");
1706 goto error1; 1711 goto error1;
1707 } 1712 }
1708 1713
@@ -1718,7 +1723,7 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
1718 1723
1719 err = ct_mixer_create(atc, (struct ct_mixer **)&atc->mixer); 1724 err = ct_mixer_create(atc, (struct ct_mixer **)&atc->mixer);
1720 if (err) { 1725 if (err) {
1721 pr_err("ctxfi: Failed to create mixer obj!!!\n"); 1726 dev_err(card->dev, "Failed to create mixer obj!!!\n");
1722 goto error1; 1727 goto error1;
1723 } 1728 }
1724 1729
@@ -1745,6 +1750,6 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
1745 1750
1746error1: 1751error1:
1747 ct_atc_destroy(atc); 1752 ct_atc_destroy(atc);
1748 pr_err("ctxfi: Something wrong!!!\n"); 1753 dev_err(card->dev, "Something wrong!!!\n");
1749 return err; 1754 return err;
1750} 1755}
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
index 212280e11f6e..c1c3f8816fff 100644
--- a/sound/pci/ctxfi/ctdaio.c
+++ b/sound/pci/ctxfi/ctdaio.c
@@ -539,7 +539,8 @@ static int get_daio_rsc(struct daio_mgr *mgr,
539 err = daio_mgr_get_rsc(&mgr->mgr, desc->type); 539 err = daio_mgr_get_rsc(&mgr->mgr, desc->type);
540 spin_unlock_irqrestore(&mgr->mgr_lock, flags); 540 spin_unlock_irqrestore(&mgr->mgr_lock, flags);
541 if (err) { 541 if (err) {
542 pr_err("Can't meet DAIO resource request!\n"); 542 dev_err(mgr->card->dev,
543 "Can't meet DAIO resource request!\n");
543 return err; 544 return err;
544 } 545 }
545 546
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c
index 8fc524fbaeab..b425aa8ee578 100644
--- a/sound/pci/ctxfi/cthw20k1.c
+++ b/sound/pci/ctxfi/cthw20k1.c
@@ -1268,7 +1268,8 @@ static int hw_trn_init(struct hw *hw, const struct trn_conf *info)
1268 1268
1269 /* Set up device page table */ 1269 /* Set up device page table */
1270 if ((~0UL) == info->vm_pgt_phys) { 1270 if ((~0UL) == info->vm_pgt_phys) {
1271 pr_err("Wrong device page table page address!\n"); 1271 dev_err(hw->card->dev,
1272 "Wrong device page table page address!\n");
1272 return -1; 1273 return -1;
1273 } 1274 }
1274 1275
@@ -1327,7 +1328,7 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr)
1327 mdelay(40); 1328 mdelay(40);
1328 } 1329 }
1329 if (i >= 3) { 1330 if (i >= 3) {
1330 pr_alert("PLL initialization failed!!!\n"); 1331 dev_alert(hw->card->dev, "PLL initialization failed!!!\n");
1331 return -EBUSY; 1332 return -EBUSY;
1332 } 1333 }
1333 1334
@@ -1351,7 +1352,7 @@ static int hw_auto_init(struct hw *hw)
1351 break; 1352 break;
1352 } 1353 }
1353 if (!get_field(gctl, GCTL_AID)) { 1354 if (!get_field(gctl, GCTL_AID)) {
1354 pr_alert("Card Auto-init failed!!!\n"); 1355 dev_alert(hw->card->dev, "Card Auto-init failed!!!\n");
1355 return -EBUSY; 1356 return -EBUSY;
1356 } 1357 }
1357 1358
@@ -1911,8 +1912,9 @@ static int hw_card_start(struct hw *hw)
1911 /* Set DMA transfer mask */ 1912 /* Set DMA transfer mask */
1912 if (pci_set_dma_mask(pci, CT_XFI_DMA_MASK) < 0 || 1913 if (pci_set_dma_mask(pci, CT_XFI_DMA_MASK) < 0 ||
1913 pci_set_consistent_dma_mask(pci, CT_XFI_DMA_MASK) < 0) { 1914 pci_set_consistent_dma_mask(pci, CT_XFI_DMA_MASK) < 0) {
1914 pr_err("architecture does not support PCI busmaster DMA with mask 0x%llx\n", 1915 dev_err(hw->card->dev,
1915 CT_XFI_DMA_MASK); 1916 "architecture does not support PCI busmaster DMA with mask 0x%llx\n",
1917 CT_XFI_DMA_MASK);
1916 err = -ENXIO; 1918 err = -ENXIO;
1917 goto error1; 1919 goto error1;
1918 } 1920 }
@@ -1941,7 +1943,8 @@ static int hw_card_start(struct hw *hw)
1941 err = request_irq(pci->irq, ct_20k1_interrupt, IRQF_SHARED, 1943 err = request_irq(pci->irq, ct_20k1_interrupt, IRQF_SHARED,
1942 KBUILD_MODNAME, hw); 1944 KBUILD_MODNAME, hw);
1943 if (err < 0) { 1945 if (err < 0) {
1944 pr_err("XFi: Cannot get irq %d\n", pci->irq); 1946 dev_err(hw->card->dev,
1947 "XFi: Cannot get irq %d\n", pci->irq);
1945 goto error2; 1948 goto error2;
1946 } 1949 }
1947 hw->irq = pci->irq; 1950 hw->irq = pci->irq;
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index b2c5d5a05a95..253899d13790 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -1187,7 +1187,8 @@ static int hw_daio_init(struct hw *hw, const struct daio_conf *info)
1187 hw_write_20kx(hw, AUDIO_IO_TX_BLRCLK, 0x21212121); 1187 hw_write_20kx(hw, AUDIO_IO_TX_BLRCLK, 0x21212121);
1188 hw_write_20kx(hw, AUDIO_IO_RX_BLRCLK, 0); 1188 hw_write_20kx(hw, AUDIO_IO_RX_BLRCLK, 0);
1189 } else { 1189 } else {
1190 pr_alert("ctxfi: ERROR!!! Invalid sampling rate!!!\n"); 1190 dev_alert(hw->card->dev,
1191 "ERROR!!! Invalid sampling rate!!!\n");
1191 return -EINVAL; 1192 return -EINVAL;
1192 } 1193 }
1193 1194
@@ -1246,7 +1247,8 @@ static int hw_trn_init(struct hw *hw, const struct trn_conf *info)
1246 1247
1247 /* Set up device page table */ 1248 /* Set up device page table */
1248 if ((~0UL) == info->vm_pgt_phys) { 1249 if ((~0UL) == info->vm_pgt_phys) {
1249 pr_alert("ctxfi: Wrong device page table page address!!!\n"); 1250 dev_alert(hw->card->dev,
1251 "Wrong device page table page address!!!\n");
1250 return -1; 1252 return -1;
1251 } 1253 }
1252 1254
@@ -1351,7 +1353,8 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr)
1351 break; 1353 break;
1352 } 1354 }
1353 if (i >= 1000) { 1355 if (i >= 1000) {
1354 pr_alert("ctxfi: PLL initialization failed!!!\n"); 1356 dev_alert(hw->card->dev,
1357 "PLL initialization failed!!!\n");
1355 return -EBUSY; 1358 return -EBUSY;
1356 } 1359 }
1357 1360
@@ -1375,7 +1378,7 @@ static int hw_auto_init(struct hw *hw)
1375 break; 1378 break;
1376 } 1379 }
1377 if (!get_field(gctl, GCTL_AID)) { 1380 if (!get_field(gctl, GCTL_AID)) {
1378 pr_alert("ctxfi: Card Auto-init failed!!!\n"); 1381 dev_alert(hw->card->dev, "Card Auto-init failed!!!\n");
1379 return -EBUSY; 1382 return -EBUSY;
1380 } 1383 }
1381 1384
@@ -1846,7 +1849,7 @@ static int hw_adc_init(struct hw *hw, const struct adc_conf *info)
1846 /* Initialize I2C */ 1849 /* Initialize I2C */
1847 err = hw20k2_i2c_init(hw, 0x1A, 1, 1); 1850 err = hw20k2_i2c_init(hw, 0x1A, 1, 1);
1848 if (err < 0) { 1851 if (err < 0) {
1849 pr_alert("ctxfi: Failure to acquire I2C!!!\n"); 1852 dev_alert(hw->card->dev, "Failure to acquire I2C!!!\n");
1850 goto error; 1853 goto error;
1851 } 1854 }
1852 1855
@@ -1889,8 +1892,9 @@ static int hw_adc_init(struct hw *hw, const struct adc_conf *info)
1889 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_MMC, 0x0A), 1892 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_MMC, 0x0A),
1890 MAKE_WM8775_DATA(0x0A)); 1893 MAKE_WM8775_DATA(0x0A));
1891 } else { 1894 } else {
1892 pr_alert("ctxfi: Invalid master sampling rate (msr %d)!!!\n", 1895 dev_alert(hw->card->dev,
1893 info->msr); 1896 "Invalid master sampling rate (msr %d)!!!\n",
1897 info->msr);
1894 err = -EINVAL; 1898 err = -EINVAL;
1895 goto error; 1899 goto error;
1896 } 1900 }
@@ -2033,7 +2037,8 @@ static int hw_card_start(struct hw *hw)
2033 /* Set DMA transfer mask */ 2037 /* Set DMA transfer mask */
2034 if (pci_set_dma_mask(pci, CT_XFI_DMA_MASK) < 0 || 2038 if (pci_set_dma_mask(pci, CT_XFI_DMA_MASK) < 0 ||
2035 pci_set_consistent_dma_mask(pci, CT_XFI_DMA_MASK) < 0) { 2039 pci_set_consistent_dma_mask(pci, CT_XFI_DMA_MASK) < 0) {
2036 pr_err("ctxfi: architecture does not support PCI busmaster DMA with mask 0x%llx\n", 2040 dev_err(hw->card->dev,
2041 "architecture does not support PCI busmaster DMA with mask 0x%llx\n",
2037 CT_XFI_DMA_MASK); 2042 CT_XFI_DMA_MASK);
2038 err = -ENXIO; 2043 err = -ENXIO;
2039 goto error1; 2044 goto error1;
@@ -2062,7 +2067,8 @@ static int hw_card_start(struct hw *hw)
2062 err = request_irq(pci->irq, ct_20k2_interrupt, IRQF_SHARED, 2067 err = request_irq(pci->irq, ct_20k2_interrupt, IRQF_SHARED,
2063 KBUILD_MODNAME, hw); 2068 KBUILD_MODNAME, hw);
2064 if (err < 0) { 2069 if (err < 0) {
2065 pr_err("XFi: Cannot get irq %d\n", pci->irq); 2070 dev_err(hw->card->dev,
2071 "XFi: Cannot get irq %d\n", pci->irq);
2066 goto error2; 2072 goto error2;
2067 } 2073 }
2068 hw->irq = pci->irq; 2074 hw->irq = pci->irq;
diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c
index 017fa91706d4..4f4a2a5dedb8 100644
--- a/sound/pci/ctxfi/ctmixer.c
+++ b/sound/pci/ctxfi/ctmixer.c
@@ -854,7 +854,8 @@ static int ct_mixer_get_resources(struct ct_mixer *mixer)
854 for (i = 0; i < (NUM_CT_SUMS * CHN_NUM); i++) { 854 for (i = 0; i < (NUM_CT_SUMS * CHN_NUM); i++) {
855 err = sum_mgr->get_sum(sum_mgr, &sum_desc, &sum); 855 err = sum_mgr->get_sum(sum_mgr, &sum_desc, &sum);
856 if (err) { 856 if (err) {
857 pr_err("ctxfi:Failed to get sum resources for front output!\n"); 857 dev_err(mixer->atc->card->dev,
858 "Failed to get sum resources for front output!\n");
858 break; 859 break;
859 } 860 }
860 mixer->sums[i] = sum; 861 mixer->sums[i] = sum;
@@ -868,7 +869,8 @@ static int ct_mixer_get_resources(struct ct_mixer *mixer)
868 for (i = 0; i < (NUM_CT_AMIXERS * CHN_NUM); i++) { 869 for (i = 0; i < (NUM_CT_AMIXERS * CHN_NUM); i++) {
869 err = amixer_mgr->get_amixer(amixer_mgr, &am_desc, &amixer); 870 err = amixer_mgr->get_amixer(amixer_mgr, &am_desc, &amixer);
870 if (err) { 871 if (err) {
871 pr_err("ctxfi:Failed to get amixer resources for mixer obj!\n"); 872 dev_err(mixer->atc->card->dev,
873 "Failed to get amixer resources for mixer obj!\n");
872 break; 874 break;
873 } 875 }
874 mixer->amixers[i] = amixer; 876 mixer->amixers[i] = amixer;
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c
index 6826c2c02c44..d86c474ca5b6 100644
--- a/sound/pci/ctxfi/ctpcm.c
+++ b/sound/pci/ctxfi/ctpcm.c
@@ -217,7 +217,8 @@ static int ct_pcm_playback_prepare(struct snd_pcm_substream *substream)
217 err = atc->pcm_playback_prepare(atc, apcm); 217 err = atc->pcm_playback_prepare(atc, apcm);
218 218
219 if (err < 0) { 219 if (err < 0) {
220 pr_err("ctxfi: Preparing pcm playback failed!!!\n"); 220 dev_err(atc->card->dev,
221 "Preparing pcm playback failed!!!\n");
221 return err; 222 return err;
222 } 223 }
223 224
@@ -324,7 +325,8 @@ static int ct_pcm_capture_prepare(struct snd_pcm_substream *substream)
324 325
325 err = atc->pcm_capture_prepare(atc, apcm); 326 err = atc->pcm_capture_prepare(atc, apcm);
326 if (err < 0) { 327 if (err < 0) {
327 pr_err("ctxfi: Preparing pcm capture failed!!!\n"); 328 dev_err(atc->card->dev,
329 "Preparing pcm capture failed!!!\n");
328 return err; 330 return err;
329 } 331 }
330 332
@@ -435,7 +437,8 @@ int ct_alsa_pcm_create(struct ct_atc *atc,
435 err = snd_pcm_new(atc->card, "ctxfi", device, 437 err = snd_pcm_new(atc->card, "ctxfi", device,
436 playback_count, capture_count, &pcm); 438 playback_count, capture_count, &pcm);
437 if (err < 0) { 439 if (err < 0) {
438 pr_err("ctxfi: snd_pcm_new failed!! Err=%d\n", err); 440 dev_err(atc->card->dev, "snd_pcm_new failed!! Err=%d\n",
441 err);
439 return err; 442 return err;
440 } 443 }
441 444
diff --git a/sound/pci/ctxfi/ctresource.c b/sound/pci/ctxfi/ctresource.c
index 5aac63fd3bff..1a97e406d8ec 100644
--- a/sound/pci/ctxfi/ctresource.c
+++ b/sound/pci/ctxfi/ctresource.c
@@ -162,12 +162,14 @@ rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw)
162 case DAIO: 162 case DAIO:
163 break; 163 break;
164 default: 164 default:
165 pr_err("ctxfi: Invalid resource type value %d!\n", type); 165 dev_err(((struct hw *)hw)->card->dev,
166 "Invalid resource type value %d!\n", type);
166 return -EINVAL; 167 return -EINVAL;
167 } 168 }
168 169
169 if (err) { 170 if (err) {
170 pr_err("ctxfi: Failed to get resource control block!\n"); 171 dev_err(((struct hw *)hw)->card->dev,
172 "Failed to get resource control block!\n");
171 return err; 173 return err;
172 } 174 }
173 175
@@ -188,7 +190,8 @@ int rsc_uninit(struct rsc *rsc)
188 case DAIO: 190 case DAIO:
189 break; 191 break;
190 default: 192 default:
191 pr_err("ctxfi: Invalid resource type value %d!\n", 193 dev_err(((struct hw *)rsc->hw)->card->dev,
194 "Invalid resource type value %d!\n",
192 rsc->type); 195 rsc->type);
193 break; 196 break;
194 } 197 }
@@ -230,13 +233,15 @@ int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type,
230 case SUM: 233 case SUM:
231 break; 234 break;
232 default: 235 default:
233 pr_err("ctxfi: Invalid resource type value %d!\n", type); 236 dev_err(hw->card->dev,
237 "Invalid resource type value %d!\n", type);
234 err = -EINVAL; 238 err = -EINVAL;
235 goto error; 239 goto error;
236 } 240 }
237 241
238 if (err) { 242 if (err) {
239 pr_err("ctxfi: Failed to get manager control block!\n"); 243 dev_err(hw->card->dev,
244 "Failed to get manager control block!\n");
240 goto error; 245 goto error;
241 } 246 }
242 247
@@ -275,7 +280,8 @@ int rsc_mgr_uninit(struct rsc_mgr *mgr)
275 case SUM: 280 case SUM:
276 break; 281 break;
277 default: 282 default:
278 pr_err("ctxfi: Invalid resource type value %d!\n", 283 dev_err(((struct hw *)mgr->hw)->card->dev,
284 "Invalid resource type value %d!\n",
279 mgr->type); 285 mgr->type);
280 break; 286 break;
281 } 287 }
diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c
index 50fa35bc66d2..ec1f08464d93 100644
--- a/sound/pci/ctxfi/ctsrc.c
+++ b/sound/pci/ctxfi/ctsrc.c
@@ -431,7 +431,8 @@ get_src_rsc(struct src_mgr *mgr, const struct src_desc *desc, struct src **rsrc)
431 431
432 spin_unlock_irqrestore(&mgr->mgr_lock, flags); 432 spin_unlock_irqrestore(&mgr->mgr_lock, flags);
433 if (err) { 433 if (err) {
434 pr_err("ctxfi: Can't meet SRC resource request!\n"); 434 dev_err(mgr->card->dev,
435 "Can't meet SRC resource request!\n");
435 return err; 436 return err;
436 } 437 }
437 438
@@ -740,7 +741,8 @@ static int get_srcimp_rsc(struct srcimp_mgr *mgr,
740 } 741 }
741 spin_unlock_irqrestore(&mgr->mgr_lock, flags); 742 spin_unlock_irqrestore(&mgr->mgr_lock, flags);
742 if (err) { 743 if (err) {
743 pr_err("ctxfi: Can't meet SRCIMP resource request!\n"); 744 dev_err(mgr->card->dev,
745 "Can't meet SRCIMP resource request!\n");
744 goto error1; 746 goto error1;
745 } 747 }
746 748
diff --git a/sound/pci/ctxfi/ctvmem.c b/sound/pci/ctxfi/ctvmem.c
index 38163f52dd5f..419306ef825f 100644
--- a/sound/pci/ctxfi/ctvmem.c
+++ b/sound/pci/ctxfi/ctvmem.c
@@ -16,6 +16,7 @@
16 */ 16 */
17 17
18#include "ctvmem.h" 18#include "ctvmem.h"
19#include "ctatc.h"
19#include <linux/slab.h> 20#include <linux/slab.h>
20#include <linux/mm.h> 21#include <linux/mm.h>
21#include <linux/io.h> 22#include <linux/io.h>
@@ -29,14 +30,15 @@
29 * @size must be page aligned. 30 * @size must be page aligned.
30 * */ 31 * */
31static struct ct_vm_block * 32static struct ct_vm_block *
32get_vm_block(struct ct_vm *vm, unsigned int size) 33get_vm_block(struct ct_vm *vm, unsigned int size, struct ct_atc *atc)
33{ 34{
34 struct ct_vm_block *block = NULL, *entry; 35 struct ct_vm_block *block = NULL, *entry;
35 struct list_head *pos; 36 struct list_head *pos;
36 37
37 size = CT_PAGE_ALIGN(size); 38 size = CT_PAGE_ALIGN(size);
38 if (size > vm->size) { 39 if (size > vm->size) {
39 pr_err("ctxfi: Fail! No sufficient device virtual memory space available!\n"); 40 dev_err(atc->card->dev,
41 "Fail! No sufficient device virtual memory space available!\n");
40 return NULL; 42 return NULL;
41 } 43 }
42 44
@@ -128,10 +130,12 @@ ct_vm_map(struct ct_vm *vm, struct snd_pcm_substream *substream, int size)
128 unsigned int pte_start; 130 unsigned int pte_start;
129 unsigned i, pages; 131 unsigned i, pages;
130 unsigned long *ptp; 132 unsigned long *ptp;
133 struct ct_atc *atc = snd_pcm_substream_chip(substream);
131 134
132 block = get_vm_block(vm, size); 135 block = get_vm_block(vm, size, atc);
133 if (block == NULL) { 136 if (block == NULL) {
134 pr_err("ctxfi: No virtual memory block that is big enough to allocate!\n"); 137 dev_err(atc->card->dev,
138 "No virtual memory block that is big enough to allocate!\n");
135 return NULL; 139 return NULL;
136 } 140 }
137 141
diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c
index 35e85ba80656..f2f32779de98 100644
--- a/sound/pci/ctxfi/xfi.c
+++ b/sound/pci/ctxfi/xfi.c
@@ -76,15 +76,18 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
76 if (err) 76 if (err)
77 return err; 77 return err;
78 if ((reference_rate != 48000) && (reference_rate != 44100)) { 78 if ((reference_rate != 48000) && (reference_rate != 44100)) {
79 pr_err("ctxfi: Invalid reference_rate value %u!!!\n", 79 dev_err(card->dev,
80 reference_rate); 80 "Invalid reference_rate value %u!!!\n",
81 pr_err("ctxfi: The valid values for reference_rate are 48000 and 44100, Value 48000 is assumed.\n"); 81 reference_rate);
82 dev_err(card->dev,
83 "The valid values for reference_rate are 48000 and 44100, Value 48000 is assumed.\n");
82 reference_rate = 48000; 84 reference_rate = 48000;
83 } 85 }
84 if ((multiple != 1) && (multiple != 2) && (multiple != 4)) { 86 if ((multiple != 1) && (multiple != 2) && (multiple != 4)) {
85 pr_err("ctxfi: Invalid multiple value %u!!!\n", 87 dev_err(card->dev, "Invalid multiple value %u!!!\n",
86 multiple); 88 multiple);
87 pr_err("ctxfi: The valid values for multiple are 1, 2 and 4, Value 2 is assumed.\n"); 89 dev_err(card->dev,
90 "The valid values for multiple are 1, 2 and 4, Value 2 is assumed.\n");
88 multiple = 2; 91 multiple = 2;
89 } 92 }
90 err = ct_atc_create(card, pci, reference_rate, multiple, 93 err = ct_atc_create(card, pci, reference_rate, multiple,