diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-03 08:49:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-22 22:38:26 -0500 |
commit | 9abff15dd69c6f4ed88ecc8ba089f55e9cf6655e (patch) | |
tree | 5aca16d7b1f39f0d59cab3e234b3d18c6008f9e5 /drivers/usb/atm/ueagle-atm.c | |
parent | ef58d97a30af66b31f6400e49c87b4d64fc1f5bc (diff) |
USB: ueagle-atm: use system_wq instead of dedicated workqueues
With cmwq, there's no reason to use separate workqueues. Drop
uea_softc->work_q and use system_wq instead. The used work item is
sync flushed on driver detach.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/atm/ueagle-atm.c')
-rw-r--r-- | drivers/usb/atm/ueagle-atm.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index 99ac70e32556..b268e9fccb47 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -168,7 +168,6 @@ struct uea_softc { | |||
168 | union cmv_dsc cmv_dsc; | 168 | union cmv_dsc cmv_dsc; |
169 | 169 | ||
170 | struct work_struct task; | 170 | struct work_struct task; |
171 | struct workqueue_struct *work_q; | ||
172 | u16 pageno; | 171 | u16 pageno; |
173 | u16 ovl; | 172 | u16 ovl; |
174 | 173 | ||
@@ -1879,7 +1878,7 @@ static int uea_start_reset(struct uea_softc *sc) | |||
1879 | /* start loading DSP */ | 1878 | /* start loading DSP */ |
1880 | sc->pageno = 0; | 1879 | sc->pageno = 0; |
1881 | sc->ovl = 0; | 1880 | sc->ovl = 0; |
1882 | queue_work(sc->work_q, &sc->task); | 1881 | schedule_work(&sc->task); |
1883 | 1882 | ||
1884 | /* wait for modem ready CMV */ | 1883 | /* wait for modem ready CMV */ |
1885 | ret = wait_cmv_ack(sc); | 1884 | ret = wait_cmv_ack(sc); |
@@ -2091,14 +2090,14 @@ static void uea_schedule_load_page_e1(struct uea_softc *sc, | |||
2091 | { | 2090 | { |
2092 | sc->pageno = intr->e1_bSwapPageNo; | 2091 | sc->pageno = intr->e1_bSwapPageNo; |
2093 | sc->ovl = intr->e1_bOvl >> 4 | intr->e1_bOvl << 4; | 2092 | sc->ovl = intr->e1_bOvl >> 4 | intr->e1_bOvl << 4; |
2094 | queue_work(sc->work_q, &sc->task); | 2093 | schedule_work(&sc->task); |
2095 | } | 2094 | } |
2096 | 2095 | ||
2097 | static void uea_schedule_load_page_e4(struct uea_softc *sc, | 2096 | static void uea_schedule_load_page_e4(struct uea_softc *sc, |
2098 | struct intr_pkt *intr) | 2097 | struct intr_pkt *intr) |
2099 | { | 2098 | { |
2100 | sc->pageno = intr->e4_bSwapPageNo; | 2099 | sc->pageno = intr->e4_bSwapPageNo; |
2101 | queue_work(sc->work_q, &sc->task); | 2100 | schedule_work(&sc->task); |
2102 | } | 2101 | } |
2103 | 2102 | ||
2104 | /* | 2103 | /* |
@@ -2170,13 +2169,6 @@ static int uea_boot(struct uea_softc *sc) | |||
2170 | 2169 | ||
2171 | init_waitqueue_head(&sc->sync_q); | 2170 | init_waitqueue_head(&sc->sync_q); |
2172 | 2171 | ||
2173 | sc->work_q = create_workqueue("ueagle-dsp"); | ||
2174 | if (!sc->work_q) { | ||
2175 | uea_err(INS_TO_USBDEV(sc), "cannot allocate workqueue\n"); | ||
2176 | uea_leaves(INS_TO_USBDEV(sc)); | ||
2177 | return -ENOMEM; | ||
2178 | } | ||
2179 | |||
2180 | if (UEA_CHIP_VERSION(sc) == ADI930) | 2172 | if (UEA_CHIP_VERSION(sc) == ADI930) |
2181 | load_XILINX_firmware(sc); | 2173 | load_XILINX_firmware(sc); |
2182 | 2174 | ||
@@ -2225,7 +2217,6 @@ err1: | |||
2225 | sc->urb_int = NULL; | 2217 | sc->urb_int = NULL; |
2226 | kfree(intr); | 2218 | kfree(intr); |
2227 | err0: | 2219 | err0: |
2228 | destroy_workqueue(sc->work_q); | ||
2229 | uea_leaves(INS_TO_USBDEV(sc)); | 2220 | uea_leaves(INS_TO_USBDEV(sc)); |
2230 | return -ENOMEM; | 2221 | return -ENOMEM; |
2231 | } | 2222 | } |
@@ -2246,8 +2237,8 @@ static void uea_stop(struct uea_softc *sc) | |||
2246 | kfree(sc->urb_int->transfer_buffer); | 2237 | kfree(sc->urb_int->transfer_buffer); |
2247 | usb_free_urb(sc->urb_int); | 2238 | usb_free_urb(sc->urb_int); |
2248 | 2239 | ||
2249 | /* stop any pending boot process, when no one can schedule work */ | 2240 | /* flush the work item, when no one can schedule it */ |
2250 | destroy_workqueue(sc->work_q); | 2241 | flush_work_sync(&sc->task); |
2251 | 2242 | ||
2252 | if (sc->dsp_firm) | 2243 | if (sc->dsp_firm) |
2253 | release_firmware(sc->dsp_firm); | 2244 | release_firmware(sc->dsp_firm); |