From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
The CCI clock en/disable functions simply call bulk_ops, remove them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
drivers/i2c/busses/i2c-qcom-cci.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index a3afa11a71a10dbb720ee9acb566991fe55b98a0..74fedfdec3ae4e034ec4d946179e963c783b5923 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -466,21 +466,12 @@ static const struct i2c_algorithm cci_algo = {
.functionality = cci_func,
};
-static int cci_enable_clocks(struct cci *cci)
-{
- return clk_bulk_prepare_enable(cci->nclocks, cci->clocks);
-}
-
-static void cci_disable_clocks(struct cci *cci)
-{
- clk_bulk_disable_unprepare(cci->nclocks, cci->clocks);
-}
-
static int __maybe_unused cci_suspend_runtime(struct device *dev)
{
struct cci *cci = dev_get_drvdata(dev);
- cci_disable_clocks(cci);
+ clk_bulk_disable_unprepare(cci->nclocks, cci->clocks);
+
return 0;
}
@@ -489,11 +480,12 @@ static int __maybe_unused cci_resume_runtime(struct device *dev)
struct cci *cci = dev_get_drvdata(dev);
int ret;
- ret = cci_enable_clocks(cci);
+ ret = clk_bulk_prepare_enable(cci->nclocks, cci->clocks);
if (ret)
return ret;
cci_init(cci);
+
return 0;
}
@@ -592,7 +584,7 @@ static int cci_probe(struct platform_device *pdev)
return dev_err_probe(dev, -EINVAL, "not enough clocks in DT\n");
cci->nclocks = ret;
- ret = cci_enable_clocks(cci);
+ ret = clk_bulk_prepare_enable(cci->nclocks, cci->clocks);
if (ret < 0)
return ret;
@@ -651,7 +643,7 @@ static int cci_probe(struct platform_device *pdev)
error:
disable_irq(cci->irq);
disable_clocks:
- cci_disable_clocks(cci);
+ clk_bulk_disable_unprepare(cci->nclocks, cci->clocks);
return ret;
}
--
2.51.0
On Thu, Sep 4, 2025 at 4:31 PM Konrad Dybcio <konradybcio@kernel.org> wrote: > > From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> > > The CCI clock en/disable functions simply call bulk_ops, remove them. > > Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
On 04/09/2025 15:31, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>
> The CCI clock en/disable functions simply call bulk_ops, remove them.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
> drivers/i2c/busses/i2c-qcom-cci.c | 20 ++++++--------------
> 1 file changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
> index a3afa11a71a10dbb720ee9acb566991fe55b98a0..74fedfdec3ae4e034ec4d946179e963c783b5923 100644
> --- a/drivers/i2c/busses/i2c-qcom-cci.c
> +++ b/drivers/i2c/busses/i2c-qcom-cci.c
> @@ -466,21 +466,12 @@ static const struct i2c_algorithm cci_algo = {
> .functionality = cci_func,
> };
>
> -static int cci_enable_clocks(struct cci *cci)
> -{
> - return clk_bulk_prepare_enable(cci->nclocks, cci->clocks);
> -}
> -
> -static void cci_disable_clocks(struct cci *cci)
> -{
> - clk_bulk_disable_unprepare(cci->nclocks, cci->clocks);
> -}
> -
> static int __maybe_unused cci_suspend_runtime(struct device *dev)
> {
> struct cci *cci = dev_get_drvdata(dev);
>
> - cci_disable_clocks(cci);
> + clk_bulk_disable_unprepare(cci->nclocks, cci->clocks);
> +
> return 0;
> }
>
> @@ -489,11 +480,12 @@ static int __maybe_unused cci_resume_runtime(struct device *dev)
> struct cci *cci = dev_get_drvdata(dev);
> int ret;
>
> - ret = cci_enable_clocks(cci);
> + ret = clk_bulk_prepare_enable(cci->nclocks, cci->clocks);
> if (ret)
> return ret;
>
> cci_init(cci);
> +
> return 0;
> }
>
> @@ -592,7 +584,7 @@ static int cci_probe(struct platform_device *pdev)
> return dev_err_probe(dev, -EINVAL, "not enough clocks in DT\n");
> cci->nclocks = ret;
>
> - ret = cci_enable_clocks(cci);
> + ret = clk_bulk_prepare_enable(cci->nclocks, cci->clocks);
> if (ret < 0)
> return ret;
>
> @@ -651,7 +643,7 @@ static int cci_probe(struct platform_device *pdev)
> error:
> disable_irq(cci->irq);
> disable_clocks:
> - cci_disable_clocks(cci);
> + clk_bulk_disable_unprepare(cci->nclocks, cci->clocks);
>
> return ret;
> }
>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
© 2016 - 2026 Red Hat, Inc.