Skip to content

Commit 569ff2d

Browse files
committed
usb: don't use flush_scheduled_work()
flush_scheduled_work() is being deprecated. Directly flush or cancel work items instead. * u_ether, isp1301_omap, speedtch conversions are straight-forward. * ochi-hcd should only flush when quirk_nec() is true as otherwise the work wouldn't have been initialized. * In oti6858, cancel_delayed_work() + flush_scheduled_work() -> cancel_delayed_work_sync(). Signed-off-by: Tejun Heo <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Cc: David Brownell <[email protected]> Cc: Duncan Sands <[email protected]> Cc: [email protected]
1 parent 37c95bf commit 569ff2d

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

drivers/usb/atm/speedtch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ static void speedtch_atm_stop(struct usbatm_data *usbatm, struct atm_dev *atm_de
718718
del_timer_sync(&instance->resubmit_timer);
719719
usb_free_urb(int_urb);
720720

721-
flush_scheduled_work();
721+
flush_work_sync(&instance->status_check_work);
722722
}
723723

724724
static int speedtch_pre_reset(struct usb_interface *intf)

drivers/usb/gadget/u_ether.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -829,11 +829,9 @@ void gether_cleanup(void)
829829
return;
830830

831831
unregister_netdev(the_dev->net);
832+
flush_work_sync(&the_dev->work);
832833
free_netdev(the_dev->net);
833834

834-
/* assuming we used keventd, it must quiesce too */
835-
flush_scheduled_work();
836-
837835
the_dev = NULL;
838836
}
839837

drivers/usb/host/ohci-hcd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,8 @@ static void ohci_stop (struct usb_hcd *hcd)
901901

902902
ohci_dump (ohci, 1);
903903

904-
flush_scheduled_work();
904+
if (quirk_nec(ohci))
905+
flush_work_sync(&ohci->nec_work);
905906

906907
ohci_usb_reset (ohci);
907908
ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);

drivers/usb/otg/isp1301_omap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ static int __exit isp1301_remove(struct i2c_client *i2c)
12471247
isp->timer.data = 0;
12481248
set_bit(WORK_STOP, &isp->todo);
12491249
del_timer_sync(&isp->timer);
1250-
flush_scheduled_work();
1250+
flush_work_sync(&isp->work);
12511251

12521252
put_device(&i2c->dev);
12531253
the_transceiver = NULL;

drivers/usb/serial/oti6858.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,8 @@ static void oti6858_close(struct usb_serial_port *port)
613613
dbg("%s(): after buf_clear()", __func__);
614614

615615
/* cancel scheduled setup */
616-
cancel_delayed_work(&priv->delayed_setup_work);
617-
cancel_delayed_work(&priv->delayed_write_work);
618-
flush_scheduled_work();
616+
cancel_delayed_work_sync(&priv->delayed_setup_work);
617+
cancel_delayed_work_sync(&priv->delayed_write_work);
619618

620619
/* shutdown our urbs */
621620
dbg("%s(): shutting down urbs", __func__);

0 commit comments

Comments
 (0)