[PATCH 2/4] soc: mediatek: pwrap: Switch to devm_clk_bulk_get_all_enabled()

Cristian Ciocaltea posted 4 patches 5 days, 1 hour ago
[PATCH 2/4] soc: mediatek: pwrap: Switch to devm_clk_bulk_get_all_enabled()
Posted by Cristian Ciocaltea 5 days, 1 hour ago
The helper devm_clk_bulk_get_all_enable() is partially broken and will
be dropped since it missed to return the number of clocks stored in the
clk_bulk_data table referenced by the clks argument.

Use the newly introduced devm_clk_bulk_get_all_enabled() variant
instead, which is consistent with devm_clk_bulk_get_all() in terms of
the returned value:

 > 0 if one or more clocks have been stored
 = 0 if there are no clocks
 < 0 if an error occurred

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
 drivers/soc/mediatek/mtk-pmic-wrap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index 9fdc0ef79202..0bcd85826375 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -2518,8 +2518,8 @@ static int pwrap_probe(struct platform_device *pdev)
 		}
 	}
 
-	ret = devm_clk_bulk_get_all_enable(wrp->dev, &clk);
-	if (ret)
+	ret = devm_clk_bulk_get_all_enabled(wrp->dev, &clk);
+	if (ret < 0)
 		return dev_err_probe(wrp->dev, ret,
 				     "failed to get clocks\n");
 

-- 
2.46.0
Re: [PATCH 2/4] soc: mediatek: pwrap: Switch to devm_clk_bulk_get_all_enabled()
Posted by AngeloGioacchino Del Regno 3 days, 7 hours ago
Il 14/09/24 20:04, Cristian Ciocaltea ha scritto:
> The helper devm_clk_bulk_get_all_enable() is partially broken and will
> be dropped since it missed to return the number of clocks stored in the
> clk_bulk_data table referenced by the clks argument.
> 
> Use the newly introduced devm_clk_bulk_get_all_enabled() variant
> instead, which is consistent with devm_clk_bulk_get_all() in terms of
> the returned value:
> 
>   > 0 if one or more clocks have been stored
>   = 0 if there are no clocks
>   < 0 if an error occurred
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> ---
>   drivers/soc/mediatek/mtk-pmic-wrap.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> index 9fdc0ef79202..0bcd85826375 100644
> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> @@ -2518,8 +2518,8 @@ static int pwrap_probe(struct platform_device *pdev)
>   		}
>   	}
>   
> -	ret = devm_clk_bulk_get_all_enable(wrp->dev, &clk);
> -	if (ret)
> +	ret = devm_clk_bulk_get_all_enabled(wrp->dev, &clk);
> +	if (ret < 0)
>   		return dev_err_probe(wrp->dev, ret,
>   				     "failed to get clocks\n");
>   
>