From: Takashi Iwai Date: Tue, 19 Dec 2006 16:08:52 +0000 (+0100) Subject: [ALSA] hda-codec - Use global workqueue X-Git-Tag: Ubuntu-snapdragon-4.4.0-1050.54~43205^2~62^2~81 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e250af291d6759518b574b33317eb3003012bfa2;p=mirror_ubuntu-artful-kernel.git [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: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e14faf5d5053..8f34fb447983 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -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 + 1] = res_ex; - queue_work(unsol->workq, &unsol->work); + schedule_work(&unsol->work); return 0; } @@ -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"); 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); unsol->bus = bus; bus->unsol = unsol; @@ -334,7 +328,7 @@ static int snd_hda_bus_free(struct hda_bus *bus) if (! bus) return 0; if (bus->unsol) { - destroy_workqueue(bus->unsol->workq); + flush_scheduled_work(); kfree(bus->unsol); } list_for_each_safe(p, n, &bus->codec_list) { diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index b2f56d688852..39718d6cdadd 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -199,7 +199,6 @@ struct hda_bus_unsolicited { unsigned int rp, wp; /* workqueue */ - struct workqueue_struct *workq; struct work_struct work; struct hda_bus *bus; };