diff options
author | Andreas Bergmeier <lcid-fire@gmx.net> | 2009-01-24 06:15:14 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-01-27 05:40:13 -0500 |
commit | b9d710b3c530ed91e8683933fe94c7605d175bf5 (patch) | |
tree | 50a41163d8ab4d22d52cbbccffad2387b535909d /sound | |
parent | 160389c8d21c8139a93191c2e5ca2273f311ed4e (diff) |
ALSA: usbaudio - use printf format instead of hardcoding it
Rather use printf format instead of hardcoding prefix like 0x.
A next step would be to predefine certain formats.
Signed-off-by: Andreas Bergmeier <lcid-fire@gmx.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/usbaudio.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 44485b29f675..4636926d12d7 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -1280,14 +1280,14 @@ static int init_usb_sample_rate(struct usb_device *dev, int iface, | |||
1280 | if ((err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, | 1280 | if ((err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, |
1281 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, | 1281 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, |
1282 | SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) { | 1282 | SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) { |
1283 | snd_printk(KERN_ERR "%d:%d:%d: cannot set freq %d to ep 0x%x\n", | 1283 | snd_printk(KERN_ERR "%d:%d:%d: cannot set freq %d to ep %#x\n", |
1284 | dev->devnum, iface, fmt->altsetting, rate, ep); | 1284 | dev->devnum, iface, fmt->altsetting, rate, ep); |
1285 | return err; | 1285 | return err; |
1286 | } | 1286 | } |
1287 | if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR, | 1287 | if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR, |
1288 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_IN, | 1288 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_IN, |
1289 | SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) { | 1289 | SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) { |
1290 | snd_printk(KERN_WARNING "%d:%d:%d: cannot get freq at ep 0x%x\n", | 1290 | snd_printk(KERN_WARNING "%d:%d:%d: cannot get freq at ep %#x\n", |
1291 | dev->devnum, iface, fmt->altsetting, ep); | 1291 | dev->devnum, iface, fmt->altsetting, ep); |
1292 | return 0; /* some devices don't support reading */ | 1292 | return 0; /* some devices don't support reading */ |
1293 | } | 1293 | } |
@@ -1456,7 +1456,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, | |||
1456 | channels = params_channels(hw_params); | 1456 | channels = params_channels(hw_params); |
1457 | fmt = find_format(subs, format, rate, channels); | 1457 | fmt = find_format(subs, format, rate, channels); |
1458 | if (!fmt) { | 1458 | if (!fmt) { |
1459 | snd_printd(KERN_DEBUG "cannot set format: format = 0x%x, rate = %d, channels = %d\n", | 1459 | snd_printd(KERN_DEBUG "cannot set format: format = %#x, rate = %d, channels = %d\n", |
1460 | format, rate, channels); | 1460 | format, rate, channels); |
1461 | return -EINVAL; | 1461 | return -EINVAL; |
1462 | } | 1462 | } |
@@ -2148,7 +2148,7 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s | |||
2148 | fp = list_entry(p, struct audioformat, list); | 2148 | fp = list_entry(p, struct audioformat, list); |
2149 | snd_iprintf(buffer, " Interface %d\n", fp->iface); | 2149 | snd_iprintf(buffer, " Interface %d\n", fp->iface); |
2150 | snd_iprintf(buffer, " Altset %d\n", fp->altsetting); | 2150 | snd_iprintf(buffer, " Altset %d\n", fp->altsetting); |
2151 | snd_iprintf(buffer, " Format: 0x%x\n", fp->format); | 2151 | snd_iprintf(buffer, " Format: %#x\n", fp->format); |
2152 | snd_iprintf(buffer, " Channels: %d\n", fp->channels); | 2152 | snd_iprintf(buffer, " Channels: %d\n", fp->channels); |
2153 | snd_iprintf(buffer, " Endpoint: %d %s (%s)\n", | 2153 | snd_iprintf(buffer, " Endpoint: %d %s (%s)\n", |
2154 | fp->endpoint & USB_ENDPOINT_NUMBER_MASK, | 2154 | fp->endpoint & USB_ENDPOINT_NUMBER_MASK, |
@@ -2168,7 +2168,7 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s | |||
2168 | snd_iprintf(buffer, "\n"); | 2168 | snd_iprintf(buffer, "\n"); |
2169 | } | 2169 | } |
2170 | // snd_iprintf(buffer, " Max Packet Size = %d\n", fp->maxpacksize); | 2170 | // snd_iprintf(buffer, " Max Packet Size = %d\n", fp->maxpacksize); |
2171 | // snd_iprintf(buffer, " EP Attribute = 0x%x\n", fp->attributes); | 2171 | // snd_iprintf(buffer, " EP Attribute = %#x\n", fp->attributes); |
2172 | } | 2172 | } |
2173 | } | 2173 | } |
2174 | 2174 | ||
@@ -2607,7 +2607,7 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, struct audioformat | |||
2607 | fp->format = SNDRV_PCM_FORMAT_MPEG; | 2607 | fp->format = SNDRV_PCM_FORMAT_MPEG; |
2608 | break; | 2608 | break; |
2609 | default: | 2609 | default: |
2610 | snd_printd(KERN_INFO "%d:%u:%d : unknown format tag 0x%x is detected. processed as MPEG.\n", | 2610 | snd_printd(KERN_INFO "%d:%u:%d : unknown format tag %#x is detected. processed as MPEG.\n", |
2611 | chip->dev->devnum, fp->iface, fp->altsetting, format); | 2611 | chip->dev->devnum, fp->iface, fp->altsetting, format); |
2612 | fp->format = SNDRV_PCM_FORMAT_MPEG; | 2612 | fp->format = SNDRV_PCM_FORMAT_MPEG; |
2613 | break; | 2613 | break; |
@@ -2805,7 +2805,7 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
2805 | continue; | 2805 | continue; |
2806 | } | 2806 | } |
2807 | 2807 | ||
2808 | snd_printdd(KERN_INFO "%d:%u:%d: add audio endpoint 0x%x\n", dev->devnum, iface_no, altno, fp->endpoint); | 2808 | snd_printdd(KERN_INFO "%d:%u:%d: add audio endpoint %#x\n", dev->devnum, iface_no, altno, fp->endpoint); |
2809 | err = add_audio_endpoint(chip, stream, fp); | 2809 | err = add_audio_endpoint(chip, stream, fp); |
2810 | if (err < 0) { | 2810 | if (err < 0) { |
2811 | kfree(fp->rate_table); | 2811 | kfree(fp->rate_table); |