wcte12xp, wctdm24xxp: Use a constant string for the VPM workqueue name.

In my opinion naming the VPM workqueues for each board is not worth the
extra complexity.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9950 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Shaun Ruffell 2011-06-02 20:02:23 +00:00
parent b60823b0cc
commit 205847da8e
4 changed files with 6 additions and 22 deletions

View File

@ -492,30 +492,17 @@ void vpmadt032_echocan_free(struct vpmadt032 *vpm, int channo,
EXPORT_SYMBOL(vpmadt032_echocan_free);
struct vpmadt032 *
vpmadt032_alloc(struct vpmadt032_options *options, const char *board_name)
vpmadt032_alloc(struct vpmadt032_options *options)
{
struct vpmadt032 *vpm;
int i;
const char *suffix = "-vpm";
size_t length;
might_sleep();
length = strlen(board_name) + strlen(suffix) + 1;
/* Add a little extra to store the wq_name. */
vpm = kzalloc(sizeof(*vpm) + length, GFP_KERNEL);
vpm = kzalloc(sizeof(*vpm), GFP_KERNEL);
if (!vpm)
return NULL;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
/* There is a limit on the length of the name of the workqueue. */
strcpy(vpm->wq_name, "vpmadt032");
#else
strcpy(vpm->wq_name, board_name);
strcat(vpm->wq_name, suffix);
#endif
/* Init our vpmadt032 struct */
memcpy(&vpm->options, options, sizeof(*options));
spin_lock_init(&vpm->list_lock);
@ -531,7 +518,7 @@ vpmadt032_alloc(struct vpmadt032_options *options, const char *board_name)
* the operations can take 100s of ms, most of that time spent sleeping.
* On single CPU systems, this unduly serializes operations accross
* multiple vpmadt032 instances. */
vpm->wq = create_singlethread_workqueue(vpm->wq_name);
vpm->wq = create_singlethread_workqueue("vpmadt032");
if (!vpm->wq) {
kfree(vpm);
return NULL;

View File

@ -128,8 +128,6 @@ struct vpmadt032 {
struct list_head active_cmds;
struct vpmadt032_options options;
void (*setchanconfig_from_state)(struct vpmadt032 *vpm, int channel, struct GpakChannelConfig *chanconfig);
/* This must be last */
char wq_name[0];
};
struct voicebus;
@ -141,8 +139,7 @@ struct dahdi_echocan_state;
char vpmadt032tone_to_zaptone(GpakToneCodes_t tone);
int vpmadt032_init(struct vpmadt032 *vpm, struct voicebus *vb);
int vpmadt032_reset(struct vpmadt032 *vpm);
struct vpmadt032 *vpmadt032_alloc(struct vpmadt032_options *options,
const char *board_name);
struct vpmadt032 *vpmadt032_alloc(struct vpmadt032_options *options);
void vpmadt032_free(struct vpmadt032 *vpm);
int vpmadt032_echocan_create(struct vpmadt032 *vpm, int channo,
enum adt_companding companding,

View File

@ -3833,7 +3833,7 @@ static int wctdm_initialize_vpmadt032(struct wctdm *wc)
options.vpmnlpmaxsupp = vpmnlpmaxsupp;
options.channels = wc->avchannels;
wc->vpmadt032 = vpmadt032_alloc(&options, wc->board_name);
wc->vpmadt032 = vpmadt032_alloc(&options);
if (!wc->vpmadt032)
return -ENOMEM;

View File

@ -1418,7 +1418,7 @@ static int check_and_load_vpm(struct t1 *wc)
* done setting it up here, an hour should cover it... */
wc->vpm_check = jiffies + HZ*3600;
vpm = vpmadt032_alloc(&options, wc->name);
vpm = vpmadt032_alloc(&options);
if (!vpm)
return -ENOMEM;