lkml.org 
[lkml]   [2023]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 01/11] ASoC: SOF: core: add 'no_wq' probe and remove callbacks
From

> +static inline int snd_sof_remove_no_wq(struct snd_sof_dev *sdev)
> +{
> + if (sof_ops(sdev)->remove_no_wq)
> + return sof_ops(sdev)->remove_no_wq(sdev);
> +
> + return 0;
> +}

> /* probe/remove/shutdown */
> + int (*probe_no_wq)(struct snd_sof_dev *sof_dev); /* optional */
> + int (*remove_no_wq)(struct snd_sof_dev *sof_dev); /* optional */

My initial PR didn't have this remove_no_wq() callback.

For symmetry it could be useful if it is meant to undo what the
probe_no_wq() did, but conceptually the first thing we do in the remove
is make sure that workqueue is either not scheduled or we wait until it
completes.

int snd_sof_device_remove(struct device *dev)
{
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
struct snd_sof_pdata *pdata = sdev->pdata;
int ret;

if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE))
cancel_work_sync(&sdev->probe_work);

\
 
 \ /
  Last update: 2023-08-30 21:32    [W:0.106 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site