static void iwmct_remove(struct sdio_func *func) { struct iwmct_work_struct *read_req; struct iwmct_priv *priv = sdio_get_drvdata(func); LOG_INFO(priv, INIT, "enter\n"); sdio_claim_host(func); sdio_release_irq(func); sdio_release_host(func); /* Make sure works are finished */ flush_work_sync(&priv->bus_rescan_worker); flush_work_sync(&priv->isr_worker); sdio_claim_host(func); sdio_disable_func(func); sysfs_remove_group(&func->dev.kobj, &iwmct_attribute_group); iwmct_dbgfs_unregister(priv->dbgfs); sdio_release_host(func); /* free read requests */ while (!list_empty(&priv->read_req_list)) { read_req = list_entry(priv->read_req_list.next, struct iwmct_work_struct, list); list_del(&read_req->list); kfree(read_req); } kfree(priv); }
static void mtdoops_notify_remove(struct mtd_info *mtd) { struct mtdoops_context *cxt = &oops_cxt; if (mtd->index != cxt->mtd_index || cxt->mtd_index < 0) return; if (kmsg_dump_unregister(&cxt->dump) < 0) printk(KERN_WARNING "mtdoops: could not unregister kmsg_dumper\n"); cxt->mtd = NULL; flush_work_sync(&cxt->work_erase); flush_work_sync(&cxt->work_write); }
static int __exit isp1301_remove(struct i2c_client *i2c) { struct isp1301 *isp; isp = i2c_get_clientdata(i2c); isp1301_clear_bits(isp, ISP1301_INTERRUPT_FALLING, ~0); isp1301_clear_bits(isp, ISP1301_INTERRUPT_RISING, ~0); free_irq(i2c->irq, isp); #ifdef CONFIG_USB_OTG otg_unbind(isp); #endif if (machine_is_omap_h2()) gpio_free(2); isp->timer.data = 0; set_bit(WORK_STOP, &isp->todo); del_timer_sync(&isp->timer); flush_work_sync(&isp->work); put_device(&i2c->dev); the_transceiver = NULL; return 0; }
static void ncp_stop_tasks(struct ncp_server *server) { struct sock* sk = server->ncp_sock->sk; lock_sock(sk); sk->sk_error_report = server->error_report; sk->sk_data_ready = server->data_ready; sk->sk_write_space = server->write_space; release_sock(sk); del_timer_sync(&server->timeout_tm); flush_work_sync(&server->rcv.tq); if (sk->sk_socket->type == SOCK_STREAM) flush_work_sync(&server->tx.tq); else flush_work_sync(&server->timeout_tq); }
static int z2_batt_suspend(struct i2c_client *client, pm_message_t state) { struct z2_charger *charger = i2c_get_clientdata(client); flush_work_sync(&charger->bat_work); return 0; }
static void ohci_exynos_stop(struct usb_hcd *hcd) { struct ohci_hcd *ohci = hcd_to_ohci(hcd); ohci_dump(ohci, 1); if (quirk_nec(ohci)) flush_work_sync(&ohci->nec_work); ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); ohci_usb_reset(ohci); free_irq(hcd->irq, hcd); hcd->irq = 0; if (quirk_zfmicro(ohci)) del_timer(&ohci->unlink_watchdog); if (quirk_amdiso(ohci)) usb_amd_dev_put(); remove_debug_files(ohci); ohci_mem_cleanup(ohci); if (ohci->hcca) { dma_free_coherent(hcd->self.controller, sizeof *ohci->hcca, ohci->hcca, ohci->hcca_dma); ohci->hcca = NULL; ohci->hcca_dma = 0; } }
/* * Must be called before ipwireless_network_free(). */ void ipwireless_tty_free(struct ipw_tty *tty) { int j; struct ipw_network *network = ttys[tty->index]->network; for (j = tty->index; j < IPWIRELESS_PCMCIA_MINORS; j += IPWIRELESS_PCMCIA_MINOR_RANGE) { struct ipw_tty *ttyj = ttys[j]; if (ttyj) { mutex_lock(&ttyj->ipw_tty_mutex); if (get_tty(j + ipw_tty_driver->minor_start) == ttyj) report_deregistering(ttyj); ttyj->closing = 1; if (ttyj->linux_tty != NULL) { mutex_unlock(&ttyj->ipw_tty_mutex); tty_hangup(ttyj->linux_tty); /* Wait till the tty_hangup has completed */ flush_work_sync(&ttyj->linux_tty->hangup_work); /* FIXME: Exactly how is the tty object locked here against a parallel ioctl etc */ mutex_lock(&ttyj->ipw_tty_mutex); } while (local_read(&ttyj->open_count)) do_ipw_close(ttyj); ipwireless_disassociate_network_ttys(network, ttyj->channel_idx); tty_unregister_device(ipw_tty_driver, j); ttys[j] = NULL; mutex_unlock(&ttyj->ipw_tty_mutex); kfree(ttyj); } } }
static int omap24xxcam_release(struct file *file) { struct omap24xxcam_fh *fh = file->private_data; struct omap24xxcam_device *cam = fh->cam; atomic_inc(&cam->reset_disable); flush_work_sync(&cam->sensor_reset_work); /* stop streaming capture */ videobuf_streamoff(&fh->vbq); mutex_lock(&cam->mutex); if (cam->streaming == file) { cam->streaming = NULL; mutex_unlock(&cam->mutex); sysfs_notify(&cam->dev->kobj, NULL, "streaming"); } else { mutex_unlock(&cam->mutex); } atomic_dec(&cam->reset_disable); omap24xxcam_vbq_free_mmap_buffers(&fh->vbq); /* * Make sure the reset work we might have scheduled is not * pending! It may be run *only* if we have users. (And it may * not be scheduled anymore since streaming is already * disabled.) */ flush_work_sync(&cam->sensor_reset_work); mutex_lock(&cam->mutex); if (atomic_dec_return(&cam->users) == 0) { omap24xxcam_sensor_disable(cam); omap24xxcam_poweron_reset(cam); } mutex_unlock(&cam->mutex); file->private_data = NULL; module_put(cam->sdev->module); kfree(fh); return 0; }
static int z2_batt_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct z2_charger *charger = i2c_get_clientdata(client); flush_work_sync(&charger->bat_work); return 0; }
static int dtv_on(struct platform_device *pdev) { int ret = 0; struct msm_fb_data_type *mfd; unsigned long panel_pixclock_freq , pm_qos_rate; /* If a power down is already underway, wait for it to finish */ flush_work_sync(&dtv_off_work); mfd = platform_get_drvdata(pdev); panel_pixclock_freq = mfd->fbi->var.pixclock; if (panel_pixclock_freq > 58000000) /* pm_qos_rate should be in Khz */ pm_qos_rate = panel_pixclock_freq / 1000 ; else pm_qos_rate = 58000; mdp4_extn_disp = 1; #ifdef CONFIG_MSM_BUS_SCALING if (dtv_bus_scale_handle > 0) msm_bus_scale_client_update_request(dtv_bus_scale_handle, 1); #else if (ebi1_clk) { clk_set_rate(ebi1_clk, pm_qos_rate * 1000); clk_prepare_enable(ebi1_clk); } #endif if (dtv_pdata && dtv_pdata->lcdc_power_save) dtv_pdata->lcdc_power_save(1); if (dtv_pdata && dtv_pdata->lcdc_gpio_config) ret = dtv_pdata->lcdc_gpio_config(1); mfd = platform_get_drvdata(pdev); ret = clk_set_rate(tv_src_clk, mfd->fbi->var.pixclock); if (ret) { pr_info("%s: clk_set_rate(%d) failed\n", __func__, mfd->fbi->var.pixclock); if (mfd->fbi->var.pixclock == 27030000) mfd->fbi->var.pixclock = 27000000; ret = clk_set_rate(tv_src_clk, mfd->fbi->var.pixclock); } pr_info("%s: tv_src_clk=%dkHz, pm_qos_rate=%ldkHz, [%d]\n", __func__, mfd->fbi->var.pixclock/1000, pm_qos_rate, ret); mfd->panel_info.clk_rate = mfd->fbi->var.pixclock; clk_prepare_enable(hdmi_clk); clk_reset(hdmi_clk, CLK_RESET_ASSERT); udelay(20); clk_reset(hdmi_clk, CLK_RESET_DEASSERT); if (mdp_tv_clk) clk_prepare_enable(mdp_tv_clk); ret = panel_next_on(pdev); return ret; }
int mISDN_freebchannel(struct bchannel *ch) { mISDN_clear_bchannel(ch); skb_queue_purge(&ch->rqueue); ch->rcount = 0; flush_work_sync(&ch->workq); return 0; }
static int samsung_battery_suspend(struct device *dev) { struct battery_info *info = dev_get_drvdata(dev); pr_info("%s\n", __func__); flush_work_sync(&info->monitor_work); return 0; }
void xfs_flush_inodes( struct xfs_inode *ip) { struct xfs_mount *mp = ip->i_mount; queue_work(xfs_syncd_wq, &mp->m_flush_work); flush_work_sync(&mp->m_flush_work); }
static int wm8350_led_remove(struct platform_device *pdev) { struct wm8350_led *led = platform_get_drvdata(pdev); led_classdev_unregister(&led->cdev); flush_work_sync(&led->work); wm8350_led_disable(led); regulator_put(led->dcdc); regulator_put(led->isink); return 0; }
void radeon_irq_kms_fini(struct radeon_device *rdev) { drm_vblank_cleanup(rdev->ddev); if (rdev->irq.installed) { drm_irq_uninstall(rdev->ddev); rdev->irq.installed = false; if (rdev->msi_enabled) pci_disable_msi(rdev->pdev); } flush_work_sync(&rdev->hotplug_work); }
static int serial_omap_suspend(struct device *dev) { struct uart_omap_port *up = dev_get_drvdata(dev); if (up) { uart_suspend_port(&serial_omap_reg, &up->port); flush_work_sync(&up->qos_work); } return 0; }
/** * gether_cleanup - remove Ethernet-over-USB device * Context: may sleep * * This is called to free all resources allocated by @gether_setup(). */ void gether_cleanup(void) { if (!the_dev) return; unregister_netdev(the_dev->net); flush_work_sync(&the_dev->work); free_netdev(the_dev->net); the_dev = NULL; }
static int empress_fini(struct saa7134_dev *dev) { dprintk("%s: %s\n",dev->name,__func__); if (NULL == dev->empress_dev) return 0; flush_work_sync(&dev->empress_workqueue); video_unregister_device(dev->empress_dev); dev->empress_dev = NULL; return 0; }
/* wait for hvsi_write_worker to empty hp->outbuf */ static void hvsi_flush_output(struct hvsi_struct *hp) { wait_event_timeout(hp->emptyq, (hp->n_outbuf <= 0), HVSI_TIMEOUT); /* 'writer' could still be pending if it didn't see n_outbuf = 0 yet */ cancel_delayed_work_sync(&hp->writer); flush_work_sync(&hp->handshaker); /* * it's also possible that our timeout expired and hvsi_write_worker * didn't manage to push outbuf. poof. */ hp->n_outbuf = 0; }
static void kgdboc_unregister_kbd(void) { int i; for (i = 0; i < kdb_poll_idx; i++) { if (kdb_poll_funcs[i] == kdb_get_kbd_char) { kdb_poll_idx--; kdb_poll_funcs[i] = kdb_poll_funcs[kdb_poll_idx]; kdb_poll_funcs[kdb_poll_idx] = NULL; i--; } } flush_work_sync(&kgdboc_restore_input_work); }
/** * gether_cleanup - remove Ethernet-over-USB device * Context: may sleep * * This is called to free all resources allocated by @gether_setup(). */ void gether_cleanup(void) { if (!the_dev) return; unregister_netdev(the_dev->net); flush_work_sync(&the_dev->work); free_netdev(the_dev->net); if(the_dev->usb_tx_buf) { printk("%s: kzfree usb_tx_buf = %p.\n", __FUNCTION__, the_dev->usb_tx_buf); kzfree(the_dev->usb_tx_buf); the_dev->usb_tx_buf = NULL; } the_dev = NULL; }
int mISDN_freedchannel(struct dchannel *ch) { if (ch->tx_skb) { dev_kfree_skb(ch->tx_skb); ch->tx_skb = NULL; } if (ch->rx_skb) { dev_kfree_skb(ch->rx_skb); ch->rx_skb = NULL; } skb_queue_purge(&ch->squeue); skb_queue_purge(&ch->rqueue); flush_work_sync(&ch->workq); return 0; }
static int switch_drv_remove(struct platform_device *pdev) { struct push_switch *psw = platform_get_drvdata(pdev); struct push_switch_platform_info *psw_info = pdev->dev.platform_data; int irq = platform_get_irq(pdev, 0); if (psw_info->name) device_remove_file(&pdev->dev, &dev_attr_switch); platform_set_drvdata(pdev, NULL); flush_work_sync(&psw->work); del_timer_sync(&psw->debounce); free_irq(irq, pdev); kfree(psw); return 0; }
static void omap_mbox_fini(struct omap_mbox *mbox) { mutex_lock(&mbox_configured_lock); if (!--mbox->use_count) { free_irq(mbox->irq, mbox); tasklet_kill(&mbox->txq->tasklet); flush_work_sync(&mbox->rxq->work); mbox_queue_free(mbox->txq); mbox_queue_free(mbox->rxq); } if (likely(mbox->ops->shutdown)) { if (!--mbox_configured) mbox->ops->shutdown(mbox); } mutex_unlock(&mbox_configured_lock); }
static int __devexit ssm_remove(struct platform_device *pdev) { if (!ssm_drv) return 0; /* */ ssm_drv->ready = false; smd_close(ssm_drv->ch); flush_work_sync(&ssm_drv->ipc_work); /* */ dev_dbg(&pdev->dev, "Shutting down TZapp\n"); qseecom_shutdown_app(&ssm_drv->qseecom_handle); return 0; }
void ams_sensor_detach(void) { /* Remove input device */ ams_input_exit(); /* Remove attributes */ device_remove_file(&ams_info.of_dev->dev, &dev_attr_current); /* Flush interrupt worker * * We do this after ams_info.exit(), because an interrupt might * have arrived before disabling them. */ flush_work_sync(&ams_info.worker); /* Remove device */ of_device_unregister(ams_info.of_dev); /* Remove handler */ pmf_unregister_irq_client(&ams_shock_client); pmf_unregister_irq_client(&ams_freefall_client); }
static void omap_mbox_fini(struct omap_mbox *mbox) { mutex_lock(&mbox_configured_lock); if (!--mbox->use_count) { free_irq(mbox->irq, mbox); tasklet_kill(&mbox->txq->tasklet); flush_work_sync(&mbox->rxq->work); mbox_queue_free(mbox->txq); mbox_queue_free(mbox->rxq); } if (likely(mbox->ops->shutdown)) { if (!--mbox_configured) { mbox->ops->shutdown(mbox); pm_qos_update_request(&mbox_qos_request, CLEAR_MPU_CORE_CONSTRAINT); } } mutex_unlock(&mbox_configured_lock); }
/** * gserial_cleanup - remove TTY-over-USB driver and devices * Context: may sleep * * This is called to free all resources allocated by @gserial_setup(). * Accordingly, it may need to wait until some open /dev/ files have * closed. * * The caller must have issued @gserial_disconnect() for any ports * that had previously been connected, so that there is never any * I/O pending when it's called. */ void gserial_cleanup(void) { unsigned i; struct gs_port *port; if (!gs_tty_driver) return; /* start sysfs and /dev/ttyGS* node removal */ for (i = 0; i < n_ports; i++) tty_unregister_device(gs_tty_driver, i); for (i = 0; i < n_ports; i++) { /* prevent new opens */ mutex_lock(&ports[i].lock); port = ports[i].port; ports[i].port = NULL; mutex_unlock(&ports[i].lock); #ifndef CONFIG_USE_WORKQ_PUSH tasklet_kill(&port->push); #else flush_work_sync(&port->push); #endif /* wait for old opens to finish */ wait_event(port->close_wait, gs_closed(port)); WARN_ON(port->port_usb != NULL); kfree(port); } n_ports = 0; tty_unregister_driver(gs_tty_driver); put_tty_driver(gs_tty_driver); gs_tty_driver = NULL; pr_debug("%s: cleaned up ttyGS* support\n", __func__); }
static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i) { struct omap24xxcam_fh *ofh = fh; struct omap24xxcam_device *cam = ofh->cam; struct videobuf_queue *q = &ofh->vbq; int rval; atomic_inc(&cam->reset_disable); flush_work_sync(&cam->sensor_reset_work); rval = videobuf_streamoff(q); if (!rval) { mutex_lock(&cam->mutex); cam->streaming = NULL; mutex_unlock(&cam->mutex); sysfs_notify(&cam->dev->kobj, NULL, "streaming"); } atomic_dec(&cam->reset_disable); return rval; }
static void flush_request_modules(struct cx18 *dev) { flush_work_sync(&dev->request_module_wk); }