Commit e250af29 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] hda-codec - Use global workqueue

Use global workqueue for simplicity.
The unsolicited event frequency isn't so high to have own queue.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent dc041e0b
...@@ -263,7 +263,7 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex) ...@@ -263,7 +263,7 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
unsol->queue[wp] = res; unsol->queue[wp] = res;
unsol->queue[wp + 1] = res_ex; unsol->queue[wp + 1] = res_ex;
queue_work(unsol->workq, &unsol->work); schedule_work(&unsol->work);
return 0; return 0;
} }
...@@ -310,12 +310,6 @@ static int init_unsol_queue(struct hda_bus *bus) ...@@ -310,12 +310,6 @@ static int init_unsol_queue(struct hda_bus *bus)
snd_printk(KERN_ERR "hda_codec: can't allocate unsolicited queue\n"); snd_printk(KERN_ERR "hda_codec: can't allocate unsolicited queue\n");
return -ENOMEM; return -ENOMEM;
} }
unsol->workq = create_singlethread_workqueue("hda_codec");
if (! unsol->workq) {
snd_printk(KERN_ERR "hda_codec: can't create workqueue\n");
kfree(unsol);
return -ENOMEM;
}
INIT_WORK(&unsol->work, process_unsol_events); INIT_WORK(&unsol->work, process_unsol_events);
unsol->bus = bus; unsol->bus = bus;
bus->unsol = unsol; bus->unsol = unsol;
...@@ -334,7 +328,7 @@ static int snd_hda_bus_free(struct hda_bus *bus) ...@@ -334,7 +328,7 @@ static int snd_hda_bus_free(struct hda_bus *bus)
if (! bus) if (! bus)
return 0; return 0;
if (bus->unsol) { if (bus->unsol) {
destroy_workqueue(bus->unsol->workq); flush_scheduled_work();
kfree(bus->unsol); kfree(bus->unsol);
} }
list_for_each_safe(p, n, &bus->codec_list) { list_for_each_safe(p, n, &bus->codec_list) {
......
...@@ -199,7 +199,6 @@ struct hda_bus_unsolicited { ...@@ -199,7 +199,6 @@ struct hda_bus_unsolicited {
unsigned int rp, wp; unsigned int rp, wp;
/* workqueue */ /* workqueue */
struct workqueue_struct *workq;
struct work_struct work; struct work_struct work;
struct hda_bus *bus; struct hda_bus *bus;
}; };
......
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