diff options
author | Peng Fan <fanpeng@loongson.cn> | 2020-07-07 10:50:42 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-07-07 15:26:31 +0200 |
commit | 2d9a744685bc3a4bf1d097782550c450ff0c3b04 (patch) | |
tree | 3c78fccbc08a9d3e044c94767237d0140dd5f2d1 /drivers/spi/spi-atmel.c | |
parent | Merge series "Add Renesas RPC-IF support" from Sergei Shtylyov <sergei.shtyly... (diff) | |
download | linux-2d9a744685bc3a4bf1d097782550c450ff0c3b04.tar.xz linux-2d9a744685bc3a4bf1d097782550c450ff0c3b04.zip |
spi: atmel: No need to call spi_master_put() if spi_alloc_master() failed
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>
Link: https://lore.kernel.org/r/1594111842-9468-1-git-send-email-fanpeng@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-atmel.c')
-rw-r--r-- | drivers/spi/spi-atmel.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 57ee8c3b7972..6ed7abdcf74a 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; |