aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-19 01:36:19 -0400
committerKukjin Kim <kgene.kim@samsung.com>2012-07-19 01:36:19 -0400
commitb1ec43084d9b53dadae64da00532e1c02444ef2c (patch)
tree8f08bba37ce486ff162a14e3be5fe7376c5d8f99 /drivers/spi
parent707214d097eb505fe067668838ae800260a064ba (diff)
spi/s3c64xx: Convert to devm_request_and_ioremap()
Saves some error handling and a small amount of code. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-s3c64xx.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 9d103163681e..04f947d8d3c7 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1280,14 +1280,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
1280 /* the spi->mode bits understood by this driver: */ 1280 /* the spi->mode bits understood by this driver: */
1281 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; 1281 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
1282 1282
1283 if (request_mem_region(mem_res->start, 1283 sdd->regs = devm_request_and_ioremap(&pdev->dev, mem_res);
1284 resource_size(mem_res), pdev->name) == NULL) {
1285 dev_err(&pdev->dev, "Req mem region failed\n");
1286 ret = -ENXIO;
1287 goto err0;
1288 }
1289
1290 sdd->regs = ioremap(mem_res->start, resource_size(mem_res));
1291 if (sdd->regs == NULL) { 1284 if (sdd->regs == NULL) {
1292 dev_err(&pdev->dev, "Unable to remap IO\n"); 1285 dev_err(&pdev->dev, "Unable to remap IO\n");
1293 ret = -ENXIO; 1286 ret = -ENXIO;
@@ -1381,9 +1374,7 @@ err3:
1381 if (!sdd->cntrlr_info->cfg_gpio && pdev->dev.of_node) 1374 if (!sdd->cntrlr_info->cfg_gpio && pdev->dev.of_node)
1382 s3c64xx_spi_dt_gpio_free(sdd); 1375 s3c64xx_spi_dt_gpio_free(sdd);
1383err2: 1376err2:
1384 iounmap((void *) sdd->regs);
1385err1: 1377err1:
1386 release_mem_region(mem_res->start, resource_size(mem_res));
1387err0: 1378err0:
1388 platform_set_drvdata(pdev, NULL); 1379 platform_set_drvdata(pdev, NULL);
1389 spi_master_put(master); 1380 spi_master_put(master);
@@ -1395,7 +1386,6 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
1395{ 1386{
1396 struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); 1387 struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
1397 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); 1388 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
1398 struct resource *mem_res;
1399 1389
1400 pm_runtime_disable(&pdev->dev); 1390 pm_runtime_disable(&pdev->dev);
1401 1391
@@ -1414,12 +1404,6 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
1414 if (!sdd->cntrlr_info->cfg_gpio && pdev->dev.of_node) 1404 if (!sdd->cntrlr_info->cfg_gpio && pdev->dev.of_node)
1415 s3c64xx_spi_dt_gpio_free(sdd); 1405 s3c64xx_spi_dt_gpio_free(sdd);
1416 1406
1417 iounmap((void *) sdd->regs);
1418
1419 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1420 if (mem_res != NULL)
1421 release_mem_region(mem_res->start, resource_size(mem_res));
1422
1423 platform_set_drvdata(pdev, NULL); 1407 platform_set_drvdata(pdev, NULL);
1424 spi_master_put(master); 1408 spi_master_put(master);
1425 1409