usb: don't use flush_scheduled_work()
authorTejun Heo <tj@kernel.org>
Fri, 24 Dec 2010 15:14:20 +0000 (16:14 +0100)
committerTejun Heo <tj@kernel.org>
Fri, 24 Dec 2010 15:14:20 +0000 (16:14 +0100)
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 <tj@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Duncan Sands <duncan.sands@free.fr>
Cc: linux-usb@vger.kernel.org
drivers/usb/atm/speedtch.c
drivers/usb/gadget/u_ether.c
drivers/usb/host/ohci-hcd.c
drivers/usb/otg/isp1301_omap.c
drivers/usb/serial/oti6858.c

index 9046eba112afca7808291d07d064962c4a9136f0..0842cfbf60cfcf74ec08b835d469c1f1c8f26ada 100644 (file)
@@ -718,7 +718,7 @@ static void speedtch_atm_stop(struct usbatm_data *usbatm, struct atm_dev *atm_de
        del_timer_sync(&instance->resubmit_timer);
        usb_free_urb(int_urb);
 
-       flush_scheduled_work();
+       flush_work_sync(&instance->status_check_work);
 }
 
 static int speedtch_pre_reset(struct usb_interface *intf)
index fbe86ca95802b93d68ace2718280a4aeb8b533c2..00a78248d7648cc0693c05a64fc93548dbad5314 100644 (file)
@@ -829,11 +829,9 @@ void gether_cleanup(void)
                return;
 
        unregister_netdev(the_dev->net);
+       flush_work_sync(&the_dev->work);
        free_netdev(the_dev->net);
 
-       /* assuming we used keventd, it must quiesce too */
-       flush_scheduled_work();
-
        the_dev = NULL;
 }
 
index 5179acb7aa2fb08be16b4b5becbabeb449cd1911..bd5eff77d0cca70934965d50804f95b6a9f26a4b 100644 (file)
@@ -901,7 +901,8 @@ static void ohci_stop (struct usb_hcd *hcd)
 
        ohci_dump (ohci, 1);
 
-       flush_scheduled_work();
+       if (quirk_nec(ohci))
+               flush_work_sync(&ohci->nec_work);
 
        ohci_usb_reset (ohci);
        ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
index 456969492410d716985d7be5227cd6ca4ce8ce28..e00fa1b22ecd854b7c960f5906b8ba105e5d5d1f 100644 (file)
@@ -1247,7 +1247,7 @@ static int __exit isp1301_remove(struct i2c_client *i2c)
        isp->timer.data = 0;
        set_bit(WORK_STOP, &isp->todo);
        del_timer_sync(&isp->timer);
-       flush_scheduled_work();
+       flush_work_sync(&isp->work);
 
        put_device(&i2c->dev);
        the_transceiver = NULL;
index e199b0f4f99c462f0badb595fa9290be85214868..5be866bb7a4132a1e078939abda73daecaf2e434 100644 (file)
@@ -613,9 +613,8 @@ static void oti6858_close(struct usb_serial_port *port)
        dbg("%s(): after buf_clear()", __func__);
 
        /* cancel scheduled setup */
-       cancel_delayed_work(&priv->delayed_setup_work);
-       cancel_delayed_work(&priv->delayed_write_work);
-       flush_scheduled_work();
+       cancel_delayed_work_sync(&priv->delayed_setup_work);
+       cancel_delayed_work_sync(&priv->delayed_write_work);
 
        /* shutdown our urbs */
        dbg("%s(): shutting down urbs", __func__);