Skip to contentSkip to conversation

pxa3xx_nand improvements

PATCH New Mike Rapoport 1 participant 4 messages Feb 17, 2009

Subsystems (5)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 MTD: NAND: pxa3xx_nand: use resource_size instead of 'r->end - r->start + 1'

---
 drivers/mtd/nand/pxa3xx_nand.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mtd/nand/pxa3xx_nand.c +3 -3
index cc55cbc..ffa960b 100644
@@ -1118,14 +1118,14 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 		goto fail_put_clk;
 	}
 
-	r = request_mem_region(r->start, r->end - r->start + 1, pdev->name);
+	r = request_mem_region(r->start, resource_size(r), pdev->name);
 	if (r == NULL) {
 		dev_err(&pdev->dev, "failed to request memory resource\n");
 		ret = -EBUSY;
 		goto fail_put_clk;
 	}
 
-	info->mmio_base = ioremap(r->start, r->end - r->start + 1);
+	info->mmio_base = ioremap(r->start, resource_size(r));
 	if (info->mmio_base == NULL) {
 		dev_err(&pdev->dev, "ioremap() failed\n");
 		ret = -ENODEV;
@@ -1174,7 +1174,7 @@ fail_free_buf:
 fail_free_io:
 	iounmap(info->mmio_base);
 fail_free_res:
-	release_mem_region(r->start, r->end - r->start + 1);
+	release_mem_region(r->start, resource_size(r));
 fail_put_clk:
 	clk_disable(info->clk);
 	clk_put(info->clk);
Signature · 1 line
1.5.6.4
#2 lore raw

PATCH 1/1 MTD: NAND: pxa3xx_nand: allow building as module

In reply to Mike Rapoport
---
 drivers/mtd/nand/Kconfig       |    2 +-
 drivers/mtd/nand/pxa3xx_nand.c |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
drivers/mtd/nand/Kconfig +1 -1
index 8b12e6e..d3966d0 100644
@@ -334,7 +334,7 @@ config MTD_NAND_ATMEL_ECC_NONE
 endchoice
 
 config MTD_NAND_PXA3xx
-	bool "Support for NAND flash devices on PXA3xx"
+	tristate "Support for NAND flash devices on PXA3xx"
 	depends on MTD_NAND && PXA3xx
 	help
 	  This enables the driver for the NAND flash device found on
drivers/mtd/nand/pxa3xx_nand.c +10 -0
index ffa960b..ead4a7a 100644
@@ -1079,6 +1079,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 
 	this = &info->nand_chip;
 	mtd->priv = info;
+	mtd->owner = THIS_MODULE;
 
 	info->clk = clk_get(&pdev->dev, NULL);
 	if (IS_ERR(info->clk)) {
@@ -1187,6 +1188,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev)
 {
 	struct mtd_info *mtd = platform_get_drvdata(pdev);
 	struct pxa3xx_nand_info *info = mtd->priv;
+	struct resource *r;
 
 	platform_set_drvdata(pdev, NULL);
 
@@ -1199,6 +1201,14 @@ static int pxa3xx_nand_remove(struct platform_device *pdev)
 				info->data_buff, info->data_buff_phys);
 	} else
 		kfree(info->data_buff);
+
+	iounmap(info->mmio_base);
+	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	release_mem_region(r->start, resource_size(r));
+
+	clk_disable(info->clk);
+	clk_put(info->clk);
+
 	kfree(mtd);
 	return 0;
 }
Signature · 1 line
1.5.6.4
#3 lore raw

PATCH 1/1 MTD: NAND: pxa3xx_nand: add ability to keep controller settings defined by OBM/bootloader

In reply to Mike Rapoport
---
 arch/arm/mach-pxa/include/mach/pxa3xx_nand.h |    3 +
 drivers/mtd/nand/pxa3xx_nand.c               |  103 +++++++++++++++++++++++++-
 2 files changed, 105 insertions(+), 1 deletions(-)
arch/arm/mach-pxa/include/mach/pxa3xx_nand.h +3 -0
index eb35fca..3478eae 100644
@@ -49,6 +49,9 @@ struct pxa3xx_nand_platform_data {
 	 */
 	int	enable_arbiter;
 
+	/* allow platform code to keep OBM/bootloader defined NFC config */
+	int	keep_config;
+
 	const struct mtd_partition		*parts;
 	unsigned int				nr_parts;
 
drivers/mtd/nand/pxa3xx_nand.c +102 -1

136 lines not on this page · raw message

Signature · 1 line
1.5.6.4