aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-25 10:10:25 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-26 10:45:25 -0500
commit00980aa9c7ce2b5b54a5a7e7cf259f36fabdb249 (patch)
tree1aff12ccf3dec4e26b5de62e3360bf185d237c2d /sound/pci
parent74103227a6eee19654a915cbd56307fc8bc78ba6 (diff)
ALSA: cs5535audio: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c26
-rw-r--r--sound/pci/cs5535audio/cs5535audio_olpc.c7
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pcm.c6
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pm.c7
4 files changed, 25 insertions, 21 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 051b3e28e341..edcbbda5c488 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -84,7 +84,8 @@ static void wait_till_cmd_acked(struct cs5535audio *cs5535au, unsigned long time
84 udelay(1); 84 udelay(1);
85 } while (--timeout); 85 } while (--timeout);
86 if (!timeout) 86 if (!timeout)
87 snd_printk(KERN_ERR "Failure writing to cs5535 codec\n"); 87 dev_err(cs5535au->card->dev,
88 "Failure writing to cs5535 codec\n");
88} 89}
89 90
90static unsigned short snd_cs5535audio_codec_read(struct cs5535audio *cs5535au, 91static unsigned short snd_cs5535audio_codec_read(struct cs5535audio *cs5535au,
@@ -109,8 +110,9 @@ static unsigned short snd_cs5535audio_codec_read(struct cs5535audio *cs5535au,
109 udelay(1); 110 udelay(1);
110 } while (--timeout); 111 } while (--timeout);
111 if (!timeout) 112 if (!timeout)
112 snd_printk(KERN_ERR "Failure reading codec reg 0x%x," 113 dev_err(cs5535au->card->dev,
113 "Last value=0x%x\n", reg, val); 114 "Failure reading codec reg 0x%x, Last value=0x%x\n",
115 reg, val);
114 116
115 return (unsigned short) val; 117 return (unsigned short) val;
116} 118}
@@ -168,7 +170,7 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
168 olpc_prequirks(card, &ac97); 170 olpc_prequirks(card, &ac97);
169 171
170 if ((err = snd_ac97_mixer(pbus, &ac97, &cs5535au->ac97)) < 0) { 172 if ((err = snd_ac97_mixer(pbus, &ac97, &cs5535au->ac97)) < 0) {
171 snd_printk(KERN_ERR "mixer failed\n"); 173 dev_err(card->dev, "mixer failed\n");
172 return err; 174 return err;
173 } 175 }
174 176
@@ -176,7 +178,7 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
176 178
177 err = olpc_quirks(card, cs5535au->ac97); 179 err = olpc_quirks(card, cs5535au->ac97);
178 if (err < 0) { 180 if (err < 0) {
179 snd_printk(KERN_ERR "olpc quirks failed\n"); 181 dev_err(card->dev, "olpc quirks failed\n");
180 return err; 182 return err;
181 } 183 }
182 184
@@ -194,8 +196,9 @@ static void process_bm0_irq(struct cs5535audio *cs5535au)
194 dma = cs5535au->playback_substream->runtime->private_data; 196 dma = cs5535au->playback_substream->runtime->private_data;
195 snd_pcm_period_elapsed(cs5535au->playback_substream); 197 snd_pcm_period_elapsed(cs5535au->playback_substream);
196 } else { 198 } else {
197 snd_printk(KERN_ERR "unexpected bm0 irq src, bm_stat=%x\n", 199 dev_err(cs5535au->card->dev,
198 bm_stat); 200 "unexpected bm0 irq src, bm_stat=%x\n",
201 bm_stat);
199 } 202 }
200} 203}
201 204
@@ -241,8 +244,9 @@ static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id)
241 process_bm1_irq(cs5535au); 244 process_bm1_irq(cs5535au);
242 break; 245 break;
243 default: 246 default:
244 snd_printk(KERN_ERR "Unexpected irq src: " 247 dev_err(cs5535au->card->dev,
245 "0x%x\n", acc_irq_stat); 248 "Unexpected irq src: 0x%x\n",
249 acc_irq_stat);
246 break; 250 break;
247 } 251 }
248 } 252 }
@@ -287,7 +291,7 @@ static int snd_cs5535audio_create(struct snd_card *card,
287 291
288 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 || 292 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 ||
289 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) { 293 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
290 printk(KERN_WARNING "unable to get 32bit dma\n"); 294 dev_warn(card->dev, "unable to get 32bit dma\n");
291 err = -ENXIO; 295 err = -ENXIO;
292 goto pcifail; 296 goto pcifail;
293 } 297 }
@@ -312,7 +316,7 @@ static int snd_cs5535audio_create(struct snd_card *card,
312 316
313 if (request_irq(pci->irq, snd_cs5535audio_interrupt, 317 if (request_irq(pci->irq, snd_cs5535audio_interrupt,
314 IRQF_SHARED, KBUILD_MODNAME, cs5535au)) { 318 IRQF_SHARED, KBUILD_MODNAME, cs5535au)) {
315 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 319 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
316 err = -EBUSY; 320 err = -EBUSY;
317 goto sndfail; 321 goto sndfail;
318 } 322 }
diff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535audio/cs5535audio_olpc.c
index e6a44507d557..3b0fdaca8dc7 100644
--- a/sound/pci/cs5535audio/cs5535audio_olpc.c
+++ b/sound/pci/cs5535audio/cs5535audio_olpc.c
@@ -36,7 +36,8 @@ void olpc_analog_input(struct snd_ac97 *ac97, int on)
36 err = snd_ac97_update_bits(ac97, AC97_AD_TEST2, 36 err = snd_ac97_update_bits(ac97, AC97_AD_TEST2,
37 1 << AC97_AD_HPFD_SHIFT, on << AC97_AD_HPFD_SHIFT); 37 1 << AC97_AD_HPFD_SHIFT, on << AC97_AD_HPFD_SHIFT);
38 if (err < 0) { 38 if (err < 0) {
39 snd_printk(KERN_ERR "setting High Pass Filter - %d\n", err); 39 dev_err(ac97->bus->card->dev,
40 "setting High Pass Filter - %d\n", err);
40 return; 41 return;
41 } 42 }
42 43
@@ -58,7 +59,7 @@ void olpc_mic_bias(struct snd_ac97 *ac97, int on)
58 err = snd_ac97_update_bits(ac97, AC97_AD_MISC, 59 err = snd_ac97_update_bits(ac97, AC97_AD_MISC,
59 1 << AC97_AD_VREFD_SHIFT, on << AC97_AD_VREFD_SHIFT); 60 1 << AC97_AD_VREFD_SHIFT, on << AC97_AD_VREFD_SHIFT);
60 if (err < 0) 61 if (err < 0)
61 snd_printk(KERN_ERR "setting MIC Bias - %d\n", err); 62 dev_err(ac97->bus->card->dev, "setting MIC Bias - %d\n", err);
62} 63}
63 64
64static int olpc_dc_info(struct snd_kcontrol *kctl, 65static int olpc_dc_info(struct snd_kcontrol *kctl,
@@ -153,7 +154,7 @@ int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
153 return 0; 154 return 0;
154 155
155 if (gpio_request(OLPC_GPIO_MIC_AC, DRV_NAME)) { 156 if (gpio_request(OLPC_GPIO_MIC_AC, DRV_NAME)) {
156 printk(KERN_ERR DRV_NAME ": unable to allocate MIC GPIO\n"); 157 dev_err(card->dev, "unable to allocate MIC GPIO\n");
157 return -EIO; 158 return -EIO;
158 } 159 }
159 gpio_direction_output(OLPC_GPIO_MIC_AC, 0); 160 gpio_direction_output(OLPC_GPIO_MIC_AC, 0);
diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c
index 9ab01a7047cf..9c2dc911d8d7 100644
--- a/sound/pci/cs5535audio/cs5535audio_pcm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
@@ -317,7 +317,7 @@ static int snd_cs5535audio_trigger(struct snd_pcm_substream *substream, int cmd)
317 dma->ops->disable_dma(cs5535au); 317 dma->ops->disable_dma(cs5535au);
318 break; 318 break;
319 default: 319 default:
320 snd_printk(KERN_ERR "unhandled trigger\n"); 320 dev_err(cs5535au->card->dev, "unhandled trigger\n");
321 err = -EINVAL; 321 err = -EINVAL;
322 break; 322 break;
323 } 323 }
@@ -335,13 +335,13 @@ static snd_pcm_uframes_t snd_cs5535audio_pcm_pointer(struct snd_pcm_substream
335 dma = substream->runtime->private_data; 335 dma = substream->runtime->private_data;
336 curdma = dma->ops->read_dma_pntr(cs5535au); 336 curdma = dma->ops->read_dma_pntr(cs5535au);
337 if (curdma < dma->buf_addr) { 337 if (curdma < dma->buf_addr) {
338 snd_printk(KERN_ERR "curdma=%x < %x bufaddr.\n", 338 dev_err(cs5535au->card->dev, "curdma=%x < %x bufaddr.\n",
339 curdma, dma->buf_addr); 339 curdma, dma->buf_addr);
340 return 0; 340 return 0;
341 } 341 }
342 curdma -= dma->buf_addr; 342 curdma -= dma->buf_addr;
343 if (curdma >= dma->buf_bytes) { 343 if (curdma >= dma->buf_bytes) {
344 snd_printk(KERN_ERR "diff=%x >= %x buf_bytes.\n", 344 dev_err(cs5535au->card->dev, "diff=%x >= %x buf_bytes.\n",
345 curdma, dma->buf_bytes); 345 curdma, dma->buf_bytes);
346 return 0; 346 return 0;
347 } 347 }
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
index 6c34def5986d..34cc60057d0c 100644
--- a/sound/pci/cs5535audio/cs5535audio_pm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pm.c
@@ -74,7 +74,7 @@ static int snd_cs5535audio_suspend(struct device *dev)
74 snd_cs5535audio_stop_hardware(cs5535au); 74 snd_cs5535audio_stop_hardware(cs5535au);
75 75
76 if (pci_save_state(pci)) { 76 if (pci_save_state(pci)) {
77 printk(KERN_ERR "cs5535audio: pci_save_state failed!\n"); 77 dev_err(dev, "pci_save_state failed!\n");
78 return -EIO; 78 return -EIO;
79 } 79 }
80 pci_disable_device(pci); 80 pci_disable_device(pci);
@@ -94,8 +94,7 @@ static int snd_cs5535audio_resume(struct device *dev)
94 pci_set_power_state(pci, PCI_D0); 94 pci_set_power_state(pci, PCI_D0);
95 pci_restore_state(pci); 95 pci_restore_state(pci);
96 if (pci_enable_device(pci) < 0) { 96 if (pci_enable_device(pci) < 0) {
97 printk(KERN_ERR "cs5535audio: pci_enable_device failed, " 97 dev_err(dev, "pci_enable_device failed, disabling device\n");
98 "disabling device\n");
99 snd_card_disconnect(card); 98 snd_card_disconnect(card);
100 return -EIO; 99 return -EIO;
101 } 100 }
@@ -113,7 +112,7 @@ static int snd_cs5535audio_resume(struct device *dev)
113 } while (--timeout); 112 } while (--timeout);
114 113
115 if (!timeout) 114 if (!timeout)
116 snd_printk(KERN_ERR "Failure getting AC Link ready\n"); 115 dev_err(cs5535au->card->dev, "Failure getting AC Link ready\n");
117 116
118 /* set up rate regs, dma. actual initiation is done in trig */ 117 /* set up rate regs, dma. actual initiation is done in trig */
119 for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) { 118 for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) {