mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
spi: atcspi200: two cleanup
Link: https://patch.msgid.link/20260417-atcspi-v1-0-854831667d63@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
commit
43b0b44b31
|
|
@ -550,7 +550,7 @@ static int atcspi_probe(struct platform_device *pdev)
|
|||
struct resource *mem_res;
|
||||
int ret;
|
||||
|
||||
host = spi_alloc_host(&pdev->dev, sizeof(*spi));
|
||||
host = devm_spi_alloc_host(&pdev->dev, sizeof(*spi));
|
||||
if (!host)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -559,28 +559,24 @@ static int atcspi_probe(struct platform_device *pdev)
|
|||
spi->dev = &pdev->dev;
|
||||
dev_set_drvdata(&pdev->dev, host);
|
||||
|
||||
mutex_init(&spi->mutex_lock);
|
||||
ret = devm_mutex_init(&pdev->dev, &spi->mutex_lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = atcspi_init_resources(pdev, spi, &mem_res);
|
||||
if (ret)
|
||||
goto free_controller;
|
||||
return ret;
|
||||
|
||||
ret = atcspi_enable_clk(spi);
|
||||
if (ret)
|
||||
goto free_controller;
|
||||
return ret;
|
||||
|
||||
atcspi_init_controller(pdev, spi, host, mem_res);
|
||||
|
||||
ret = atcspi_setup(spi);
|
||||
if (ret)
|
||||
goto free_controller;
|
||||
return ret;
|
||||
|
||||
ret = devm_spi_register_controller(&pdev->dev, host);
|
||||
if (ret) {
|
||||
dev_err_probe(spi->dev, ret,
|
||||
"Failed to register SPI controller\n");
|
||||
goto free_controller;
|
||||
}
|
||||
spi->use_dma = false;
|
||||
if (ATCSPI_DMA_SUPPORT) {
|
||||
ret = atcspi_configure_dma(spi);
|
||||
|
|
@ -591,12 +587,12 @@ static int atcspi_probe(struct platform_device *pdev)
|
|||
spi->use_dma = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
ret = devm_spi_register_controller(&pdev->dev, host);
|
||||
if (ret)
|
||||
return dev_err_probe(spi->dev, ret,
|
||||
"Failed to register SPI controller\n");
|
||||
|
||||
free_controller:
|
||||
mutex_destroy(&spi->mutex_lock);
|
||||
spi_controller_put(host);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int atcspi_suspend(struct device *dev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user