Commit 2d9a7446 authored by Peng Fan's avatar Peng Fan Committed by Mark Brown

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: default avatarPeng Fan <fanpeng@loongson.cn>
Link: https://lore.kernel.org/r/1594111842-9468-1-git-send-email-fanpeng@loongson.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d9352996
...@@ -1546,10 +1546,9 @@ static int atmel_spi_probe(struct platform_device *pdev) ...@@ -1546,10 +1546,9 @@ static int atmel_spi_probe(struct platform_device *pdev)
return PTR_ERR(clk); return PTR_ERR(clk);
/* setup spi core then atmel-specific driver state */ /* setup spi core then atmel-specific driver state */
ret = -ENOMEM;
master = spi_alloc_master(&pdev->dev, sizeof(*as)); master = spi_alloc_master(&pdev->dev, sizeof(*as));
if (!master) if (!master)
goto out_free; return -ENOMEM;
/* the spi->mode bits understood by this driver: */ /* the spi->mode bits understood by this driver: */
master->use_gpio_descriptors = true; master->use_gpio_descriptors = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment