diff mbox series

[v2] spi: bcm63xx-hsspi: fix missing clk_disable_unprepare() on error in bcm63xx_hsspi_resume

Message ID 20201103074911.195530-1-miaoqinglang@huawei.com
State Accepted
Commit 9bb9ef2b3e5d9d012876e7e2d7757eb30e865bee
Headers show
Series [v2] spi: bcm63xx-hsspi: fix missing clk_disable_unprepare() on error in bcm63xx_hsspi_resume | expand

Commit Message

'Qinglang Miao Nov. 3, 2020, 7:49 a.m. UTC
Fix the missing clk_disable_unprepare() before return
from bcm63xx_hsspi_resume in the error handling case when
fails to prepare and enable bs->pll_clk.

Fixes: 0fd85869c2a9 ("spi/bcm63xx-hsspi: keep pll clk enabled")
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 drivers/spi/spi-bcm63xx-hsspi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

'Qinglang Miao Nov. 3, 2020, 8:18 a.m. UTC | #1
在 2020/11/3 15:49, Qinglang Miao 写道:
> Fix the missing clk_disable_unprepare() before return

> from bcm63xx_hsspi_resume in the error handling case when

> fails to prepare and enable bs->pll_clk.

> 

> Fixes: 0fd85869c2a9 ("spi/bcm63xx-hsspi: keep pll clk enabled")

> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>

> ---

>   drivers/spi/spi-bcm63xx-hsspi.c | 4 +++-

>   1 file changed, 3 insertions(+), 1 deletion(-)

> 

> diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c

> index 9909b18f3..1f08d7553 100644

> --- a/drivers/spi/spi-bcm63xx-hsspi.c

> +++ b/drivers/spi/spi-bcm63xx-hsspi.c

> @@ -494,8 +494,10 @@ static int bcm63xx_hsspi_resume(struct device *dev)

>   

>   	if (bs->pll_clk) {

>   		ret = clk_prepare_enable(bs->pll_clk);

> -		if (ret)

> +		if (ret) {

> +			clk_disable_unprepare(bs->clk);

>   			return ret;

> +		}

>   	}

>   

>   	spi_master_resume(master);

> 

Hi Mark and Florian,

I made a careless mistake for adding v2 as subject-prefix, this patch is 
the base version actually.

Sorry about that.

Thanks.
Mark Brown Nov. 9, 2020, 7:48 p.m. UTC | #2
On Tue, 3 Nov 2020 15:49:11 +0800, Qinglang Miao wrote:
> Fix the missing clk_disable_unprepare() before return

> from bcm63xx_hsspi_resume in the error handling case when

> fails to prepare and enable bs->pll_clk.


Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: bcm63xx-hsspi: fix missing clk_disable_unprepare() on error in bcm63xx_hsspi_resume
      commit: 9bb9ef2b3e5d9d012876e7e2d7757eb30e865bee

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
index 9909b18f3..1f08d7553 100644
--- a/drivers/spi/spi-bcm63xx-hsspi.c
+++ b/drivers/spi/spi-bcm63xx-hsspi.c
@@ -494,8 +494,10 @@  static int bcm63xx_hsspi_resume(struct device *dev)
 
 	if (bs->pll_clk) {
 		ret = clk_prepare_enable(bs->pll_clk);
-		if (ret)
+		if (ret) {
+			clk_disable_unprepare(bs->clk);
 			return ret;
+		}
 	}
 
 	spi_master_resume(master);