diff options
author | Mark Brown <broonie@linaro.org> | 2013-10-16 08:22:35 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-16 18:33:16 -0400 |
commit | 31407478a7b56187f9912eb6882a3c623365319f (patch) | |
tree | 6c698c018a4948fdfea640ab009f4e1ad466fe82 /drivers/spi/spi-atmel.c | |
parent | 381bd9517a7e611871694689c67901d189cf6a62 (diff) |
spi/atmel: Convert to devm_ioremap_resource()
This simplifies error handling.
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-atmel.c')
-rw-r--r-- | drivers/spi/spi-atmel.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index ce4953f74423..118a938776bd 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c | |||
@@ -1546,7 +1546,7 @@ static int atmel_spi_probe(struct platform_device *pdev) | |||
1546 | INIT_LIST_HEAD(&as->queue); | 1546 | INIT_LIST_HEAD(&as->queue); |
1547 | 1547 | ||
1548 | as->pdev = pdev; | 1548 | as->pdev = pdev; |
1549 | as->regs = ioremap(regs->start, resource_size(regs)); | 1549 | as->regs = devm_ioremap_resource(&pdev->dev, regs); |
1550 | if (!as->regs) | 1550 | if (!as->regs) |
1551 | goto out_free_buffer; | 1551 | goto out_free_buffer; |
1552 | as->phybase = regs->start; | 1552 | as->phybase = regs->start; |
@@ -1617,7 +1617,6 @@ out_free_dma: | |||
1617 | out_free_irq: | 1617 | out_free_irq: |
1618 | free_irq(irq, master); | 1618 | free_irq(irq, master); |
1619 | out_unmap_regs: | 1619 | out_unmap_regs: |
1620 | iounmap(as->regs); | ||
1621 | out_free_buffer: | 1620 | out_free_buffer: |
1622 | if (!as->use_pdc) | 1621 | if (!as->use_pdc) |
1623 | tasklet_kill(&as->tasklet); | 1622 | tasklet_kill(&as->tasklet); |
@@ -1669,7 +1668,6 @@ static int atmel_spi_remove(struct platform_device *pdev) | |||
1669 | clk_disable_unprepare(as->clk); | 1668 | clk_disable_unprepare(as->clk); |
1670 | clk_put(as->clk); | 1669 | clk_put(as->clk); |
1671 | free_irq(as->irq, master); | 1670 | free_irq(as->irq, master); |
1672 | iounmap(as->regs); | ||
1673 | 1671 | ||
1674 | spi_unregister_master(master); | 1672 | spi_unregister_master(master); |
1675 | 1673 | ||