mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
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>
This commit is contained in:
parent
d93529962d
commit
2d9a744685
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user