static int clk_mt2701_aud_probe(struct platform_device *pdev) { struct clk_onecell_data *clk_data; struct device_node *node = pdev->dev.of_node; int r; clk_data = mtk_alloc_clk_data(CLK_AUD_NR); mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks), clk_data); r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); if (r) { dev_err(&pdev->dev, "could not register clock provider: %s: %d\n", pdev->name, r); goto err_clk_provider; } r = devm_of_platform_populate(&pdev->dev); if (r) goto err_plat_populate; return 0; err_plat_populate: of_clk_del_provider(node); err_clk_provider: return r; }
static int of_fixed_factor_clk_remove(struct platform_device *pdev) { struct clk_hw *clk = platform_get_drvdata(pdev); of_clk_del_provider(pdev->dev.of_node); clk_hw_unregister_fixed_factor(clk); return 0; }
static void hi3798cv200_sysctrl_clk_unregister(struct platform_device *pdev) { struct hisi_crg_dev *crg = platform_get_drvdata(pdev); of_clk_del_provider(pdev->dev.of_node); hisi_clk_unregister_gate(hi3798cv200_sysctrl_gate_clks, ARRAY_SIZE(hi3798cv200_sysctrl_gate_clks), crg->clk_data); }
static int rk808_clkout_remove(struct platform_device *pdev) { struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent); struct i2c_client *client = rk808->i2c; struct device_node *node = client->dev.of_node; of_clk_del_provider(node); return 0; }
int qcom_cc_really_probe(struct platform_device *pdev, const struct qcom_cc_desc *desc, struct regmap *regmap) { int i, ret; struct device *dev = &pdev->dev; struct clk *clk; struct clk_onecell_data *data; struct clk **clks; struct qcom_reset_controller *reset; struct qcom_cc *cc; size_t num_clks = desc->num_clks; struct clk_regmap **rclks = desc->clks; cc = devm_kzalloc(dev, sizeof(*cc) + sizeof(*clks) * num_clks, GFP_KERNEL); if (!cc) return -ENOMEM; clks = cc->clks; data = &cc->data; data->clks = clks; data->clk_num = num_clks; for (i = 0; i < num_clks; i++) { if (!rclks[i]) { clks[i] = ERR_PTR(-ENOENT); continue; } clk = devm_clk_register_regmap(dev, rclks[i]); if (IS_ERR(clk)) return PTR_ERR(clk); clks[i] = clk; } ret = of_clk_add_provider(dev->of_node, of_clk_src_onecell_get, data); if (ret) return ret; reset = &cc->reset; reset->rcdev.of_node = dev->of_node; reset->rcdev.ops = &qcom_reset_ops; reset->rcdev.owner = dev->driver->owner; reset->rcdev.nr_resets = desc->num_resets; reset->regmap = regmap; reset->reset_map = desc->resets; platform_set_drvdata(pdev, &reset->rcdev); ret = reset_controller_register(&reset->rcdev); if (ret) of_clk_del_provider(dev->of_node); return ret; }
static void kona_ccu_teardown(struct ccu_data *ccu) { if (!ccu->base) return; of_clk_del_provider(ccu->node); /* safe if never added */ ccu_clks_teardown(ccu); of_node_put(ccu->node); ccu->node = NULL; iounmap(ccu->base); ccu->base = NULL; }
static int exynos_audss_clk_remove(struct platform_device *pdev) { int i; of_clk_del_provider(pdev->dev.of_node); for (i = 0; i < clk_data.clk_num; i++) { if (!IS_ERR(clk_table[i])) clk_unregister(clk_table[i]); } return 0; }
void msm_dsi_pll_helper_unregister_clks(struct platform_device *pdev, struct clk **clks, u32 num_clks) { of_clk_del_provider(pdev->dev.of_node); if (!num_clks || !clks) return; do { clk_unregister(clks[--num_clks]); clks[num_clks] = NULL; } while (num_clks); }
static int scpi_clocks_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *child, *np = dev->of_node; if (cpufreq_dev) { platform_device_unregister(cpufreq_dev); cpufreq_dev = NULL; } for_each_available_child_of_node(np, child) of_clk_del_provider(np); return 0; }
static int exynos_audss_clk_remove(struct platform_device *pdev) { #ifdef CONFIG_PM_SLEEP unregister_syscore_ops(&exynos_audss_clk_syscore_ops); #endif of_clk_del_provider(pdev->dev.of_node); exynos_audss_clk_teardown(); if (!IS_ERR(epll)) clk_disable_unprepare(epll); return 0; }
static void sun8i_tcon_top_unbind(struct device *dev, struct device *master, void *data) { struct sun8i_tcon_top *tcon_top = dev_get_drvdata(dev); struct clk_hw_onecell_data *clk_data = tcon_top->clk_data; int i; of_clk_del_provider(dev->of_node); for (i = 0; i < CLK_NUM; i++) if (clk_data->hws[i]) clk_hw_unregister_gate(clk_data->hws[i]); clk_disable_unprepare(tcon_top->bus); reset_control_assert(tcon_top->rst); }
static void kona_ccu_teardown(struct ccu_data *ccu) { if (!ccu) return; if (!ccu->base) goto done; of_clk_del_provider(ccu->node); /* safe if never added */ ccu_clks_teardown(ccu); list_del(&ccu->links); of_node_put(ccu->node); iounmap(ccu->base); done: kfree(ccu->name); kfree(ccu); }
static int clk_wzrd_remove(struct platform_device *pdev) { int i; struct clk_wzrd *clk_wzrd = platform_get_drvdata(pdev); of_clk_del_provider(pdev->dev.of_node); for (i = 0; i < WZRD_NUM_OUTPUTS; i++) clk_unregister(clk_wzrd->clkout[i]); for (i = 0; i < wzrd_clk_int_max; i++) clk_unregister(clk_wzrd->clks_internal[i]); if (clk_wzrd->speed_grade) { clk_notifier_unregister(clk_wzrd->axi_clk, &clk_wzrd->nb); clk_notifier_unregister(clk_wzrd->clk_in1, &clk_wzrd->nb); } clk_disable_unprepare(clk_wzrd->axi_clk); return 0; }
static void qcom_cc_del_clk_provider(void *data) { of_clk_del_provider(data); }
void qcom_cc_remove(struct platform_device *pdev) { of_clk_del_provider(pdev->dev.of_node); reset_controller_unregister(platform_get_drvdata(pdev)); }
static int uniphier_clk_remove(struct platform_device *pdev) { of_clk_del_provider(pdev->dev.of_node); return 0; }
static void cpg_mssr_del_clk_provider(void *data) { of_clk_del_provider(data); }
static int armada_3700_xtal_clock_remove(struct platform_device *pdev) { of_clk_del_provider(pdev->dev.of_node); return 0; }