[media] gspca: Call sd_stop0 on disconnect
authorHans de Goede <hdegoede@redhat.com>
Mon, 7 May 2012 09:25:30 +0000 (06:25 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 14 May 2012 12:32:18 +0000 (09:32 -0300)
commiteb238732a52b100bdf4a766a50e11e6fd9bd1d83
tree4a21370c4c3827c9e1d06bcb1384ab08a355dab9
parenta2d887c5fea33f341fd0d2a1487150473cf69014
[media] gspca: Call sd_stop0 on disconnect

This is necessary to ensure that worker-threads accessing the device
are stopped before our disconnect handler returns.

This causes a problem with stream_off calling sd_stop0 a second time
when the device handle is closed. This is fixed by setting
gscpa_dev->streaming to 0 on disconnect.

Note that now stream_off will never be called on a disconnected device,
and the present check can thus be removed from stream_off.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gspca.c