* [PATCH] [media] em28xx-audio: flush work at .fini
@ 2014-01-14 16:44 Mauro Carvalho Chehab
2014-01-15 21:21 ` Frank Schäfer
0 siblings, 1 reply; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2014-01-14 16:44 UTC (permalink / raw)
Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
Mauro Carvalho Chehab
As a pending action might be still there at the work
thread, flush it.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
drivers/media/usb/em28xx/em28xx-audio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
index 74575e0ed41b..1563f71a5ea2 100644
--- a/drivers/media/usb/em28xx/em28xx-audio.c
+++ b/drivers/media/usb/em28xx/em28xx-audio.c
@@ -967,6 +967,8 @@ static int em28xx_audio_fini(struct em28xx *dev)
em28xx_info("Closing audio extension");
snd_card_disconnect(dev->adev.sndcard);
+ flush_work(&dev->wq_trigger);
+
em28xx_audio_free_urb(dev);
if (dev->adev.sndcard) {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] [media] em28xx-audio: flush work at .fini
2014-01-14 16:44 [PATCH] [media] em28xx-audio: flush work at .fini Mauro Carvalho Chehab
@ 2014-01-15 21:21 ` Frank Schäfer
0 siblings, 0 replies; 2+ messages in thread
From: Frank Schäfer @ 2014-01-15 21:21 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab
Am 14.01.2014 17:44, schrieb Mauro Carvalho Chehab:
> As a pending action might be still there at the work
> thread, flush it.
>
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
> drivers/media/usb/em28xx/em28xx-audio.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
> index 74575e0ed41b..1563f71a5ea2 100644
> --- a/drivers/media/usb/em28xx/em28xx-audio.c
> +++ b/drivers/media/usb/em28xx/em28xx-audio.c
> @@ -967,6 +967,8 @@ static int em28xx_audio_fini(struct em28xx *dev)
> em28xx_info("Closing audio extension");
>
> snd_card_disconnect(dev->adev.sndcard);
> + flush_work(&dev->wq_trigger);
> +
> em28xx_audio_free_urb(dev);
>
> if (dev->adev.sndcard) {
audio_trigger() doesn't re-schedule the work and flush_work() waits
until the current work is finished.
No, wait ! You are calling flush_work here for synchronization, right ?
That makes sense, but you should update the patch description. ;)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-15 21:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 16:44 [PATCH] [media] em28xx-audio: flush work at .fini Mauro Carvalho Chehab
2014-01-15 21:21 ` Frank Schäfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).