aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSekhar Nori <nsekhar@ti.com>2010-10-08 04:34:22 -0400
committerSekhar Nori <nsekhar@ti.com>2010-11-18 08:08:37 -0500
commit0e0eae4d1cdff5fa6608bcc6f6990774dec2527d (patch)
tree9cf829fe818a49b57653aed6b552a82f1308b14e /drivers
parent43abb11ba540e21346c6e7ab3211b48928501ea6 (diff)
spi: davinci: remove unnecessary private data member 'region_size'
Remove unnecesary private data member 'region_size' being used to store the size of SPI memory region. Instead, get the memory resource size directly from the platform data. Tested-By: Brian Niebuhr <bniebuhr@efjohnson.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/davinci_spi.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 42314a321d30..f6f63d058140 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -129,7 +129,6 @@ struct davinci_spi {
129 u8 version; 129 u8 version;
130 resource_size_t pbase; 130 resource_size_t pbase;
131 void __iomem *base; 131 void __iomem *base;
132 size_t region_size;
133 u32 irq; 132 u32 irq;
134 struct completion done; 133 struct completion done;
135 134
@@ -835,17 +834,15 @@ static int davinci_spi_probe(struct platform_device *pdev)
835 } 834 }
836 835
837 davinci_spi->pbase = r->start; 836 davinci_spi->pbase = r->start;
838 davinci_spi->region_size = resource_size(r);
839 davinci_spi->pdata = pdata; 837 davinci_spi->pdata = pdata;
840 838
841 mem = request_mem_region(r->start, davinci_spi->region_size, 839 mem = request_mem_region(r->start, resource_size(r), pdev->name);
842 pdev->name);
843 if (mem == NULL) { 840 if (mem == NULL) {
844 ret = -EBUSY; 841 ret = -EBUSY;
845 goto free_master; 842 goto free_master;
846 } 843 }
847 844
848 davinci_spi->base = ioremap(r->start, davinci_spi->region_size); 845 davinci_spi->base = ioremap(r->start, resource_size(r));
849 if (davinci_spi->base == NULL) { 846 if (davinci_spi->base == NULL) {
850 ret = -ENOMEM; 847 ret = -ENOMEM;
851 goto release_region; 848 goto release_region;
@@ -972,7 +969,7 @@ irq_free:
972unmap_io: 969unmap_io:
973 iounmap(davinci_spi->base); 970 iounmap(davinci_spi->base);
974release_region: 971release_region:
975 release_mem_region(davinci_spi->pbase, davinci_spi->region_size); 972 release_mem_region(davinci_spi->pbase, resource_size(r));
976free_master: 973free_master:
977 kfree(master); 974 kfree(master);
978err: 975err:
@@ -992,6 +989,7 @@ static int __exit davinci_spi_remove(struct platform_device *pdev)
992{ 989{
993 struct davinci_spi *davinci_spi; 990 struct davinci_spi *davinci_spi;
994 struct spi_master *master; 991 struct spi_master *master;
992 struct resource *r;
995 993
996 master = dev_get_drvdata(&pdev->dev); 994 master = dev_get_drvdata(&pdev->dev);
997 davinci_spi = spi_master_get_devdata(master); 995 davinci_spi = spi_master_get_devdata(master);
@@ -1003,7 +1001,8 @@ static int __exit davinci_spi_remove(struct platform_device *pdev)
1003 spi_master_put(master); 1001 spi_master_put(master);
1004 free_irq(davinci_spi->irq, davinci_spi); 1002 free_irq(davinci_spi->irq, davinci_spi);
1005 iounmap(davinci_spi->base); 1003 iounmap(davinci_spi->base);
1006 release_mem_region(davinci_spi->pbase, davinci_spi->region_size); 1004 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1005 release_mem_region(davinci_spi->pbase, resource_size(r));
1007 1006
1008 return 0; 1007 return 0;
1009} 1008}