Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f016bc3 authored by Bala Kishore Pati's avatar Bala Kishore Pati Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: bg: remove workqueue status check



Ensure to cancel the workqueue in proper state.
delayed_work_pending won't return proper state if
workqueue is currently executing.So remove workqueue
status check before cancelling the workqueue.

Change-Id: I6c1de0fdebb50920d4e8b030b231be0813c8c383
Signed-off-by: default avatarBala Kishore Pati <balakishorepati@codeaurora.org>
parent 3291921f
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -369,7 +369,6 @@ static int _bg_codec_hw_params(struct bg_cdc_priv *bg_cdc)
	struct pktzr_cmd_rsp rsp;
	int ret = 0;

	if (delayed_work_pending(&bg_cdc->bg_cdc_cal_init_work))
	cancel_delayed_work_sync(&bg_cdc->bg_cdc_cal_init_work);
	mutex_lock(&bg_cdc->bg_cdc_lock);
	if (!bg_cdc->bg_dev_up) {
@@ -1124,9 +1123,7 @@ static int bg_cdc_codec_remove(struct snd_soc_codec *codec)
	pr_debug("In func %s\n", __func__);
	pktzr_deinit();

	if (delayed_work_pending(&bg_cdc->bg_cdc_pktzr_init_work))
	cancel_delayed_work_sync(&bg_cdc->bg_cdc_pktzr_init_work);
	if (delayed_work_pending(&bg_cdc->bg_cdc_cal_init_work))
	cancel_delayed_work_sync(&bg_cdc->bg_cdc_cal_init_work);
	if (adsp_state_notifier)
		subsys_notif_unregister_notifier(adsp_state_notifier,
@@ -1146,9 +1143,7 @@ static int bg_cdc_pm_suspend(struct bg_cdc_priv *bg_cdc)
		pr_debug("audio session in progress don't devote\n");
		return 0;
	}
	if (delayed_work_pending(&bg_cdc->bg_cdc_pktzr_init_work))
	cancel_delayed_work_sync(&bg_cdc->bg_cdc_pktzr_init_work);
	if (delayed_work_pending(&bg_cdc->bg_cdc_cal_init_work))
	cancel_delayed_work_sync(&bg_cdc->bg_cdc_cal_init_work);
	mutex_lock(&bg_cdc->bg_cdc_lock);
	if (bg_cdc->bg_cal_updated) {