linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
@ 2020-11-03  7:49 Qinglang Miao
  2020-11-03  8:18 ` Qinglang Miao
  2020-11-09 19:48 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Qinglang Miao @ 2020-11-03  7:49 UTC (permalink / raw)
  To: Mark Brown, Matthias Brugger
  Cc: linux-spi, linux-arm-kernel, linux-mediatek, linux-kernel, Qinglang Miao

Fix the missing clk_disable_unprepare() before return
from mt7621_spi_probe in the error handling case.

Fixes: cbd66c626e16 ("spi: mt7621: Move SPI driver out of staging")
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 drivers/spi/spi-mt7621.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-mt7621.c b/drivers/spi/spi-mt7621.c
index 2c3b7a2a1..2cdae7994 100644
--- a/drivers/spi/spi-mt7621.c
+++ b/drivers/spi/spi-mt7621.c
@@ -353,6 +353,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
 	master = spi_alloc_master(&pdev->dev, sizeof(*rs));
 	if (!master) {
 		dev_info(&pdev->dev, "master allocation failed\n");
+		clk_disable_unprepare(clk);
 		return -ENOMEM;
 	}
 
@@ -377,6 +378,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
 	ret = device_reset(&pdev->dev);
 	if (ret) {
 		dev_err(&pdev->dev, "SPI reset failed!\n");
+		clk_disable_unprepare(clk);
 		return ret;
 	}
 
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
  2020-11-03  7:49 [PATCH v2] spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe Qinglang Miao
@ 2020-11-03  8:18 ` Qinglang Miao
  2020-11-09 19:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Qinglang Miao @ 2020-11-03  8:18 UTC (permalink / raw)
  To: Mark Brown, Matthias Brugger
  Cc: linux-spi, linux-arm-kernel, linux-mediatek, linux-kernel



在 2020/11/3 15:49, Qinglang Miao 写道:
> Fix the missing clk_disable_unprepare() before return
> from mt7621_spi_probe in the error handling case.
> 
> Fixes: cbd66c626e16 ("spi: mt7621: Move SPI driver out of staging")
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> ---
>   drivers/spi/spi-mt7621.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/spi/spi-mt7621.c b/drivers/spi/spi-mt7621.c
> index 2c3b7a2a1..2cdae7994 100644
> --- a/drivers/spi/spi-mt7621.c
> +++ b/drivers/spi/spi-mt7621.c
> @@ -353,6 +353,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
>   	master = spi_alloc_master(&pdev->dev, sizeof(*rs));
>   	if (!master) {
>   		dev_info(&pdev->dev, "master allocation failed\n");
> +		clk_disable_unprepare(clk);
>   		return -ENOMEM;
>   	}
>   
> @@ -377,6 +378,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
>   	ret = device_reset(&pdev->dev);
>   	if (ret) {
>   		dev_err(&pdev->dev, "SPI reset failed!\n");
> +		clk_disable_unprepare(clk);
>   		return ret;
>   	}
>   
> 
Hi Mark and Matthias,

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

Sorry about that.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
  2020-11-03  7:49 [PATCH v2] spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe Qinglang Miao
  2020-11-03  8:18 ` Qinglang Miao
@ 2020-11-09 19:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-11-09 19:48 UTC (permalink / raw)
  To: Qinglang Miao, Matthias Brugger
  Cc: linux-kernel, linux-arm-kernel, linux-mediatek, linux-spi

On Tue, 3 Nov 2020 15:49:12 +0800, Qinglang Miao wrote:
> Fix the missing clk_disable_unprepare() before return
> from mt7621_spi_probe in the error handling case.

Applied to

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

Thanks!

[1/1] spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
      commit: 702b15cb97123cedcec56a39d9a21c5288eb9ae1

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-09 19:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03  7:49 [PATCH v2] spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe Qinglang Miao
2020-11-03  8:18 ` Qinglang Miao
2020-11-09 19:48 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).