Commit e8c0ee5d authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Fix misc workqueue issues

Some fixes regarding snd-hda-intel workqueue:
- Use create_singlethread_workqueue() instead of create_workqueue()
  as per-CPU work isn't required.
- Allocate workq name string properly
- Renamed the workq name to "hd-audio*" to be more obvious.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f67d8176
...@@ -487,7 +487,6 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card, ...@@ -487,7 +487,6 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card,
{ {
struct hda_bus *bus; struct hda_bus *bus;
int err; int err;
char qname[8];
static struct snd_device_ops dev_ops = { static struct snd_device_ops dev_ops = {
.dev_register = snd_hda_bus_dev_register, .dev_register = snd_hda_bus_dev_register,
.dev_free = snd_hda_bus_dev_free, .dev_free = snd_hda_bus_dev_free,
...@@ -517,10 +516,12 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card, ...@@ -517,10 +516,12 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card,
mutex_init(&bus->cmd_mutex); mutex_init(&bus->cmd_mutex);
INIT_LIST_HEAD(&bus->codec_list); INIT_LIST_HEAD(&bus->codec_list);
snprintf(qname, sizeof(qname), "hda%d", card->number); snprintf(bus->workq_name, sizeof(bus->workq_name),
bus->workq = create_workqueue(qname); "hd-audio%d", card->number);
bus->workq = create_singlethread_workqueue(bus->workq_name);
if (!bus->workq) { if (!bus->workq) {
snd_printk(KERN_ERR "cannot create workqueue %s\n", qname); snd_printk(KERN_ERR "cannot create workqueue %s\n",
bus->workq_name);
kfree(bus); kfree(bus);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -614,6 +614,7 @@ struct hda_bus { ...@@ -614,6 +614,7 @@ struct hda_bus {
/* unsolicited event queue */ /* unsolicited event queue */
struct hda_bus_unsolicited *unsol; struct hda_bus_unsolicited *unsol;
char workq_name[16];
struct workqueue_struct *workq; /* common workqueue for codecs */ struct workqueue_struct *workq; /* common workqueue for codecs */
/* assigned PCMs */ /* assigned PCMs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment