diff options
Diffstat (limited to 'drivers/media/usb/gspca')
-rw-r--r-- | drivers/media/usb/gspca/benq.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/gspca/finepix.c | 8 | ||||
-rw-r--r-- | drivers/media/usb/gspca/gspca.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/gspca/jl2005bcd.c | 8 | ||||
-rw-r--r-- | drivers/media/usb/gspca/konica.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/gspca/sonixj.c | 13 | ||||
-rw-r--r-- | drivers/media/usb/gspca/vicam.c | 8 |
7 files changed, 13 insertions, 36 deletions
diff --git a/drivers/media/usb/gspca/benq.c b/drivers/media/usb/gspca/benq.c index 790baed33963..5fa67b78ad49 100644 --- a/drivers/media/usb/gspca/benq.c +++ b/drivers/media/usb/gspca/benq.c @@ -95,10 +95,8 @@ static int sd_start(struct gspca_dev *gspca_dev) #define SD_NPKT 32 for (n = 0; n < 4; n++) { urb = usb_alloc_urb(SD_NPKT, GFP_KERNEL); - if (!urb) { - pr_err("usb_alloc_urb failed\n"); + if (!urb) return -ENOMEM; - } gspca_dev->urb[n] = urb; urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev, SD_PKT_SZ * SD_NPKT, diff --git a/drivers/media/usb/gspca/finepix.c b/drivers/media/usb/gspca/finepix.c index 52bdb569760b..ae9a55d7bbbb 100644 --- a/drivers/media/usb/gspca/finepix.c +++ b/drivers/media/usb/gspca/finepix.c @@ -41,7 +41,6 @@ struct usb_fpix { struct gspca_dev gspca_dev; /* !! must be the first item */ struct work_struct work_struct; - struct workqueue_struct *work_thread; }; /* Delay after which claim the next frame. If the delay is too small, @@ -226,9 +225,7 @@ static int sd_start(struct gspca_dev *gspca_dev) /* Again, reset bulk in endpoint */ usb_clear_halt(gspca_dev->dev, gspca_dev->urb[0]->pipe); - /* Start the workqueue function to do the streaming */ - dev->work_thread = create_singlethread_workqueue(MODULE_NAME); - queue_work(dev->work_thread, &dev->work_struct); + schedule_work(&dev->work_struct); return 0; } @@ -241,9 +238,8 @@ static void sd_stop0(struct gspca_dev *gspca_dev) /* wait for the work queue to terminate */ mutex_unlock(&gspca_dev->usb_lock); - destroy_workqueue(dev->work_thread); + flush_work(&dev->work_struct); mutex_lock(&gspca_dev->usb_lock); - dev->work_thread = NULL; } /* Table of supported USB devices */ diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index b17bd7ebcb47..af2395a76d8b 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -795,10 +795,8 @@ static int create_urbs(struct gspca_dev *gspca_dev, for (n = 0; n < nurbs; n++) { urb = usb_alloc_urb(npkt, GFP_KERNEL); - if (!urb) { - pr_err("usb_alloc_urb failed\n"); + if (!urb) return -ENOMEM; - } gspca_dev->urb[n] = urb; urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev, bsize, diff --git a/drivers/media/usb/gspca/jl2005bcd.c b/drivers/media/usb/gspca/jl2005bcd.c index 5b481fa43099..ac295f04bd18 100644 --- a/drivers/media/usb/gspca/jl2005bcd.c +++ b/drivers/media/usb/gspca/jl2005bcd.c @@ -45,7 +45,6 @@ struct sd { const struct v4l2_pix_format *cap_mode; /* Driver stuff */ struct work_struct work_struct; - struct workqueue_struct *work_thread; u8 frame_brightness; int block_size; /* block size of camera */ int vga; /* 1 if vga cam, 0 if cif cam */ @@ -477,9 +476,7 @@ static int sd_start(struct gspca_dev *gspca_dev) return -1; } - /* Start the workqueue function to do the streaming */ - sd->work_thread = create_singlethread_workqueue(MODULE_NAME); - queue_work(sd->work_thread, &sd->work_struct); + schedule_work(&sd->work_struct); return 0; } @@ -493,8 +490,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev) /* wait for the work queue to terminate */ mutex_unlock(&gspca_dev->usb_lock); /* This waits for sq905c_dostream to finish */ - destroy_workqueue(dev->work_thread); - dev->work_thread = NULL; + flush_work(&dev->work_struct); mutex_lock(&gspca_dev->usb_lock); } diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c index 0712b1bc90b4..40aaaa9c5f30 100644 --- a/drivers/media/usb/gspca/konica.c +++ b/drivers/media/usb/gspca/konica.c @@ -208,10 +208,8 @@ static int sd_start(struct gspca_dev *gspca_dev) packet_size = le16_to_cpu(alt->endpoint[i].desc.wMaxPacketSize); urb = usb_alloc_urb(SD_NPKT, GFP_KERNEL); - if (!urb) { - pr_err("usb_alloc_urb failed\n"); + if (!urb) return -ENOMEM; - } gspca_dev->urb[n] = urb; urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev, packet_size * SD_NPKT, diff --git a/drivers/media/usb/gspca/sonixj.c b/drivers/media/usb/gspca/sonixj.c index fd1c8706d86a..d49d76ec1421 100644 --- a/drivers/media/usb/gspca/sonixj.c +++ b/drivers/media/usb/gspca/sonixj.c @@ -54,7 +54,6 @@ struct sd { u32 exposure; struct work_struct work; - struct workqueue_struct *work_thread; u32 pktsz; /* (used by pkt_scan) */ u16 npkt; @@ -2485,7 +2484,6 @@ static int sd_start(struct gspca_dev *gspca_dev) sd->pktsz = sd->npkt = 0; sd->nchg = sd->short_mark = 0; - sd->work_thread = create_singlethread_workqueue(MODULE_NAME); return gspca_dev->usb_err; } @@ -2569,12 +2567,9 @@ static void sd_stop0(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; - if (sd->work_thread != NULL) { - mutex_unlock(&gspca_dev->usb_lock); - destroy_workqueue(sd->work_thread); - mutex_lock(&gspca_dev->usb_lock); - sd->work_thread = NULL; - } + mutex_unlock(&gspca_dev->usb_lock); + flush_work(&sd->work); + mutex_lock(&gspca_dev->usb_lock); } static void do_autogain(struct gspca_dev *gspca_dev) @@ -2785,7 +2780,7 @@ marker_found: new_qual = QUALITY_MAX; if (new_qual != sd->quality) { sd->quality = new_qual; - queue_work(sd->work_thread, &sd->work); + schedule_work(&sd->work); } } } else { diff --git a/drivers/media/usb/gspca/vicam.c b/drivers/media/usb/gspca/vicam.c index 103f6c4236b0..8860510c2f9c 100644 --- a/drivers/media/usb/gspca/vicam.c +++ b/drivers/media/usb/gspca/vicam.c @@ -47,7 +47,6 @@ MODULE_FIRMWARE(VICAM_FIRMWARE); struct sd { struct gspca_dev gspca_dev; /* !! must be the first item */ struct work_struct work_struct; - struct workqueue_struct *work_thread; }; /* The vicam sensor has a resolution of 512 x 244, with I believe square @@ -278,9 +277,7 @@ static int sd_start(struct gspca_dev *gspca_dev) if (ret < 0) return ret; - /* Start the workqueue function to do the streaming */ - sd->work_thread = create_singlethread_workqueue(MODULE_NAME); - queue_work(sd->work_thread, &sd->work_struct); + schedule_work(&sd->work_struct); return 0; } @@ -294,8 +291,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev) /* wait for the work queue to terminate */ mutex_unlock(&gspca_dev->usb_lock); /* This waits for vicam_dostream to finish */ - destroy_workqueue(dev->work_thread); - dev->work_thread = NULL; + flush_work(&dev->work_struct); mutex_lock(&gspca_dev->usb_lock); if (gspca_dev->present) |