Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300237
b: refs/heads/master
c: b027274
h: refs/heads/master
i:
  300235: c22306a
v: v3
  • Loading branch information
Janusz Krzysztofik authored and David Woodhouse committed May 8, 2012
1 parent 75190f9 commit 62de2eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 226bb7df3d22bcf4a1c0fe8206c80cc427498eae
refs/heads/master: b027274d2e3a332683b73f15e5cea79c240bc9a3
17 changes: 6 additions & 11 deletions trunk/drivers/mtd/nand/ams-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,17 @@ static int __devinit ams_delta_init(struct platform_device *pdev)
/* Link the private data with the MTD structure */
ams_delta_mtd->priv = this;

if (!request_mem_region(res->start, resource_size(res),
dev_name(&pdev->dev))) {
dev_err(&pdev->dev, "request_mem_region failed\n");
err = -EBUSY;
goto out_free;
}
/*
* Don't try to request the memory region from here,
* it should have been already requested from the
* gpio-omap driver and requesting it again would fail.
*/

io_base = ioremap(res->start, resource_size(res));
if (io_base == NULL) {
dev_err(&pdev->dev, "ioremap failed\n");
err = -EIO;
goto out_release_io;
goto out_free;
}

this->priv = io_base;
Expand Down Expand Up @@ -271,8 +270,6 @@ static int __devinit ams_delta_init(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);
gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
iounmap(io_base);
out_release_io:
release_mem_region(res->start, resource_size(res));
out_free:
kfree(ams_delta_mtd);
out:
Expand All @@ -285,15 +282,13 @@ static int __devinit ams_delta_init(struct platform_device *pdev)
static int __devexit ams_delta_cleanup(struct platform_device *pdev)
{
void __iomem *io_base = platform_get_drvdata(pdev);
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

/* Release resources, unregister device */
nand_release(ams_delta_mtd);

gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
iounmap(io_base);
release_mem_region(res->start, resource_size(res));

/* Free the MTD device structure */
kfree(ams_delta_mtd);
Expand Down

0 comments on commit 62de2eb

Please sign in to comment.