diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 4f6bb58ca5fc..f907a56c587d 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -1854,10 +1854,19 @@ int pvr2_hdw_initialize(struct pvr2_hdw *hdw, | |||
1854 | void *callback_data) | 1854 | void *callback_data) |
1855 | { | 1855 | { |
1856 | LOCK_TAKE(hdw->big_lock); do { | 1856 | LOCK_TAKE(hdw->big_lock); do { |
1857 | if (hdw->flag_disconnected) { | ||
1858 | /* Handle a race here: If we're already | ||
1859 | disconnected by this point, then give up. If we | ||
1860 | get past this then we'll remain connected for | ||
1861 | the duration of initialization since the entire | ||
1862 | initialization sequence is now protected by the | ||
1863 | big_lock. */ | ||
1864 | break; | ||
1865 | } | ||
1857 | hdw->state_data = callback_data; | 1866 | hdw->state_data = callback_data; |
1858 | hdw->state_func = callback_func; | 1867 | hdw->state_func = callback_func; |
1868 | pvr2_hdw_setup(hdw); | ||
1859 | } while (0); LOCK_GIVE(hdw->big_lock); | 1869 | } while (0); LOCK_GIVE(hdw->big_lock); |
1860 | pvr2_hdw_setup(hdw); | ||
1861 | return hdw->flag_init_ok; | 1870 | return hdw->flag_init_ok; |
1862 | } | 1871 | } |
1863 | 1872 | ||