提交 f3990e61 编写于 作者: C Clemens Ladisch 提交者: Takashi Iwai

sound: usb-audio: remove MIN_PACKS_URB

Remove the MIN_PACKS_URB symbol because other limits can force the
number of packets down to one, regardless of the value of this symbol,
and nobody has ever changed it anyway.
Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 54530bde
...@@ -107,7 +107,6 @@ MODULE_PARM_DESC(ignore_ctl_error, ...@@ -107,7 +107,6 @@ MODULE_PARM_DESC(ignore_ctl_error,
#define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */ #define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */
#define MAX_URBS 8 #define MAX_URBS 8
#define SYNC_URBS 4 /* always four urbs for sync */ #define SYNC_URBS 4 /* always four urbs for sync */
#define MIN_PACKS_URB 1 /* minimum 1 packet per urb */
#define MAX_QUEUE 24 /* try not to exceed this queue length, in ms */ #define MAX_QUEUE 24 /* try not to exceed this queue length, in ms */
struct audioformat { struct audioformat {
...@@ -1071,8 +1070,7 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri ...@@ -1071,8 +1070,7 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri
subs->packs_per_ms = packs_per_ms; subs->packs_per_ms = packs_per_ms;
if (is_playback) { if (is_playback) {
urb_packs = nrpacks; urb_packs = max(nrpacks, 1);
urb_packs = max(urb_packs, (unsigned int)MIN_PACKS_URB);
urb_packs = min(urb_packs, (unsigned int)MAX_PACKS); urb_packs = min(urb_packs, (unsigned int)MAX_PACKS);
} else } else
urb_packs = 1; urb_packs = 1;
...@@ -1093,9 +1091,9 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri ...@@ -1093,9 +1091,9 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri
total_packs = (total_packs + packs_per_ms - 1) total_packs = (total_packs + packs_per_ms - 1)
& ~(packs_per_ms - 1); & ~(packs_per_ms - 1);
/* we need at least two URBs for queueing */ /* we need at least two URBs for queueing */
if (total_packs < 2 * MIN_PACKS_URB * packs_per_ms) if (total_packs < 2 * packs_per_ms) {
total_packs = 2 * MIN_PACKS_URB * packs_per_ms; total_packs = 2 * packs_per_ms;
else { } else {
/* and we don't want too long a queue either */ /* and we don't want too long a queue either */
maxpacks = max((unsigned int)MAX_QUEUE, urb_packs * 2); maxpacks = max((unsigned int)MAX_QUEUE, urb_packs * 2);
if (total_packs > maxpacks * packs_per_ms) if (total_packs > maxpacks * packs_per_ms)
...@@ -1909,7 +1907,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre ...@@ -1909,7 +1907,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
* in the current code assume the 1ms period. * in the current code assume the 1ms period.
*/ */
snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME, snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME,
1000 * MIN_PACKS_URB, 1000,
/*(nrpacks * MAX_URBS) * 1000*/ UINT_MAX); /*(nrpacks * MAX_URBS) * 1000*/ UINT_MAX);
err = check_hw_params_convention(subs); err = check_hw_params_convention(subs);
...@@ -3753,7 +3751,7 @@ static int usb_audio_resume(struct usb_interface *intf) ...@@ -3753,7 +3751,7 @@ static int usb_audio_resume(struct usb_interface *intf)
static int __init snd_usb_audio_init(void) static int __init snd_usb_audio_init(void)
{ {
if (nrpacks < MIN_PACKS_URB || nrpacks > MAX_PACKS) { if (nrpacks < 1 || nrpacks > MAX_PACKS) {
printk(KERN_WARNING "invalid nrpacks value.\n"); printk(KERN_WARNING "invalid nrpacks value.\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册