aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliot Blennerhassett <eblennerhassett@audioscience.com>2011-02-09 23:25:54 -0500
committerTakashi Iwai <tiwai@suse.de>2011-02-10 12:20:39 -0500
commit5ed15dafa381d1bb7954c7cec0677c45814017f9 (patch)
tree9b84f60cb479ec118dad870a411d8c08963ade5e
parent8121d91c02a1be4884821599472acf405efdc3de (diff)
ALSA: asihpi - Switch to dev_printk.
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/asihpi/hpidspcd.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/sound/pci/asihpi/hpidspcd.c b/sound/pci/asihpi/hpidspcd.c
index 9b10d9a5c255..f9958e9885ff 100644
--- a/sound/pci/asihpi/hpidspcd.c
+++ b/sound/pci/asihpi/hpidspcd.c
@@ -71,47 +71,51 @@ short hpi_dsp_code_open(u32 adapter, struct dsp_code *ps_dsp_code,
71 int err; 71 int err;
72 72
73 sprintf(fw_name, "asihpi/dsp%04x.bin", adapter); 73 sprintf(fw_name, "asihpi/dsp%04x.bin", adapter);
74 HPI_DEBUG_LOG(INFO, "requesting firmware for %s\n", fw_name);
75 74
76 err = request_firmware(&ps_firmware, fw_name, 75 err = request_firmware(&ps_firmware, fw_name,
77 &ps_dsp_code->ps_dev->dev); 76 &ps_dsp_code->ps_dev->dev);
77
78 if (err != 0) { 78 if (err != 0) {
79 HPI_DEBUG_LOG(ERROR, "%d, request_firmware failed for %s\n", 79 dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
80 err, fw_name); 80 "%d, request_firmware failed for %s\n", err,
81 fw_name);
81 goto error1; 82 goto error1;
82 } 83 }
83 if (ps_firmware->size < sizeof(header)) { 84 if (ps_firmware->size < sizeof(header)) {
84 HPI_DEBUG_LOG(ERROR, "header size too small %s\n", fw_name); 85 dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
86 "Header size too small %s\n", fw_name);
85 goto error2; 87 goto error2;
86 } 88 }
87 memcpy(&header, ps_firmware->data, sizeof(header)); 89 memcpy(&header, ps_firmware->data, sizeof(header));
88 if (header.adapter != adapter) { 90 if (header.adapter != adapter) {
89 HPI_DEBUG_LOG(ERROR, "adapter type incorrect %4x != %4x\n", 91 dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
90 header.adapter, adapter); 92 "Adapter type incorrect %4x != %4x\n", header.adapter,
93 adapter);
91 goto error2; 94 goto error2;
92 } 95 }
93 if (header.size != ps_firmware->size) { 96 if (header.size != ps_firmware->size) {
94 HPI_DEBUG_LOG(ERROR, "code size wrong %d != %ld\n", 97 dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
95 header.size, (unsigned long)ps_firmware->size); 98 "Code size wrong %d != %ld\n", header.size,
99 (unsigned long)ps_firmware->size);
96 goto error2; 100 goto error2;
97 } 101 }
98 102
99 if (header.version / 10000 != HPI_VER_DECIMAL / 10000) { 103 if (header.version / 10000 != HPI_VER_DECIMAL / 10000) {
100 HPI_DEBUG_LOG(ERROR, 104 dev_printk(KERN_ERR, &ps_dsp_code->ps_dev->dev,
101 "firmware major version mismatch " 105 "Firmware Major Version mismatch "
102 "DSP image %d != driver %d\n", header.version, 106 "DSP image %d != Driver %d\n", header.version,
103 HPI_VER_DECIMAL); 107 HPI_VER_DECIMAL);
104 goto error2; 108 goto error2;
105 } 109 }
106 110
107 if (header.version != HPI_VER_DECIMAL) { 111 if (header.version != HPI_VER_DECIMAL) {
108 HPI_DEBUG_LOG(WARNING, 112 dev_printk(KERN_WARNING, &ps_dsp_code->ps_dev->dev,
109 "version mismatch DSP image %d != driver %d\n", 113 "firmware: version mismatch DSP image %d != Driver %d\n",
110 header.version, HPI_VER_DECIMAL); 114 header.version, HPI_VER_DECIMAL);
111 /* goto error2; still allow driver to load */ 115 /* goto error2; still allow driver to load */
112 } 116 }
113 117
114 HPI_DEBUG_LOG(INFO, "dsp code %s opened\n", fw_name); 118 HPI_DEBUG_LOG(DEBUG, "dsp code %s opened\n", fw_name);
115 ps_dsp_code->ps_firmware = ps_firmware; 119 ps_dsp_code->ps_firmware = ps_firmware;
116 ps_dsp_code->block_length = header.size / sizeof(u32); 120 ps_dsp_code->block_length = header.size / sizeof(u32);
117 ps_dsp_code->word_count = sizeof(header) / sizeof(u32); 121 ps_dsp_code->word_count = sizeof(header) / sizeof(u32);
@@ -148,7 +152,7 @@ void hpi_dsp_code_rewind(struct dsp_code *ps_dsp_code)
148short hpi_dsp_code_read_word(struct dsp_code *ps_dsp_code, u32 *pword) 152short hpi_dsp_code_read_word(struct dsp_code *ps_dsp_code, u32 *pword)
149{ 153{
150 if (ps_dsp_code->word_count + 1 > ps_dsp_code->block_length) 154 if (ps_dsp_code->word_count + 1 > ps_dsp_code->block_length)
151 return (HPI_ERROR_DSP_FILE_FORMAT); 155 return HPI_ERROR_DSP_FILE_FORMAT;
152 156
153 *pword = ((u32 *)(ps_dsp_code->ps_firmware->data))[ps_dsp_code-> 157 *pword = ((u32 *)(ps_dsp_code->ps_firmware->data))[ps_dsp_code->
154 word_count]; 158 word_count];