]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.1.1/omap-spi-fix-the-trying-to-free-nonexistent-resource-error.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.1.1 / omap-spi-fix-the-trying-to-free-nonexistent-resource-error.patch
CommitLineData
053814ac
GKH
1From 1458d160de3f1862aeaac57447ba96e7857ac52b Mon Sep 17 00:00:00 2001
2From: Shubhrajyoti D <shubhrajyoti@ti.com>
3Date: Mon, 24 Oct 2011 15:54:24 +0530
4Subject: OMAP: SPI: Fix the trying to free nonexistent resource error
5
6From: Shubhrajyoti D <shubhrajyoti@ti.com>
7
8commit 1458d160de3f1862aeaac57447ba96e7857ac52b upstream.
9
10Currently there is a request_mem_region(r->start, ..
11followed by r->start += pdata->regs_offset;
12
13And then in remove
14
15 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
16 release_mem_region(r->start, resource_size(r));
17
18Here the offset addition is not taken care. Fix the code for the
19same.
20
21Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
22Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
23Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
24
25---
26 drivers/spi/spi-omap2-mcspi.c | 7 ++++---
27 1 file changed, 4 insertions(+), 3 deletions(-)
28
29--- a/drivers/spi/spi-omap2-mcspi.c
30+++ b/drivers/spi/spi-omap2-mcspi.c
31@@ -1116,15 +1116,16 @@ static int __init omap2_mcspi_probe(stru
32 status = -ENODEV;
33 goto err1;
34 }
35+
36+ r->start += pdata->regs_offset;
37+ r->end += pdata->regs_offset;
38+ mcspi->phys = r->start;
39 if (!request_mem_region(r->start, resource_size(r),
40 dev_name(&pdev->dev))) {
41 status = -EBUSY;
42 goto err1;
43 }
44
45- r->start += pdata->regs_offset;
46- r->end += pdata->regs_offset;
47- mcspi->phys = r->start;
48 mcspi->base = ioremap(r->start, resource_size(r));
49 if (!mcspi->base) {
50 dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");