Commit 0e0eae4d authored by Sekhar Nori's avatar Sekhar Nori

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: default avatarBrian Niebuhr <bniebuhr@efjohnson.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 43abb11b
...@@ -129,7 +129,6 @@ struct davinci_spi { ...@@ -129,7 +129,6 @@ struct davinci_spi {
u8 version; u8 version;
resource_size_t pbase; resource_size_t pbase;
void __iomem *base; void __iomem *base;
size_t region_size;
u32 irq; u32 irq;
struct completion done; struct completion done;
...@@ -835,17 +834,15 @@ static int davinci_spi_probe(struct platform_device *pdev) ...@@ -835,17 +834,15 @@ static int davinci_spi_probe(struct platform_device *pdev)
} }
davinci_spi->pbase = r->start; davinci_spi->pbase = r->start;
davinci_spi->region_size = resource_size(r);
davinci_spi->pdata = pdata; davinci_spi->pdata = pdata;
mem = request_mem_region(r->start, davinci_spi->region_size, mem = request_mem_region(r->start, resource_size(r), pdev->name);
pdev->name);
if (mem == NULL) { if (mem == NULL) {
ret = -EBUSY; ret = -EBUSY;
goto free_master; goto free_master;
} }
davinci_spi->base = ioremap(r->start, davinci_spi->region_size); davinci_spi->base = ioremap(r->start, resource_size(r));
if (davinci_spi->base == NULL) { if (davinci_spi->base == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto release_region; goto release_region;
...@@ -972,7 +969,7 @@ static int davinci_spi_probe(struct platform_device *pdev) ...@@ -972,7 +969,7 @@ static int davinci_spi_probe(struct platform_device *pdev)
unmap_io: unmap_io:
iounmap(davinci_spi->base); iounmap(davinci_spi->base);
release_region: release_region:
release_mem_region(davinci_spi->pbase, davinci_spi->region_size); release_mem_region(davinci_spi->pbase, resource_size(r));
free_master: free_master:
kfree(master); kfree(master);
err: err:
...@@ -992,6 +989,7 @@ static int __exit davinci_spi_remove(struct platform_device *pdev) ...@@ -992,6 +989,7 @@ static int __exit davinci_spi_remove(struct platform_device *pdev)
{ {
struct davinci_spi *davinci_spi; struct davinci_spi *davinci_spi;
struct spi_master *master; struct spi_master *master;
struct resource *r;
master = dev_get_drvdata(&pdev->dev); master = dev_get_drvdata(&pdev->dev);
davinci_spi = spi_master_get_devdata(master); davinci_spi = spi_master_get_devdata(master);
...@@ -1003,7 +1001,8 @@ static int __exit davinci_spi_remove(struct platform_device *pdev) ...@@ -1003,7 +1001,8 @@ static int __exit davinci_spi_remove(struct platform_device *pdev)
spi_master_put(master); spi_master_put(master);
free_irq(davinci_spi->irq, davinci_spi); free_irq(davinci_spi->irq, davinci_spi);
iounmap(davinci_spi->base); iounmap(davinci_spi->base);
release_mem_region(davinci_spi->pbase, davinci_spi->region_size); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(davinci_spi->pbase, resource_size(r));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment