aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/sst-haswell-ipc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/sst-haswell-ipc.c')
-rw-r--r--sound/soc/intel/sst-haswell-ipc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
index e7996b39a484..434236343ddf 100644
--- a/sound/soc/intel/sst-haswell-ipc.c
+++ b/sound/soc/intel/sst-haswell-ipc.c
@@ -25,7 +25,6 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/sched.h> 27#include <linux/sched.h>
28#include <linux/list.h>
29#include <linux/platform_device.h> 28#include <linux/platform_device.h>
30#include <linux/kthread.h> 29#include <linux/kthread.h>
31#include <linux/firmware.h> 30#include <linux/firmware.h>
@@ -1730,17 +1729,17 @@ int sst_hsw_dsp_init(struct device *dev, struct sst_pdata *pdata)
1730 1729
1731 ret = msg_empty_list_init(hsw); 1730 ret = msg_empty_list_init(hsw);
1732 if (ret < 0) 1731 if (ret < 0)
1733 goto list_err; 1732 return -ENOMEM;
1734 1733
1735 /* start the IPC message thread */ 1734 /* start the IPC message thread */
1736 init_kthread_worker(&hsw->kworker); 1735 init_kthread_worker(&hsw->kworker);
1737 hsw->tx_thread = kthread_run(kthread_worker_fn, 1736 hsw->tx_thread = kthread_run(kthread_worker_fn,
1738 &hsw->kworker, 1737 &hsw->kworker, "%s",
1739 dev_name(hsw->dev)); 1738 dev_name(hsw->dev));
1740 if (IS_ERR(hsw->tx_thread)) { 1739 if (IS_ERR(hsw->tx_thread)) {
1741 ret = PTR_ERR(hsw->tx_thread); 1740 ret = PTR_ERR(hsw->tx_thread);
1742 dev_err(hsw->dev, "error: failed to create message TX task\n"); 1741 dev_err(hsw->dev, "error: failed to create message TX task\n");
1743 goto list_err; 1742 goto err_free_msg;
1744 } 1743 }
1745 init_kthread_work(&hsw->kwork, ipc_tx_msgs); 1744 init_kthread_work(&hsw->kwork, ipc_tx_msgs);
1746 1745
@@ -1750,7 +1749,7 @@ int sst_hsw_dsp_init(struct device *dev, struct sst_pdata *pdata)
1750 hsw->dsp = sst_dsp_new(dev, &hsw_dev, pdata); 1749 hsw->dsp = sst_dsp_new(dev, &hsw_dev, pdata);
1751 if (hsw->dsp == NULL) { 1750 if (hsw->dsp == NULL) {
1752 ret = -ENODEV; 1751 ret = -ENODEV;
1753 goto list_err; 1752 goto dsp_err;
1754 } 1753 }
1755 1754
1756 /* keep the DSP in reset state for base FW loading */ 1755 /* keep the DSP in reset state for base FW loading */
@@ -1794,8 +1793,11 @@ boot_err:
1794 sst_fw_free(hsw_sst_fw); 1793 sst_fw_free(hsw_sst_fw);
1795fw_err: 1794fw_err:
1796 sst_dsp_free(hsw->dsp); 1795 sst_dsp_free(hsw->dsp);
1796dsp_err:
1797 kthread_stop(hsw->tx_thread);
1798err_free_msg:
1797 kfree(hsw->msg); 1799 kfree(hsw->msg);
1798list_err: 1800
1799 return ret; 1801 return ret;
1800} 1802}
1801EXPORT_SYMBOL_GPL(sst_hsw_dsp_init); 1803EXPORT_SYMBOL_GPL(sst_hsw_dsp_init);
@@ -1808,6 +1810,7 @@ void sst_hsw_dsp_free(struct device *dev, struct sst_pdata *pdata)
1808 sst_fw_free_all(hsw->dsp); 1810 sst_fw_free_all(hsw->dsp);
1809 sst_dsp_free(hsw->dsp); 1811 sst_dsp_free(hsw->dsp);
1810 kfree(hsw->scratch); 1812 kfree(hsw->scratch);
1813 kthread_stop(hsw->tx_thread);
1811 kfree(hsw->msg); 1814 kfree(hsw->msg);
1812} 1815}
1813EXPORT_SYMBOL_GPL(sst_hsw_dsp_free); 1816EXPORT_SYMBOL_GPL(sst_hsw_dsp_free);