linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed
@ 2020-07-07  8:50 Peng Fan
  2020-07-08 17:00 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan @ 2020-07-07  8:50 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, linux-kernel

There is no need to call spi_master_put() if spi_alloc_master()
failed, it should return -ENOMEM directly.

Signed-off-by: Peng Fan <fanpeng@loongson.cn>
---
 drivers/spi/spi-atmel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 57ee8c3..6ed7abd 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1546,10 +1546,9 @@ static int atmel_spi_probe(struct platform_device *pdev)
 		return PTR_ERR(clk);
 
 	/* setup spi core then atmel-specific driver state */
-	ret = -ENOMEM;
 	master = spi_alloc_master(&pdev->dev, sizeof(*as));
 	if (!master)
-		goto out_free;
+		return -ENOMEM;
 
 	/* the spi->mode bits understood by this driver: */
 	master->use_gpio_descriptors = true;
-- 
2.1.0


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

* Re: [PATCH] spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed
  2020-07-07  8:50 [PATCH] spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed Peng Fan
@ 2020-07-08 17:00 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-07-08 17:00 UTC (permalink / raw)
  To: Peng Fan; +Cc: linux-spi, linux-kernel

On Tue, 7 Jul 2020 16:50:42 +0800, Peng Fan wrote:
> There is no need to call spi_master_put() if spi_alloc_master()
> failed, it should return -ENOMEM directly.

Applied to

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

Thanks!

[1/1] spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed
      commit: 2d9a744685bc3a4bf1d097782550c450ff0c3b04

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] 2+ messages in thread

end of thread, other threads:[~2020-07-08 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07  8:50 [PATCH] spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed Peng Fan
2020-07-08 17:00 ` 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).