diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 21:00:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 21:00:30 +0000 |
commit | e54def4ad8144ab15f826416e2e0f290ef1901b4 (patch) | |
tree | 583f8d4bd95cd67c44ff37b878a7eddfca9ab97a /drivers/clk/imx | |
parent | Adding upstream version 6.8.12. (diff) | |
download | linux-e54def4ad8144ab15f826416e2e0f290ef1901b4.tar.xz linux-e54def4ad8144ab15f826416e2e0f290ef1901b4.zip |
Adding upstream version 6.9.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/clk/imx')
-rw-r--r-- | drivers/clk/imx/clk-composite-8m.c | 16 | ||||
-rw-r--r-- | drivers/clk/imx/clk-imx8-acm.c | 6 | ||||
-rw-r--r-- | drivers/clk/imx/clk-scu.c | 22 |
3 files changed, 21 insertions, 23 deletions
diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c index 27a08c50ac..8cc07d056a 100644 --- a/drivers/clk/imx/clk-composite-8m.c +++ b/drivers/clk/imx/clk-composite-8m.c @@ -212,15 +212,15 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, { struct clk_hw *hw = ERR_PTR(-ENOMEM), *mux_hw; struct clk_hw *div_hw, *gate_hw = NULL; - struct clk_divider *div = NULL; + struct clk_divider *div; struct clk_gate *gate = NULL; - struct clk_mux *mux = NULL; + struct clk_mux *mux; const struct clk_ops *divider_ops; const struct clk_ops *mux_ops; mux = kzalloc(sizeof(*mux), GFP_KERNEL); if (!mux) - goto fail; + return ERR_CAST(hw); mux_hw = &mux->hw; mux->reg = reg; @@ -230,7 +230,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, div = kzalloc(sizeof(*div), GFP_KERNEL); if (!div) - goto fail; + goto free_mux; div_hw = &div->hw; div->reg = reg; @@ -260,7 +260,7 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, if (!mcore_booted) { gate = kzalloc(sizeof(*gate), GFP_KERNEL); if (!gate) - goto fail; + goto free_div; gate_hw = &gate->hw; gate->reg = reg; @@ -272,13 +272,15 @@ struct clk_hw *__imx8m_clk_hw_composite(const char *name, mux_hw, mux_ops, div_hw, divider_ops, gate_hw, &clk_gate_ops, flags); if (IS_ERR(hw)) - goto fail; + goto free_gate; return hw; -fail: +free_gate: kfree(gate); +free_div: kfree(div); +free_mux: kfree(mux); return ERR_CAST(hw); } diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c index f68877eef8..1bdb480cc9 100644 --- a/drivers/clk/imx/clk-imx8-acm.c +++ b/drivers/clk/imx/clk-imx8-acm.c @@ -394,15 +394,13 @@ err_clk_register: return ret; } -static int imx8_acm_clk_remove(struct platform_device *pdev) +static void imx8_acm_clk_remove(struct platform_device *pdev) { struct imx8_acm_priv *priv = dev_get_drvdata(&pdev->dev); pm_runtime_disable(&pdev->dev); clk_imx_acm_detach_pm_domains(&pdev->dev, &priv->dev_pm); - - return 0; } static const struct imx8_acm_soc_data imx8qm_acm_data = { @@ -470,7 +468,7 @@ static struct platform_driver imx8_acm_clk_driver = { .pm = &imx8_acm_pm_ops, }, .probe = imx8_acm_clk_probe, - .remove = imx8_acm_clk_remove, + .remove_new = imx8_acm_clk_remove, }; module_platform_driver(imx8_acm_clk_driver); diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index e48a904c00..b1dd0c08e0 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -712,17 +712,13 @@ struct clk_hw *imx_clk_scu_alloc_dev(const char *name, } ret = platform_device_add_data(pdev, &clk, sizeof(clk)); - if (ret) { - platform_device_put(pdev); - return ERR_PTR(ret); - } + if (ret) + goto put_device; ret = driver_set_override(&pdev->dev, &pdev->driver_override, "imx-scu-clk", strlen("imx-scu-clk")); - if (ret) { - platform_device_put(pdev); - return ERR_PTR(ret); - } + if (ret) + goto put_device; ret = imx_clk_scu_attach_pd(&pdev->dev, rsrc_id); if (ret) @@ -730,13 +726,15 @@ struct clk_hw *imx_clk_scu_alloc_dev(const char *name, name, ret); ret = platform_device_add(pdev); - if (ret) { - platform_device_put(pdev); - return ERR_PTR(ret); - } + if (ret) + goto put_device; /* For API backwards compatiblilty, simply return NULL for success */ return NULL; + +put_device: + platform_device_put(pdev); + return ERR_PTR(ret); } void imx_clk_scu_unregister(void) |