mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 14:46:22 +07:00
spi: sirf: replace kmalloc by devm_kzalloc
Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
96bf40194f
commit
a34bcbedf8
@ -758,7 +758,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
|
|||||||
/* We are not using dummy delay between command and data */
|
/* We are not using dummy delay between command and data */
|
||||||
writel(0, sspi->base + SIRFSOC_SPI_DUMMY_DELAY_CTL);
|
writel(0, sspi->base + SIRFSOC_SPI_DUMMY_DELAY_CTL);
|
||||||
|
|
||||||
sspi->dummypage = kmalloc(2 * PAGE_SIZE, GFP_KERNEL);
|
sspi->dummypage = devm_kzalloc(&pdev->dev, 2 * PAGE_SIZE, GFP_KERNEL);
|
||||||
if (!sspi->dummypage) {
|
if (!sspi->dummypage) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto free_clk;
|
goto free_clk;
|
||||||
@ -766,12 +766,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
ret = spi_bitbang_start(&sspi->bitbang);
|
ret = spi_bitbang_start(&sspi->bitbang);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto free_dummypage;
|
goto free_clk;
|
||||||
dev_info(&pdev->dev, "registerred, bus number = %d\n", master->bus_num);
|
dev_info(&pdev->dev, "registerred, bus number = %d\n", master->bus_num);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
free_dummypage:
|
|
||||||
kfree(sspi->dummypage);
|
|
||||||
free_clk:
|
free_clk:
|
||||||
clk_disable_unprepare(sspi->clk);
|
clk_disable_unprepare(sspi->clk);
|
||||||
clk_put(sspi->clk);
|
clk_put(sspi->clk);
|
||||||
@ -794,7 +792,6 @@ static int spi_sirfsoc_remove(struct platform_device *pdev)
|
|||||||
sspi = spi_master_get_devdata(master);
|
sspi = spi_master_get_devdata(master);
|
||||||
|
|
||||||
spi_bitbang_stop(&sspi->bitbang);
|
spi_bitbang_stop(&sspi->bitbang);
|
||||||
kfree(sspi->dummypage);
|
|
||||||
clk_disable_unprepare(sspi->clk);
|
clk_disable_unprepare(sspi->clk);
|
||||||
clk_put(sspi->clk);
|
clk_put(sspi->clk);
|
||||||
dma_release_channel(sspi->rx_chan);
|
dma_release_channel(sspi->rx_chan);
|
||||||
|
Loading…
Reference in New Issue
Block a user