提交 e3b3757b 编写于 作者: T Takashi Iwai

ALSA: 6fire: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 0ba41d91
...@@ -106,7 +106,7 @@ static int usb6fire_chip_probe(struct usb_interface *intf, ...@@ -106,7 +106,7 @@ static int usb6fire_chip_probe(struct usb_interface *intf,
} }
if (regidx < 0) { if (regidx < 0) {
mutex_unlock(&register_mutex); mutex_unlock(&register_mutex);
snd_printk(KERN_ERR PREFIX "too many cards registered.\n"); dev_err(&intf->dev, "too many cards registered.\n");
return -ENODEV; return -ENODEV;
} }
devices[regidx] = device; devices[regidx] = device;
...@@ -121,13 +121,13 @@ static int usb6fire_chip_probe(struct usb_interface *intf, ...@@ -121,13 +121,13 @@ static int usb6fire_chip_probe(struct usb_interface *intf,
/* if we are here, card can be registered in alsa. */ /* if we are here, card can be registered in alsa. */
if (usb_set_interface(device, 0, 0) != 0) { if (usb_set_interface(device, 0, 0) != 0) {
snd_printk(KERN_ERR PREFIX "can't set first interface.\n"); dev_err(&intf->dev, "can't set first interface.\n");
return -EIO; return -EIO;
} }
ret = snd_card_new(&intf->dev, index[regidx], id[regidx], ret = snd_card_new(&intf->dev, index[regidx], id[regidx],
THIS_MODULE, sizeof(struct sfire_chip), &card); THIS_MODULE, sizeof(struct sfire_chip), &card);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "cannot create alsa card.\n"); dev_err(&intf->dev, "cannot create alsa card.\n");
return ret; return ret;
} }
strcpy(card->driver, "6FireUSB"); strcpy(card->driver, "6FireUSB");
...@@ -168,7 +168,7 @@ static int usb6fire_chip_probe(struct usb_interface *intf, ...@@ -168,7 +168,7 @@ static int usb6fire_chip_probe(struct usb_interface *intf,
ret = snd_card_register(card); ret = snd_card_register(card);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "cannot register card."); dev_err(&intf->dev, "cannot register card.");
usb6fire_chip_destroy(chip); usb6fire_chip_destroy(chip);
return ret; return ret;
} }
......
...@@ -51,7 +51,7 @@ static void usb6fire_comm_receiver_handler(struct urb *urb) ...@@ -51,7 +51,7 @@ static void usb6fire_comm_receiver_handler(struct urb *urb)
urb->status = 0; urb->status = 0;
urb->actual_length = 0; urb->actual_length = 0;
if (usb_submit_urb(urb, GFP_ATOMIC) < 0) if (usb_submit_urb(urb, GFP_ATOMIC) < 0)
snd_printk(KERN_WARNING PREFIX dev_warn(&urb->dev->dev,
"comm data receiver aborted.\n"); "comm data receiver aborted.\n");
} }
} }
...@@ -179,7 +179,7 @@ int usb6fire_comm_init(struct sfire_chip *chip) ...@@ -179,7 +179,7 @@ int usb6fire_comm_init(struct sfire_chip *chip)
if (ret < 0) { if (ret < 0) {
kfree(rt->receiver_buffer); kfree(rt->receiver_buffer);
kfree(rt); kfree(rt);
snd_printk(KERN_ERR PREFIX "cannot create comm data receiver."); dev_err(&chip->dev->dev, "cannot create comm data receiver.");
return ret; return ret;
} }
chip->comm = rt; chip->comm = rt;
......
...@@ -194,7 +194,8 @@ static int usb6fire_control_output_vol_put(struct snd_kcontrol *kcontrol, ...@@ -194,7 +194,8 @@ static int usb6fire_control_output_vol_put(struct snd_kcontrol *kcontrol,
int changed = 0; int changed = 0;
if (ch > 4) { if (ch > 4) {
snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); dev_err(&rt->chip->dev->dev,
"Invalid channel in volume control.");
return -EINVAL; return -EINVAL;
} }
...@@ -222,7 +223,8 @@ static int usb6fire_control_output_vol_get(struct snd_kcontrol *kcontrol, ...@@ -222,7 +223,8 @@ static int usb6fire_control_output_vol_get(struct snd_kcontrol *kcontrol,
unsigned int ch = kcontrol->private_value; unsigned int ch = kcontrol->private_value;
if (ch > 4) { if (ch > 4) {
snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); dev_err(&rt->chip->dev->dev,
"Invalid channel in volume control.");
return -EINVAL; return -EINVAL;
} }
...@@ -240,7 +242,8 @@ static int usb6fire_control_output_mute_put(struct snd_kcontrol *kcontrol, ...@@ -240,7 +242,8 @@ static int usb6fire_control_output_mute_put(struct snd_kcontrol *kcontrol,
u8 value = 0; u8 value = 0;
if (ch > 4) { if (ch > 4) {
snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); dev_err(&rt->chip->dev->dev,
"Invalid channel in volume control.");
return -EINVAL; return -EINVAL;
} }
...@@ -265,7 +268,8 @@ static int usb6fire_control_output_mute_get(struct snd_kcontrol *kcontrol, ...@@ -265,7 +268,8 @@ static int usb6fire_control_output_mute_get(struct snd_kcontrol *kcontrol,
u8 value = rt->output_mute >> ch; u8 value = rt->output_mute >> ch;
if (ch > 4) { if (ch > 4) {
snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); dev_err(&rt->chip->dev->dev,
"Invalid channel in volume control.");
return -EINVAL; return -EINVAL;
} }
...@@ -594,14 +598,14 @@ int usb6fire_control_init(struct sfire_chip *chip) ...@@ -594,14 +598,14 @@ int usb6fire_control_init(struct sfire_chip *chip)
ret = usb6fire_control_add_virtual(rt, chip->card, ret = usb6fire_control_add_virtual(rt, chip->card,
"Master Playback Volume", vol_elements); "Master Playback Volume", vol_elements);
if (ret) { if (ret) {
snd_printk(KERN_ERR PREFIX "cannot add control.\n"); dev_err(&chip->dev->dev, "cannot add control.\n");
kfree(rt); kfree(rt);
return ret; return ret;
} }
ret = usb6fire_control_add_virtual(rt, chip->card, ret = usb6fire_control_add_virtual(rt, chip->card,
"Master Playback Switch", mute_elements); "Master Playback Switch", mute_elements);
if (ret) { if (ret) {
snd_printk(KERN_ERR PREFIX "cannot add control.\n"); dev_err(&chip->dev->dev, "cannot add control.\n");
kfree(rt); kfree(rt);
return ret; return ret;
} }
...@@ -611,7 +615,7 @@ int usb6fire_control_init(struct sfire_chip *chip) ...@@ -611,7 +615,7 @@ int usb6fire_control_init(struct sfire_chip *chip)
ret = snd_ctl_add(chip->card, snd_ctl_new1(&elements[i], rt)); ret = snd_ctl_add(chip->card, snd_ctl_new1(&elements[i], rt));
if (ret < 0) { if (ret < 0) {
kfree(rt); kfree(rt);
snd_printk(KERN_ERR PREFIX "cannot add control.\n"); dev_err(&chip->dev->dev, "cannot add control.\n");
return ret; return ret;
} }
i++; i++;
......
...@@ -219,16 +219,16 @@ static int usb6fire_fw_ezusb_upload( ...@@ -219,16 +219,16 @@ static int usb6fire_fw_ezusb_upload(
ret = request_firmware(&fw, fwname, &device->dev); ret = request_firmware(&fw, fwname, &device->dev);
if (ret < 0) { if (ret < 0) {
kfree(rec); kfree(rec);
snd_printk(KERN_ERR PREFIX "error requesting ezusb " dev_err(&intf->dev,
"firmware %s.\n", fwname); "error requesting ezusb firmware %s.\n", fwname);
return ret; return ret;
} }
ret = usb6fire_fw_ihex_init(fw, rec); ret = usb6fire_fw_ihex_init(fw, rec);
if (ret < 0) { if (ret < 0) {
kfree(rec); kfree(rec);
release_firmware(fw); release_firmware(fw);
snd_printk(KERN_ERR PREFIX "error validating ezusb " dev_err(&intf->dev,
"firmware %s.\n", fwname); "error validating ezusb firmware %s.\n", fwname);
return ret; return ret;
} }
/* upload firmware image */ /* upload firmware image */
...@@ -237,8 +237,9 @@ static int usb6fire_fw_ezusb_upload( ...@@ -237,8 +237,9 @@ static int usb6fire_fw_ezusb_upload(
if (ret < 0) { if (ret < 0) {
kfree(rec); kfree(rec);
release_firmware(fw); release_firmware(fw);
snd_printk(KERN_ERR PREFIX "unable to upload ezusb " dev_err(&intf->dev,
"firmware %s: begin message.\n", fwname); "unable to upload ezusb firmware %s: begin message.\n",
fwname);
return ret; return ret;
} }
...@@ -248,8 +249,9 @@ static int usb6fire_fw_ezusb_upload( ...@@ -248,8 +249,9 @@ static int usb6fire_fw_ezusb_upload(
if (ret < 0) { if (ret < 0) {
kfree(rec); kfree(rec);
release_firmware(fw); release_firmware(fw);
snd_printk(KERN_ERR PREFIX "unable to upload ezusb " dev_err(&intf->dev,
"firmware %s: data urb.\n", fwname); "unable to upload ezusb firmware %s: data urb.\n",
fwname);
return ret; return ret;
} }
} }
...@@ -260,8 +262,9 @@ static int usb6fire_fw_ezusb_upload( ...@@ -260,8 +262,9 @@ static int usb6fire_fw_ezusb_upload(
ret = usb6fire_fw_ezusb_write(device, 0xa0, postaddr, ret = usb6fire_fw_ezusb_write(device, 0xa0, postaddr,
postdata, postlen); postdata, postlen);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "unable to upload ezusb " dev_err(&intf->dev,
"firmware %s: post urb.\n", fwname); "unable to upload ezusb firmware %s: post urb.\n",
fwname);
return ret; return ret;
} }
} }
...@@ -269,8 +272,9 @@ static int usb6fire_fw_ezusb_upload( ...@@ -269,8 +272,9 @@ static int usb6fire_fw_ezusb_upload(
data = 0x00; /* resume ezusb cpu */ data = 0x00; /* resume ezusb cpu */
ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1); ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "unable to upload ezusb " dev_err(&intf->dev,
"firmware %s: end message.\n", fwname); "unable to upload ezusb firmware %s: end message.\n",
fwname);
return ret; return ret;
} }
return 0; return 0;
...@@ -292,7 +296,7 @@ static int usb6fire_fw_fpga_upload( ...@@ -292,7 +296,7 @@ static int usb6fire_fw_fpga_upload(
ret = request_firmware(&fw, fwname, &device->dev); ret = request_firmware(&fw, fwname, &device->dev);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "unable to get fpga firmware %s.\n", dev_err(&intf->dev, "unable to get fpga firmware %s.\n",
fwname); fwname);
kfree(buffer); kfree(buffer);
return -EIO; return -EIO;
...@@ -305,8 +309,8 @@ static int usb6fire_fw_fpga_upload( ...@@ -305,8 +309,8 @@ static int usb6fire_fw_fpga_upload(
if (ret < 0) { if (ret < 0) {
kfree(buffer); kfree(buffer);
release_firmware(fw); release_firmware(fw);
snd_printk(KERN_ERR PREFIX "unable to upload fpga firmware: " dev_err(&intf->dev,
"begin urb.\n"); "unable to upload fpga firmware: begin urb.\n");
return ret; return ret;
} }
...@@ -318,8 +322,8 @@ static int usb6fire_fw_fpga_upload( ...@@ -318,8 +322,8 @@ static int usb6fire_fw_fpga_upload(
if (ret < 0) { if (ret < 0) {
release_firmware(fw); release_firmware(fw);
kfree(buffer); kfree(buffer);
snd_printk(KERN_ERR PREFIX "unable to upload fpga " dev_err(&intf->dev,
"firmware: fw urb.\n"); "unable to upload fpga firmware: fw urb.\n");
return ret; return ret;
} }
} }
...@@ -328,8 +332,8 @@ static int usb6fire_fw_fpga_upload( ...@@ -328,8 +332,8 @@ static int usb6fire_fw_fpga_upload(
ret = usb6fire_fw_ezusb_write(device, 9, 0, NULL, 0); ret = usb6fire_fw_ezusb_write(device, 9, 0, NULL, 0);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "unable to upload fpga firmware: " dev_err(&intf->dev,
"end urb.\n"); "unable to upload fpga firmware: end urb.\n");
return ret; return ret;
} }
return 0; return 0;
...@@ -338,7 +342,7 @@ static int usb6fire_fw_fpga_upload( ...@@ -338,7 +342,7 @@ static int usb6fire_fw_fpga_upload(
/* check, if the firmware version the devices has currently loaded /* check, if the firmware version the devices has currently loaded
* is known by this driver. 'version' needs to have 4 bytes version * is known by this driver. 'version' needs to have 4 bytes version
* info data. */ * info data. */
static int usb6fire_fw_check(u8 *version) static int usb6fire_fw_check(struct usb_interface *intf, const u8 *version)
{ {
int i; int i;
...@@ -346,7 +350,7 @@ static int usb6fire_fw_check(u8 *version) ...@@ -346,7 +350,7 @@ static int usb6fire_fw_check(u8 *version)
if (!memcmp(version, known_fw_versions + i, 2)) if (!memcmp(version, known_fw_versions + i, 2))
return 0; return 0;
snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %4ph. " dev_err(&intf->dev, "invalid fimware version in device: %4ph. "
"please reconnect to power. if this failure " "please reconnect to power. if this failure "
"still happens, check your firmware installation.", "still happens, check your firmware installation.",
version); version);
...@@ -364,16 +368,16 @@ int usb6fire_fw_init(struct usb_interface *intf) ...@@ -364,16 +368,16 @@ int usb6fire_fw_init(struct usb_interface *intf)
ret = usb6fire_fw_ezusb_read(device, 1, 0, buffer, 8); ret = usb6fire_fw_ezusb_read(device, 1, 0, buffer, 8);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "unable to receive device " dev_err(&intf->dev,
"firmware state.\n"); "unable to receive device firmware state.\n");
return ret; return ret;
} }
if (buffer[0] != 0xeb || buffer[1] != 0xaa || buffer[2] != 0x55) { if (buffer[0] != 0xeb || buffer[1] != 0xaa || buffer[2] != 0x55) {
snd_printk(KERN_ERR PREFIX "unknown device firmware state " dev_err(&intf->dev,
"received from device: "); "unknown device firmware state received from device:");
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
snd_printk("%02x ", buffer[i]); printk(KERN_CONT "%02x ", buffer[i]);
snd_printk("\n"); printk(KERN_CONT "\n");
return -EIO; return -EIO;
} }
/* do we need fpga loader ezusb firmware? */ /* do we need fpga loader ezusb firmware? */
...@@ -386,7 +390,7 @@ int usb6fire_fw_init(struct usb_interface *intf) ...@@ -386,7 +390,7 @@ int usb6fire_fw_init(struct usb_interface *intf)
} }
/* do we need fpga firmware and application ezusb firmware? */ /* do we need fpga firmware and application ezusb firmware? */
else if (buffer[3] == 0x02) { else if (buffer[3] == 0x02) {
ret = usb6fire_fw_check(buffer + 4); ret = usb6fire_fw_check(intf, buffer + 4);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = usb6fire_fw_fpga_upload(intf, "6fire/dmx6firecf.bin"); ret = usb6fire_fw_fpga_upload(intf, "6fire/dmx6firecf.bin");
...@@ -402,14 +406,14 @@ int usb6fire_fw_init(struct usb_interface *intf) ...@@ -402,14 +406,14 @@ int usb6fire_fw_init(struct usb_interface *intf)
} }
/* all fw loaded? */ /* all fw loaded? */
else if (buffer[3] == 0x03) else if (buffer[3] == 0x03)
return usb6fire_fw_check(buffer + 4); return usb6fire_fw_check(intf, buffer + 4);
/* unknown data? */ /* unknown data? */
else { else {
snd_printk(KERN_ERR PREFIX "unknown device firmware state " dev_err(&intf->dev,
"received from device: "); "unknown device firmware state received from device: ");
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
snd_printk("%02x ", buffer[i]); printk(KERN_CONT "%02x ", buffer[i]);
snd_printk("\n"); printk(KERN_CONT "\n");
return -EIO; return -EIO;
} }
return 0; return 0;
......
...@@ -41,8 +41,9 @@ static void usb6fire_midi_out_handler(struct urb *urb) ...@@ -41,8 +41,9 @@ static void usb6fire_midi_out_handler(struct urb *urb)
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) if (ret < 0)
snd_printk(KERN_ERR PREFIX "midi out urb " dev_err(&urb->dev->dev,
"submit failed: %d\n", ret); "midi out urb submit failed: %d\n",
ret);
} else /* no more data to transmit */ } else /* no more data to transmit */
rt->out = NULL; rt->out = NULL;
} }
...@@ -94,8 +95,9 @@ static void usb6fire_midi_out_trigger( ...@@ -94,8 +95,9 @@ static void usb6fire_midi_out_trigger(
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) if (ret < 0)
snd_printk(KERN_ERR PREFIX "midi out urb " dev_err(&urb->dev->dev,
"submit failed: %d\n", ret); "midi out urb submit failed: %d\n",
ret);
else else
rt->out = alsa_sub; rt->out = alsa_sub;
} }
...@@ -181,7 +183,7 @@ int usb6fire_midi_init(struct sfire_chip *chip) ...@@ -181,7 +183,7 @@ int usb6fire_midi_init(struct sfire_chip *chip)
if (ret < 0) { if (ret < 0) {
kfree(rt->out_buffer); kfree(rt->out_buffer);
kfree(rt); kfree(rt);
snd_printk(KERN_ERR PREFIX "unable to create midi.\n"); dev_err(&chip->dev->dev, "unable to create midi.\n");
return ret; return ret;
} }
rt->instance->private_data = rt; rt->instance->private_data = rt;
......
...@@ -79,32 +79,35 @@ static int usb6fire_pcm_set_rate(struct pcm_runtime *rt) ...@@ -79,32 +79,35 @@ static int usb6fire_pcm_set_rate(struct pcm_runtime *rt)
ctrl_rt->usb_streaming = false; ctrl_rt->usb_streaming = false;
ret = ctrl_rt->update_streaming(ctrl_rt); ret = ctrl_rt->update_streaming(ctrl_rt);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "error stopping streaming while " dev_err(&rt->chip->dev->dev,
"setting samplerate %d.\n", rates[rt->rate]); "error stopping streaming while setting samplerate %d.\n",
rates[rt->rate]);
return ret; return ret;
} }
ret = ctrl_rt->set_rate(ctrl_rt, rt->rate); ret = ctrl_rt->set_rate(ctrl_rt, rt->rate);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "error setting samplerate %d.\n", dev_err(&rt->chip->dev->dev,
rates[rt->rate]); "error setting samplerate %d.\n",
rates[rt->rate]);
return ret; return ret;
} }
ret = ctrl_rt->set_channels(ctrl_rt, OUT_N_CHANNELS, IN_N_CHANNELS, ret = ctrl_rt->set_channels(ctrl_rt, OUT_N_CHANNELS, IN_N_CHANNELS,
false, false); false, false);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "error initializing channels " dev_err(&rt->chip->dev->dev,
"while setting samplerate %d.\n", "error initializing channels while setting samplerate %d.\n",
rates[rt->rate]); rates[rt->rate]);
return ret; return ret;
} }
ctrl_rt->usb_streaming = true; ctrl_rt->usb_streaming = true;
ret = ctrl_rt->update_streaming(ctrl_rt); ret = ctrl_rt->update_streaming(ctrl_rt);
if (ret < 0) { if (ret < 0) {
snd_printk(KERN_ERR PREFIX "error starting streaming while " dev_err(&rt->chip->dev->dev,
"setting samplerate %d.\n", rates[rt->rate]); "error starting streaming while setting samplerate %d.\n",
rates[rt->rate]);
return ret; return ret;
} }
...@@ -124,7 +127,7 @@ static struct pcm_substream *usb6fire_pcm_get_substream( ...@@ -124,7 +127,7 @@ static struct pcm_substream *usb6fire_pcm_get_substream(
return &rt->playback; return &rt->playback;
else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE)
return &rt->capture; return &rt->capture;
snd_printk(KERN_ERR PREFIX "error getting pcm substream slot.\n"); dev_err(&rt->chip->dev->dev, "error getting pcm substream slot.\n");
return NULL; return NULL;
} }
...@@ -257,7 +260,7 @@ static void usb6fire_pcm_playback(struct pcm_substream *sub, ...@@ -257,7 +260,7 @@ static void usb6fire_pcm_playback(struct pcm_substream *sub,
else if (alsa_rt->format == SNDRV_PCM_FORMAT_S24_LE) else if (alsa_rt->format == SNDRV_PCM_FORMAT_S24_LE)
dest = (u32 *) (urb->buffer); dest = (u32 *) (urb->buffer);
else { else {
snd_printk(KERN_ERR PREFIX "Unknown sample format."); dev_err(&rt->chip->dev->dev, "Unknown sample format.");
return; return;
} }
...@@ -307,8 +310,8 @@ static void usb6fire_pcm_in_urb_handler(struct urb *usb_urb) ...@@ -307,8 +310,8 @@ static void usb6fire_pcm_in_urb_handler(struct urb *usb_urb)
} }
if (rt->stream_state == STREAM_DISABLED) { if (rt->stream_state == STREAM_DISABLED) {
snd_printk(KERN_ERR PREFIX "internal error: " dev_err(&rt->chip->dev->dev,
"stream disabled in in-urb handler.\n"); "internal error: stream disabled in in-urb handler.\n");
return; return;
} }
...@@ -410,7 +413,7 @@ static int usb6fire_pcm_open(struct snd_pcm_substream *alsa_sub) ...@@ -410,7 +413,7 @@ static int usb6fire_pcm_open(struct snd_pcm_substream *alsa_sub)
if (!sub) { if (!sub) {
mutex_unlock(&rt->stream_mutex); mutex_unlock(&rt->stream_mutex);
snd_printk(KERN_ERR PREFIX "invalid stream type.\n"); dev_err(&rt->chip->dev->dev, "invalid stream type.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -481,8 +484,9 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub) ...@@ -481,8 +484,9 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub)
break; break;
if (rt->rate == ARRAY_SIZE(rates)) { if (rt->rate == ARRAY_SIZE(rates)) {
mutex_unlock(&rt->stream_mutex); mutex_unlock(&rt->stream_mutex);
snd_printk("invalid rate %d in prepare.\n", dev_err(&rt->chip->dev->dev,
alsa_rt->rate); "invalid rate %d in prepare.\n",
alsa_rt->rate);
return -EINVAL; return -EINVAL;
} }
...@@ -494,8 +498,8 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub) ...@@ -494,8 +498,8 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub)
ret = usb6fire_pcm_stream_start(rt); ret = usb6fire_pcm_stream_start(rt);
if (ret) { if (ret) {
mutex_unlock(&rt->stream_mutex); mutex_unlock(&rt->stream_mutex);
snd_printk(KERN_ERR PREFIX dev_err(&rt->chip->dev->dev,
"could not start pcm stream.\n"); "could not start pcm stream.\n");
return ret; return ret;
} }
} }
...@@ -650,7 +654,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip) ...@@ -650,7 +654,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip)
if (ret < 0) { if (ret < 0) {
usb6fire_pcm_buffers_destroy(rt); usb6fire_pcm_buffers_destroy(rt);
kfree(rt); kfree(rt);
snd_printk(KERN_ERR PREFIX "cannot create pcm instance.\n"); dev_err(&chip->dev->dev, "cannot create pcm instance.\n");
return ret; return ret;
} }
...@@ -662,8 +666,8 @@ int usb6fire_pcm_init(struct sfire_chip *chip) ...@@ -662,8 +666,8 @@ int usb6fire_pcm_init(struct sfire_chip *chip)
if (ret) { if (ret) {
usb6fire_pcm_buffers_destroy(rt); usb6fire_pcm_buffers_destroy(rt);
kfree(rt); kfree(rt);
snd_printk(KERN_ERR PREFIX dev_err(&chip->dev->dev,
"error preallocating pcm buffers.\n"); "error preallocating pcm buffers.\n");
return ret; return ret;
} }
rt->instance = pcm; rt->instance = pcm;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册