[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4a9f448b-d7d2-d44a-3e68-cfdb331b8847@gmail.com>
Date: Mon, 27 Jul 2020 02:41:03 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Sowjanya Komatineni <skomatineni@...dia.com>,
thierry.reding@...il.com, jonathanh@...dia.com, frankc@...dia.com,
hverkuil@...all.nl, sakari.ailus@....fi, robh+dt@...nel.org,
helen.koike@...labora.com
Cc: sboyd@...nel.org, gregkh@...uxfoundation.org,
linux-media@...r.kernel.org, devicetree@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-i2c@...r.kernel.org
Subject: Re: [RFC PATCH v4 03/14] i2c: tegra: Fix the error path in
tegra_i2c_runtime_resume
24.07.2020 02:51, Sowjanya Komatineni пишет:
> tegra_i2c_runtime_resume does not disable prior enabled clocks
> properly.
>
> This patch fixes it.
>
> Signed-off-by: Sowjanya Komatineni <skomatineni@...dia.com>
> ---
> drivers/i2c/busses/i2c-tegra.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index c91307b9..7b93c45 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -665,18 +665,23 @@ static int __maybe_unused tegra_i2c_runtime_resume(struct device *dev)
> ret = clk_enable(i2c_dev->slow_clk);
> if (ret < 0) {
> dev_err(dev, "failed to enable slow clock: %d\n", ret);
> - return ret;
> + goto disable_fast_clk;
> }
>
> ret = clk_enable(i2c_dev->div_clk);
> if (ret < 0) {
> dev_err(i2c_dev->dev,
> "Enabling div clk failed, err %d\n", ret);
> - clk_disable(i2c_dev->fast_clk);
> - return ret;
> + goto disable_slow_clk;
> }
>
> return 0;
> +
> +disable_slow_clk:
> + clk_disable(i2c_dev->slow_clk);
> +disable_fast_clk:
> + clk_disable(i2c_dev->fast_clk);
> + return ret;
> }
>
> static int __maybe_unused tegra_i2c_runtime_suspend(struct device *dev)
>
Reviewed-by: Dmitry Osipenko <digetx@...il.com>
Powered by blists - more mailing lists