diff options
author | Mark Brown <broonie@linaro.org> | 2013-09-01 13:49:02 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-01 13:49:02 +0100 |
commit | 11c28cfc1e4f32dc6d02373a1e80d7e83584ed21 (patch) | |
tree | c052035b7b8b616c10907c830d8ef1dfd9c6348b | |
parent | 4374f332d9fec26a1b377981f39881abff54941a (diff) | |
parent | 1729ce3441ad849e63403fa4347fa86e052559a5 (diff) | |
download | op-kernel-dev-11c28cfc1e4f32dc6d02373a1e80d7e83584ed21.zip op-kernel-dev-11c28cfc1e4f32dc6d02373a1e80d7e83584ed21.tar.gz |
Merge remote-tracking branch 'spi/topic/orion' into spi-next
-rw-r--r-- | drivers/spi/spi-orion.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index d1bae77..1d1d321 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c @@ -447,30 +447,22 @@ static int orion_spi_probe(struct platform_device *pdev) spi->min_speed = DIV_ROUND_UP(tclk_hz, 30); r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (r == NULL) { - status = -ENODEV; + spi->base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(spi->base)) { + status = PTR_ERR(spi->base); goto out_rel_clk; } - if (!request_mem_region(r->start, resource_size(r), - dev_name(&pdev->dev))) { - status = -EBUSY; - goto out_rel_clk; - } - spi->base = ioremap(r->start, SZ_1K); - if (orion_spi_reset(spi) < 0) - goto out_rel_mem; + goto out_rel_clk; master->dev.of_node = pdev->dev.of_node; status = spi_register_master(master); if (status < 0) - goto out_rel_mem; + goto out_rel_clk; return status; -out_rel_mem: - release_mem_region(r->start, resource_size(r)); out_rel_clk: clk_disable_unprepare(spi->clk); clk_put(spi->clk); @@ -483,7 +475,6 @@ out: static int orion_spi_remove(struct platform_device *pdev) { struct spi_master *master; - struct resource *r; struct orion_spi *spi; master = platform_get_drvdata(pdev); @@ -492,9 +483,6 @@ static int orion_spi_remove(struct platform_device *pdev) clk_disable_unprepare(spi->clk); clk_put(spi->clk); - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - release_mem_region(r->start, resource_size(r)); - spi_unregister_master(master); return 0; |