_mali_osk_errcode_t _mali_osk_pm_delete_callback_timer(void) { if (NULL != pm_timer) { _mali_osk_timer_del(pm_timer); pm_timer = NULL; } #if MALI_LICENSE_IS_GPL if (mali_pm_wq) { flush_workqueue(mali_pm_wq); } #else flush_scheduled_work(); #endif return _MALI_OSK_ERR_OK; }
static int __devexit max8998_charger_remove(struct platform_device *pdev) { struct chg_data *chg = platform_get_drvdata(pdev); alarm_cancel(&chg->alarm); free_irq(chg->iodev->i2c->irq, NULL); flush_workqueue(chg->monitor_wqueue); destroy_workqueue(chg->monitor_wqueue); power_supply_unregister(&chg->psy_bat); power_supply_unregister(&chg->psy_usb); power_supply_unregister(&chg->psy_ac); wake_lock_destroy(&chg->vbus_wake_lock); mutex_destroy(&chg->mutex); kfree(chg); return 0; }
static void intelli_plug_suspend(struct early_suspend *handler) #endif { int cpu; flush_workqueue(intelliplug_wq); mutex_lock(&intelli_plug_mutex); suspended = true; screen_off_limit(true); mutex_unlock(&intelli_plug_mutex); // put rest of the cores to sleep unconditionally! for_each_online_cpu(cpu) { if (cpu != 0) cpu_down(cpu); } }
void _mali_osk_irq_term( _mali_osk_irq_t *irq ) { mali_osk_irq_object_t *irq_object = (mali_osk_irq_object_t *)irq; #if MALI_LICENSE_IS_GPL if(irq_object->irqnum == _MALI_OSK_IRQ_NUMBER_PMM ) { flush_workqueue(pmm_wq); destroy_workqueue(pmm_wq); } #endif if (!mali_benchmark) { free_irq(irq_object->irqnum, irq_object); } kfree(irq_object); flush_scheduled_work(); }
static void mdp_suspend_sub(void) { // cancel pipe ctrl worker cancel_delayed_work(&mdp_pipe_ctrl_worker); // for workder can't be cancelled... flush_workqueue(mdp_pipe_ctrl_wq); //////////////////////////////////////////////////// // let's wait for PPP completion //////////////////////////////////////////////////// while (mdp_block_power_cnt[MDP_PPP_BLOCK] > 0) ; //////////////////////////////////////////////////// // try to power down //////////////////////////////////////////////////// mdp_pipe_ctrl(MDP_MASTER_BLOCK, MDP_BLOCK_POWER_OFF, FALSE); }
static void __exit ipcs_module_exit(void) { flush_workqueue(g_ipc_info.intr_workqueue); destroy_workqueue(g_ipc_info.intr_workqueue); iounmap(g_ipc_info.apcp_shmem); free_irq(IRQ_IPC_C2A, &g_ipc_info); cdev_del(&g_ipc_info.cdev); unregister_chrdev_region(g_ipc_info.devnum, 1); #ifdef CONFIG_HAS_WAKELOCK wake_lock_destroy(&ipc_wake_lock); #endif return; }
static int __devexit ms5607_remove(struct i2c_client *client) { struct ms5607_data *ms5607 = i2c_get_clientdata(client); input_unregister_device(ms5607->input_dev); flush_workqueue(ms5607->workqueue); destroy_workqueue(ms5607->workqueue); ms5607_power_off(ms5607); if (ms5607->pdata->exit) ms5607->pdata->exit(); kfree(ms5607->pdata); sysfs_remove_group(&client->dev.kobj, &ms5607_attribute_group); kfree(ms5607); return 0; }
void _mali_osk_irq_term( _mali_osk_irq_t *irq ) { mali_osk_irq_object_t *irq_object = (mali_osk_irq_object_t *)irq; if(mali_irq_wq != NULL) { flush_workqueue(mali_irq_wq); destroy_workqueue(mali_irq_wq); mali_irq_wq = NULL; } if (!mali_benchmark) { free_irq(irq_object->irqnum, irq_object); } kfree(irq_object); flush_scheduled_work(); }
static int apds9190_suspend(struct i2c_client *client, pm_message_t mesg) { struct apds9190_data *data = i2c_get_clientdata(apds_9190_i2c_client); struct proximity_platform_data* pdata = NULL; int enable; int err; printk("apds9190_suspend [%d], proximity_wq=%d\n", data->enable, proximity_wq); if(!data->sw_mode) return 0; pdata = data->client->dev.platform_data; if(NULL == pdata){ printk(KERN_INFO "Platform data is NULL\n"); return -1; } apds9190_set_enable(client, 0); apds9190_set_command(apds_9190_i2c_client, 2); cancel_work_sync(&data->dwork); flush_work(&data->dwork); flush_workqueue(proximity_wq); enable_status = enable; data->sw_mode = PROX_STAT_SHUTDOWN; disable_irq(data->irq); err = pdata->power(0); if(err < 0) { printk(KERN_INFO "%s, Proximity Power Off Fail in susped\n",__func__); return err; } set_irq_wake(data->irq, 0); if(NULL != proximity_wq){ destroy_workqueue(proximity_wq); printk(KERN_INFO "%s, Destroy workqueue\n",__func__); proximity_wq = NULL; } return 0; }
void tegra_dc_ext_unregister(struct tegra_dc_ext *ext) { int i; for (i = 0; i < ext->dc->n_windows; i++) { struct tegra_dc_ext_win *win = &ext->win[i]; flush_workqueue(win->flip_wq); destroy_workqueue(win->flip_wq); } nvmap_client_put(ext->nvmap); device_del(ext->dev); cdev_del(&ext->cdev); kfree(ext); head_count--; }
static void ieee80211_restart_work(struct work_struct *work) { struct ieee80211_local *local = container_of(work, struct ieee80211_local, restart_work); /* wait for scan work complete */ flush_workqueue(local->workqueue); mutex_lock(&local->mtx); WARN(test_bit(SCAN_HW_SCANNING, &local->scanning) || local->sched_scanning, "%s called with hardware scan in progress\n", __func__); mutex_unlock(&local->mtx); rtnl_lock(); ieee80211_scan_cancel(local); ieee80211_reconfig(local); rtnl_unlock(); }
void disable_mdm_irq(void) { printk(KERN_INFO "MDM is going down..........\n"); if (s_misc.mdm_reset_irq >= 0) { free_irq(s_misc.mdm_reset_irq, (void*)&s_misc); printk(KERN_INFO "MDM is going down: Free irq for mdm reset...\n"); } printk(KERN_INFO "MDM is going down: cancel delayed work...\n"); cancel_delayed_work_sync(&work); if (mdm_reset_wq) { flush_workqueue(mdm_reset_wq); destroy_workqueue(mdm_reset_wq); mdm_reset_wq = NULL; printk(KERN_INFO "MDM is going down: Flush workqueue for mdm reset...\n"); } }
void disable_ifx_irq(void) { printk(KERN_INFO "IFX is going down..........\n"); if (s_misc.ifx_trap_irq >= 0) { free_irq(s_misc.ifx_trap_irq, (void*)&s_misc); printk(KERN_INFO "IFX is going down: Free irq for IFX trap...\n"); } printk(KERN_INFO "IFX is going down: cancel delayed work...\n"); cancel_delayed_work_sync(&work); if (ifx_trap_wq) { flush_workqueue(ifx_trap_wq); destroy_workqueue(ifx_trap_wq); ifx_trap_wq = NULL; printk(KERN_INFO "IFX is going down: Flush workqueue for ifx reset...\n"); } }
void kbase_event_cleanup(kbase_context *kctx) { KBASE_DEBUG_ASSERT(kctx); KBASE_DEBUG_ASSERT(kctx->event_workq); flush_workqueue(kctx->event_workq); destroy_workqueue(kctx->event_workq); /* We use kbase_event_dequeue to remove the remaining events as that * deals with all the cleanup needed for the atoms. * * Note: use of kctx->event_list without a lock is safe because this must be the last * thread using it (because we're about to terminate the lock) */ while (!list_empty(&kctx->event_list)) { base_jd_event_v2 event; kbase_event_dequeue(kctx, &event); } }
static int __devexit sunxi_ss_remove(struct platform_device *pdev) { sunxi_ss_t *sss = platform_get_drvdata(pdev); ss_wait_idle(); sunxi_ss_sysfs_remove(pdev); cancel_work_sync(&sss->work); flush_workqueue(sss->workqueue); destroy_workqueue(sss->workqueue); sunxi_ss_alg_unregister(); sunxi_ss_hw_exit(sss); sunxi_ss_res_release(sss); platform_set_drvdata(pdev, NULL); ss_dev = NULL; return 0; }
int __devexit mpc8xxx_spi_remove(struct device *dev) { struct mpc8xxx_spi *mpc8xxx_spi; struct spi_master *master; master = dev_get_drvdata(dev); mpc8xxx_spi = spi_master_get_devdata(master); flush_workqueue(mpc8xxx_spi->workqueue); destroy_workqueue(mpc8xxx_spi->workqueue); spi_unregister_master(master); free_irq(mpc8xxx_spi->irq, mpc8xxx_spi); if (mpc8xxx_spi->spi_remove) mpc8xxx_spi->spi_remove(mpc8xxx_spi); return 0; }
static irqreturn_t anx7816_cbl_det_isr(int irq, void *data) { struct anx7816_data *anx7816 = data; if (gpio_get_value(anx7816->pdata->gpio_cbl_det)) { wake_lock(&anx7816->slimport_lock); pr_info("%s %s : detect cable insertion\n", LOG_TAG, __func__); queue_delayed_work(anx7816->workqueue, &anx7816->work, 0); } else { pr_info("%s %s : detect cable removal\n", LOG_TAG, __func__); cancel_delayed_work_sync(&anx7816->work); flush_workqueue(anx7816->workqueue); sp_tx_hardware_powerdown(); sp_tx_clean_state_machine(); wake_unlock(&anx7816->slimport_lock); wake_lock_timeout(&anx7816->slimport_lock, 2*HZ); } return IRQ_HANDLED; }
void uf_sme_deinit(unifi_priv_t *priv) { func_enter(); /* Free memory allocated for the scan table */ /* unifi_clear_scan_table(priv); */ /* Cancel any pending workqueue tasks */ flush_workqueue(priv->unifi_workqueue); #ifdef CSR_SUPPORT_WEXT uf_deinit_wext_interface(priv); #endif func_exit(); } /* uf_sme_deinit() */
static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr) { struct mlx4_en_dev *mdev = endev_ptr; int i; mutex_lock(&mdev->state_lock); mdev->device_up = false; mutex_unlock(&mdev->state_lock); mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) if (mdev->pndev[i]) mlx4_en_destroy_netdev(mdev->pndev[i]); flush_workqueue(mdev->workqueue); destroy_workqueue(mdev->workqueue); mlx4_mr_free(dev, &mdev->mr); mlx4_uar_free(dev, &mdev->priv_uar); mlx4_pd_free(dev, mdev->priv_pdn); kfree(mdev); }
/* * Performs platform device cleanup */ static void abx500_accessory_cleanup(struct abx500_ad *dd) { dev_dbg(&dd->pdev->dev, "Enter: %s\n", __func__); dd->jack_type = JACK_TYPE_UNSPECIFIED; config_accdetect(dd); gpio_free(dd->pdata->video_ctrl_gpio); input_unregister_device(dd->btn_input_dev); free_regulators(dd); cancel_delayed_work(&dd->detect_work); cancel_delayed_work(&dd->unplug_irq_work); cancel_delayed_work(&dd->init_work); flush_workqueue(dd->irq_work_queue); destroy_workqueue(dd->irq_work_queue); switch_dev_unregister(&dd->ab_switch); kfree(dd); }
static void ib_cache_cleanup_one(struct ib_device *device) { int p; if (!(device->cache.pkey_cache && device->cache.gid_cache && device->cache.lmc_cache)) return; ib_unregister_event_handler(&device->cache.event_handler); flush_workqueue(ib_wq); for (p = 0; p <= end_port(device) - start_port(device); ++p) { kfree(device->cache.pkey_cache[p]); kfree(device->cache.gid_cache[p]); } kfree(device->cache.pkey_cache); kfree(device->cache.gid_cache); kfree(device->cache.lmc_cache); }
static int pixcir_remove(struct platform_device *pdev) { struct pixcir_data *pixcir = platform_get_drvdata(pdev); cancel_delayed_work_sync(&pixcir->read_work); flush_workqueue(pixcir->workqueue); destroy_workqueue(pixcir->workqueue); free_irq(pixcir->irq, pixcir); gpio_disable_irq(pixcir->igp_idx, pixcir->igp_bit); unregister_early_suspend(&pixcir->early_suspend); input_unregister_device(pixcir->input_dev); pixcir_sysfs_remove_group(pixcir, &pixcir_group); //kfree(pixcir); dbg("remove...\n"); return 0; }
int free_md32_wdt_func(char *module_name) { int index; dbg_msg("Flush works in WDT work queue\n"); flush_workqueue(WDT_wq); dbg_msg("Free md32_wdt structure\n"); for(index=0;index<MD32_MAX_USER;index++) { if(strcmp(module_name,WDT_FUN.MODULE_NAME[index])==0) { WDT_FUN.in_use[index]=0; WDT_FUN.wdt_func[index]=NULL; WDT_FUN.reset_func[index]=NULL; WDT_FUN.private_data[index]=NULL; return 0; } } dbg_msg("Can't free %s\n",module_name); return -1; }
static int gpio_keys_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; int i; printk("gpio_keys_suspend+\n"); if (device_may_wakeup(&pdev->dev)) { for (i = 0; i < pdata->nbuttons; i++) { struct gpio_keys_button *button = &pdata->buttons[i]; if (button->wakeup) { int irq = gpio_to_irq(button->gpio); enable_irq_wake(irq); } } } flush_workqueue(gpiokey_workqueue); printk("gpio_keys_suspend-\n"); return 0; }
static int broadcast_tdmb_lg2102_remove(struct spi_device *spi) { printk("broadcast_tdmb_lg2102_remove \n"); if (lg2102_ctrl_info.spi_wq) { flush_workqueue(lg2102_ctrl_info.spi_wq); destroy_workqueue(lg2102_ctrl_info.spi_wq); } free_irq(spi->irq, &lg2102_ctrl_info); mutex_destroy(&lg2102_ctrl_info.mutex); wake_lock_destroy(&lg2102_ctrl_info.wake_lock); pm_qos_remove_request(&lg2102_ctrl_info.pm_req_list); memset((unsigned char*)&lg2102_ctrl_info, 0x0, sizeof(struct tdmb_lg2102_ctrl_blk)); return 0; }
int sdio_smem_unregister_client(void) { int err = 0; sdio_ch_opened = 0; err = sdio_close(channel); if (err) { pr_err("sdio_close error (%d)\n", err); return err; } pr_debug("SDIO SMEM channel closed\n"); flush_workqueue(workq); destroy_workqueue(workq); bytes_avail = 0; client.buf = NULL; client.cb_func = NULL; client.size = 0; return 0; }
static int lm3630a_remove(struct i2c_client *client) { int rval; struct lm3630a_chip *pchip = i2c_get_clientdata(client); rval = lm3630a_write(pchip, REG_BRT_A, 0); if (rval < 0) dev_err(pchip->dev, "i2c failed to access register\n"); rval = lm3630a_write(pchip, REG_BRT_B, 0); if (rval < 0) dev_err(pchip->dev, "i2c failed to access register\n"); if (pchip->irq) { free_irq(pchip->irq, pchip); flush_workqueue(pchip->irqthread); destroy_workqueue(pchip->irqthread); } return 0; }
static void intelli_plug_early_suspend(struct early_suspend *handler) #endif { int i = 0; int num_of_active_cores = 0; if (atomic_read(&intelli_plug_active) == 1) { flush_workqueue(intelliplug_wq); num_of_active_cores = num_possible_cpus(); mutex_lock(&intelli_plug_mutex); hotplug_suspended = true; mutex_unlock(&intelli_plug_mutex); /* put rest of the cores to sleep! */ for (i = num_of_active_cores - 1; i > 0; i--) { cpu_down(i); } } }
int free_md32_assert_func(char *module_name) { int index; dbg_msg("Flush works in ASSERT work queue\n"); flush_workqueue(wq_md32_assert); dbg_msg("Free md32_assert structure\n"); for(index=0;index<MD32_MAX_USER;index++) { if(strcmp(module_name,MD32_ASSERT_FUN.MODULE_NAME[index])==0) { MD32_ASSERT_FUN.in_use[index]=0; MD32_ASSERT_FUN.assert_func[index]=NULL; MD32_ASSERT_FUN.reset_func[index]=NULL; MD32_ASSERT_FUN.private_data[index]=NULL; return 0; } } dbg_msg("Can't free %s\n",module_name); return -1; }
static int __devexit hdmi_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct v4l2_subdev *sd = dev_get_drvdata(dev); struct hdmi_device *hdmi_dev = sd_to_hdmi_dev(sd); pm_runtime_disable(dev); clk_disable(hdmi_dev->res.hdmi); v4l2_device_unregister(&hdmi_dev->v4l2_dev); disable_irq(hdmi_dev->curr_irq); free_irq(hdmi_dev->curr_irq, hdmi_dev); iounmap(hdmi_dev->regs); hdmi_resources_cleanup(hdmi_dev); flush_workqueue(hdmi_dev->hdcp_wq); destroy_workqueue(hdmi_dev->hdcp_wq); kfree(hdmi_dev); dev_info(dev, "remove sucessful\n"); return 0; }