Skip to content

Commit 9abff15

Browse files
htejungregkh
authored andcommitted
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>
1 parent ef58d97 commit 9abff15

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

drivers/usb/atm/ueagle-atm.c

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ struct uea_softc {
168168
union cmv_dsc cmv_dsc;
169169

170170
struct work_struct task;
171-
struct workqueue_struct *work_q;
172171
u16 pageno;
173172
u16 ovl;
174173

@@ -1879,7 +1878,7 @@ static int uea_start_reset(struct uea_softc *sc)
18791878
/* start loading DSP */
18801879
sc->pageno = 0;
18811880
sc->ovl = 0;
1882-
queue_work(sc->work_q, &sc->task);
1881+
schedule_work(&sc->task);
18831882

18841883
/* wait for modem ready CMV */
18851884
ret = wait_cmv_ack(sc);
@@ -2091,14 +2090,14 @@ static void uea_schedule_load_page_e1(struct uea_softc *sc,
20912090
{
20922091
sc->pageno = intr->e1_bSwapPageNo;
20932092
sc->ovl = intr->e1_bOvl >> 4 | intr->e1_bOvl << 4;
2094-
queue_work(sc->work_q, &sc->task);
2093+
schedule_work(&sc->task);
20952094
}
20962095

20972096
static void uea_schedule_load_page_e4(struct uea_softc *sc,
20982097
struct intr_pkt *intr)
20992098
{
21002099
sc->pageno = intr->e4_bSwapPageNo;
2101-
queue_work(sc->work_q, &sc->task);
2100+
schedule_work(&sc->task);
21022101
}
21032102

21042103
/*
@@ -2170,13 +2169,6 @@ static int uea_boot(struct uea_softc *sc)
21702169

21712170
init_waitqueue_head(&sc->sync_q);
21722171

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-
21802172
if (UEA_CHIP_VERSION(sc) == ADI930)
21812173
load_XILINX_firmware(sc);
21822174

@@ -2225,7 +2217,6 @@ static int uea_boot(struct uea_softc *sc)
22252217
sc->urb_int = NULL;
22262218
kfree(intr);
22272219
err0:
2228-
destroy_workqueue(sc->work_q);
22292220
uea_leaves(INS_TO_USBDEV(sc));
22302221
return -ENOMEM;
22312222
}
@@ -2246,8 +2237,8 @@ static void uea_stop(struct uea_softc *sc)
22462237
kfree(sc->urb_int->transfer_buffer);
22472238
usb_free_urb(sc->urb_int);
22482239

2249-
/* stop any pending boot process, when no one can schedule work */
2250-
destroy_workqueue(sc->work_q);
2240+
/* flush the work item, when no one can schedule it */
2241+
flush_work_sync(&sc->task);
22512242

22522243
if (sc->dsp_firm)
22532244
release_firmware(sc->dsp_firm);

0 commit comments

Comments
 (0)