mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-04 19:54:03 +08:00
spi/atmel: Convert to devm_ioremap_resource()
This simplifies error handling. Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
381bd9517a
commit
31407478a7
@ -1546,7 +1546,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
|
|||||||
INIT_LIST_HEAD(&as->queue);
|
INIT_LIST_HEAD(&as->queue);
|
||||||
|
|
||||||
as->pdev = pdev;
|
as->pdev = pdev;
|
||||||
as->regs = ioremap(regs->start, resource_size(regs));
|
as->regs = devm_ioremap_resource(&pdev->dev, regs);
|
||||||
if (!as->regs)
|
if (!as->regs)
|
||||||
goto out_free_buffer;
|
goto out_free_buffer;
|
||||||
as->phybase = regs->start;
|
as->phybase = regs->start;
|
||||||
@ -1617,7 +1617,6 @@ out_free_dma:
|
|||||||
out_free_irq:
|
out_free_irq:
|
||||||
free_irq(irq, master);
|
free_irq(irq, master);
|
||||||
out_unmap_regs:
|
out_unmap_regs:
|
||||||
iounmap(as->regs);
|
|
||||||
out_free_buffer:
|
out_free_buffer:
|
||||||
if (!as->use_pdc)
|
if (!as->use_pdc)
|
||||||
tasklet_kill(&as->tasklet);
|
tasklet_kill(&as->tasklet);
|
||||||
@ -1669,7 +1668,6 @@ static int atmel_spi_remove(struct platform_device *pdev)
|
|||||||
clk_disable_unprepare(as->clk);
|
clk_disable_unprepare(as->clk);
|
||||||
clk_put(as->clk);
|
clk_put(as->clk);
|
||||||
free_irq(as->irq, master);
|
free_irq(as->irq, master);
|
||||||
iounmap(as->regs);
|
|
||||||
|
|
||||||
spi_unregister_master(master);
|
spi_unregister_master(master);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user