aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/gpio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 10:25:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 10:25:43 -0400
commit05ec7dd8dd5aa42c22a49682e4a51cadd4166b7e (patch)
tree6370b43c0d8f324aa7421bbb5a647aa04ab5d747 /drivers/mtd/nand/gpio.c
parentc316ba3b518bc35ce5aef5421135220389f4eb98 (diff)
parent8046112818b70329e930b1d4557ef0876c1ad2bb (diff)
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (154 commits) mtd: cfi_cmdset_0002: use AMD standard command-set with Winbond flash chips mtd: cfi_cmdset_0002: Fix MODULE_ALIAS and linkage for new 0701 commandset ID mtd: mxc_nand: Remove duplicate NAND_CMD_RESET case value mtd: update gfp/slab.h includes jffs2: Stop triggering block erases from jffs2_write_super() jffs2: Rename jffs2_erase_pending_trigger() to jffs2_dirty_trigger() jffs2: Use jffs2_garbage_collect_trigger() to trigger pending erases jffs2: Require jffs2_garbage_collect_trigger() to be called with lock held jffs2: Wake GC thread when there are blocks to be erased jffs2: Erase pending blocks in GC pass, avoid invalid -EIO return jffs2: Add 'work_done' return value from jffs2_erase_pending_blocks() mtd: mtdchar: Do not corrupt backing device of device node inode mtd/maps/pcmciamtd: Fix printk format for ssize_t in debug messages drivers/mtd: Use kmemdup mtd: cfi_cmdset_0002: Fix argument order in bootloc warning mtd: nand: add Toshiba TC58NVG0 device ID pcmciamtd: add another ID pcmciamtd: coding style cleanups pcmciamtd: fixing obvious errors mtd: chips: add SST39WF160x NOR-flashes ... Trivial conflicts due to dev_node removal in drivers/mtd/maps/pcmciamtd.c
Diffstat (limited to 'drivers/mtd/nand/gpio.c')
-rw-r--r--drivers/mtd/nand/gpio.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index 8f902e75aa85..0cde618bcc1e 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -181,11 +181,11 @@ static int __devexit gpio_nand_remove(struct platform_device *dev)
181 res = platform_get_resource(dev, IORESOURCE_MEM, 1); 181 res = platform_get_resource(dev, IORESOURCE_MEM, 1);
182 iounmap(gpiomtd->io_sync); 182 iounmap(gpiomtd->io_sync);
183 if (res) 183 if (res)
184 release_mem_region(res->start, res->end - res->start + 1); 184 release_mem_region(res->start, resource_size(res));
185 185
186 res = platform_get_resource(dev, IORESOURCE_MEM, 0); 186 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
187 iounmap(gpiomtd->nand_chip.IO_ADDR_R); 187 iounmap(gpiomtd->nand_chip.IO_ADDR_R);
188 release_mem_region(res->start, res->end - res->start + 1); 188 release_mem_region(res->start, resource_size(res));
189 189
190 if (gpio_is_valid(gpiomtd->plat.gpio_nwp)) 190 if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
191 gpio_set_value(gpiomtd->plat.gpio_nwp, 0); 191 gpio_set_value(gpiomtd->plat.gpio_nwp, 0);
@@ -208,14 +208,14 @@ static void __iomem *request_and_remap(struct resource *res, size_t size,
208{ 208{
209 void __iomem *ptr; 209 void __iomem *ptr;
210 210
211 if (!request_mem_region(res->start, res->end - res->start + 1, name)) { 211 if (!request_mem_region(res->start, resource_size(res), name)) {
212 *err = -EBUSY; 212 *err = -EBUSY;
213 return NULL; 213 return NULL;
214 } 214 }
215 215
216 ptr = ioremap(res->start, size); 216 ptr = ioremap(res->start, size);
217 if (!ptr) { 217 if (!ptr) {
218 release_mem_region(res->start, res->end - res->start + 1); 218 release_mem_region(res->start, resource_size(res));
219 *err = -ENOMEM; 219 *err = -ENOMEM;
220 } 220 }
221 return ptr; 221 return ptr;
@@ -338,10 +338,10 @@ err_nwp:
338err_nce: 338err_nce:
339 iounmap(gpiomtd->io_sync); 339 iounmap(gpiomtd->io_sync);
340 if (res1) 340 if (res1)
341 release_mem_region(res1->start, res1->end - res1->start + 1); 341 release_mem_region(res1->start, resource_size(res1));
342err_sync: 342err_sync:
343 iounmap(gpiomtd->nand_chip.IO_ADDR_R); 343 iounmap(gpiomtd->nand_chip.IO_ADDR_R);
344 release_mem_region(res0->start, res0->end - res0->start + 1); 344 release_mem_region(res0->start, resource_size(res0));
345err_map: 345err_map:
346 kfree(gpiomtd); 346 kfree(gpiomtd);
347 return ret; 347 return ret;