struct hda_bus_unsolicited *unsol;
unsigned int wp;
- if (!bus || !bus->workq)
+ if (!bus)
return 0;
trace_hda_unsol_event(bus, res, res_ex);
unsol->queue[wp] = res;
unsol->queue[wp + 1] = res_ex;
- queue_work(bus->workq, &unsol->work);
+ schedule_work(&unsol->work);
return 0;
}
return;
WARN_ON(!list_empty(&bus->codec_list));
- if (bus->workq)
- flush_workqueue(bus->workq);
+ cancel_work_sync(&bus->unsol.work);
if (bus->ops.private_free)
bus->ops.private_free(bus);
- if (bus->workq)
- destroy_workqueue(bus->workq);
-
kfree(bus);
}
INIT_LIST_HEAD(&bus->codec_list);
INIT_WORK(&bus->unsol.work, process_unsol_events);
- snprintf(bus->workq_name, sizeof(bus->workq_name),
- "hd-audio%d", card->number);
- bus->workq = create_singlethread_workqueue(bus->workq_name);
- if (!bus->workq) {
- dev_err(card->dev, "cannot create workqueue %s\n",
- bus->workq_name);
- kfree(bus);
- return -ENOMEM;
- }
-
err = snd_device_new(card, SNDRV_DEV_BUS, bus, &dev_ops);
if (err < 0) {
snd_hda_bus_free(bus);
if (!codec->jackpoll_interval)
return;
- queue_delayed_work(codec->bus->workq, &codec->jackpoll_work,
- codec->jackpoll_interval);
+ schedule_delayed_work(&codec->jackpoll_work,
+ codec->jackpoll_interval);
}
static void init_hda_cache(struct hda_cache_rec *cache,
void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec)
{
cancel_delayed_work_sync(&codec->jackpoll_work);
- flush_workqueue(codec->bus->workq);
if (!codec->in_freeing)
snd_hda_ctls_clear(codec);
codec_release_pcms(codec);
if (device_is_registered(hda_codec_dev(codec)))
device_del(hda_codec_dev(codec));
free_init_pincfgs(codec);
- flush_workqueue(codec->bus->workq);
list_del(&codec->list);
codec->bus->caddr_tbl[codec->addr] = NULL;
clear_bit(codec->addr, &codec->bus->codec_powered);
/* unsolicited event queue */
struct hda_bus_unsolicited unsol;
- char workq_name[16];
- struct workqueue_struct *workq; /* common workqueue for codecs */
/* assigned PCMs */
DECLARE_BITMAP(pcm_dev_bits, SNDRV_PCM_DEVICES);
if (ok == 1) {
azx_dev->irq_pending = 0;
return ok;
- } else if (ok == 0 && chip->bus && chip->bus->workq) {
+ } else if (ok == 0) {
/* bogus IRQ, process it later */
azx_dev->irq_pending = 1;
- queue_work(chip->bus->workq, &hda->irq_pending_work);
+ schedule_work(&hda->irq_pending_work);
}
return 0;
}
if (status && bus) {
list_for_each_entry(codec, &bus->codec_list, list)
if (status & (1 << codec->addr))
- queue_delayed_work(codec->bus->workq,
- &codec->jackpoll_work, codec->jackpoll_interval);
+ schedule_delayed_work(&codec->jackpoll_work,
+ codec->jackpoll_interval);
}
/* disable controller Wake Up event*/
* state machine run.
*/
cancel_delayed_work_sync(&spec->unsol_hp_work);
- queue_delayed_work(codec->bus->workq, &spec->unsol_hp_work,
- msecs_to_jiffies(500));
+ schedule_delayed_work(&spec->unsol_hp_work, msecs_to_jiffies(500));
cb->tbl->block_report = 1;
}
update_eld = true;
}
else if (repoll) {
- queue_delayed_work(codec->bus->workq,
- &per_pin->work,
- msecs_to_jiffies(300));
+ schedule_delayed_work(&per_pin->work,
+ msecs_to_jiffies(300));
goto unlock;
}
}
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
- cancel_delayed_work(&per_pin->work);
+ cancel_delayed_work_sync(&per_pin->work);
eld_proc_free(per_pin);
}
- flush_workqueue(codec->bus->workq);
hdmi_array_free(spec);
kfree(spec);
}
if (!spec->hp_work_active) {
codec->jackpoll_interval = msecs_to_jiffies(100);
snd_hda_codec_write(codec, 0x1, 0, 0xf81, 0);
- queue_delayed_work(codec->bus->workq,
- &codec->jackpoll_work, 0);
+ schedule_delayed_work(&codec->jackpoll_work, 0);
spec->hp_work_active = true;
}
} else if (!hp_detect_with_aa(codec))