static int aic31xx_codec_remove(struct snd_soc_codec *codec) { struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); int i; for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) regulator_unregister_notifier(aic31xx->supplies[i].consumer, &aic31xx->disable_nb[i].nb); return 0; }
static int wm8770_spi_remove(struct spi_device *spi) { struct wm8770_priv *wm8770 = spi_get_drvdata(spi); int i; for (i = 0; i < ARRAY_SIZE(wm8770->supplies); ++i) regulator_unregister_notifier(wm8770->supplies[i].consumer, &wm8770->disable_nb[i]); return 0; }
static int aic31xx_codec_remove(struct snd_soc_codec *codec) { struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); int i; /* power down chip */ aic31xx_set_bias_level(codec, SND_SOC_BIAS_OFF); for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) regulator_unregister_notifier(aic31xx->supplies[i].consumer, &aic31xx->disable_nb[i].nb); return 0; }
static int wm8770_remove(struct snd_soc_codec *codec) { struct wm8770_priv *wm8770; int i; wm8770 = snd_soc_codec_get_drvdata(codec); wm8770_set_bias_level(codec, SND_SOC_BIAS_OFF); for (i = 0; i < ARRAY_SIZE(wm8770->supplies); ++i) regulator_unregister_notifier(wm8770->supplies[i].consumer, &wm8770->disable_nb[i]); regulator_bulk_free(ARRAY_SIZE(wm8770->supplies), wm8770->supplies); return 0; }
static int __devexit sht15_remove(struct platform_device *pdev) { struct sht15_data *data = platform_get_drvdata(pdev); mutex_lock(&data->read_lock); hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(&pdev->dev.kobj, &sht15_attr_group); if (!IS_ERR(data->reg)) { regulator_unregister_notifier(data->reg, &data->nb); regulator_disable(data->reg); regulator_put(data->reg); } free_irq(gpio_to_irq(data->pdata->gpio_data), data); gpio_free(data->pdata->gpio_data); gpio_free(data->pdata->gpio_sck); mutex_unlock(&data->read_lock); kfree(data); return 0; }
static int __devexit hi_mci_remove(struct platform_device *pdev) { int ret; struct mshci_host *ms_host = NULL; struct himci_host *hi_host = NULL; struct hisik3_mmc_platform_data *plat = NULL; unsigned long flags; ms_host = platform_get_drvdata(pdev); if (!ms_host) { printk(KERN_ERR "get drvdata failed !\n"); return -1; } hi_host = mshci_priv(ms_host); plat = pdev->dev.platform_data; if (ms_host->quirks & MSHCI_QUIRK_WLAN_DETECTION) { if (plat->ext_cd_init) plat->ext_cd_cleanup(&mshci_hi_notify_change); } mshci_remove_host(ms_host, 1); iounmap(ms_host->ioaddr); ms_host->ioaddr = NULL; spin_lock_irqsave(&ms_host->lock, flags); if(ms_host->clk_ref_counter == CLK_ENABLED){ clk_disable(hi_host->pclk); ms_host->clk_ref_counter = CLK_DISABLED; } spin_unlock_irqrestore(&ms_host->lock, flags); clk_put(hi_host->pclk); if (hi_host->vcc_ldo) { regulator_unregister_notifier(hi_host->vcc_ldo, &hi_host->nb); ret = regulator_disable(hi_host->vcc_ldo); if (ret) { printk("%s:failed to disable regulator\n", __func__); return ret; } regulator_put(hi_host->vcc_ldo); } if (hi_host->vcc_lvs) { regulator_unregister_notifier(hi_host->vcc_lvs, &hi_host->nb); ret = regulator_disable(hi_host->vcc_lvs); if (ret) { printk("%s:failed to disable regulator\n", __func__); return ret; } regulator_put(hi_host->vcc_lvs); } if (hi_host->signal_vcc) { regulator_put(hi_host->signal_vcc); } mshci_free_host(ms_host); platform_set_drvdata(pdev, NULL); return 0; }