diff options
Diffstat (limited to 'drivers/spi/omap2_mcspi.c')
-rw-r--r-- | drivers/spi/omap2_mcspi.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index 576ae29c39d8..454a2712e629 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c | |||
@@ -1009,7 +1009,12 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) | |||
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | mcspi->phys = r->start; | 1011 | mcspi->phys = r->start; |
1012 | mcspi->base = (void __iomem *) io_p2v(r->start); | 1012 | mcspi->base = ioremap(r->start, r->end - r->start + 1); |
1013 | if (!mcspi->base) { | ||
1014 | dev_dbg(&pdev->dev, "can't ioremap MCSPI\n"); | ||
1015 | status = -ENOMEM; | ||
1016 | goto err1aa; | ||
1017 | } | ||
1013 | 1018 | ||
1014 | INIT_WORK(&mcspi->work, omap2_mcspi_work); | 1019 | INIT_WORK(&mcspi->work, omap2_mcspi_work); |
1015 | 1020 | ||
@@ -1059,6 +1064,8 @@ err3: | |||
1059 | err2: | 1064 | err2: |
1060 | clk_put(mcspi->ick); | 1065 | clk_put(mcspi->ick); |
1061 | err1a: | 1066 | err1a: |
1067 | iounmap(mcspi->base); | ||
1068 | err1aa: | ||
1062 | release_mem_region(r->start, (r->end - r->start) + 1); | 1069 | release_mem_region(r->start, (r->end - r->start) + 1); |
1063 | err1: | 1070 | err1: |
1064 | spi_master_put(master); | 1071 | spi_master_put(master); |
@@ -1071,6 +1078,7 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev) | |||
1071 | struct omap2_mcspi *mcspi; | 1078 | struct omap2_mcspi *mcspi; |
1072 | struct omap2_mcspi_dma *dma_channels; | 1079 | struct omap2_mcspi_dma *dma_channels; |
1073 | struct resource *r; | 1080 | struct resource *r; |
1081 | void __iomem *base; | ||
1074 | 1082 | ||
1075 | master = dev_get_drvdata(&pdev->dev); | 1083 | master = dev_get_drvdata(&pdev->dev); |
1076 | mcspi = spi_master_get_devdata(master); | 1084 | mcspi = spi_master_get_devdata(master); |
@@ -1082,7 +1090,9 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev) | |||
1082 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1090 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1083 | release_mem_region(r->start, (r->end - r->start) + 1); | 1091 | release_mem_region(r->start, (r->end - r->start) + 1); |
1084 | 1092 | ||
1093 | base = mcspi->base; | ||
1085 | spi_unregister_master(master); | 1094 | spi_unregister_master(master); |
1095 | iounmap(base); | ||
1086 | kfree(dma_channels); | 1096 | kfree(dma_channels); |
1087 | 1097 | ||
1088 | return 0; | 1098 | return 0; |