Patchwork [3/3,v2,MTD,NAND] pxa3xx_nand.c: Fix compilation without MTD partitioning support

login
register
mail settings
Submitter Marcel Ziswiler
Date Jan. 8, 2009, 10:38 p.m.
Message ID <1231454336-4430-4-git-send-email-marcel@ziswiler.com>
Download mbox | patch
Permalink /patch/17466/
State New, archived
Headers show

Comments

Marcel Ziswiler - Jan. 8, 2009, 10:38 p.m.
This fixes compilation without MTD partitioning support previously failing.

Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@noser.com>
---
 drivers/mtd/nand/pxa3xx_nand.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 45122ab..04ba7be 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1161,7 +1161,10 @@  static int pxa3xx_nand_probe(struct platform_device *pdev)
 		goto fail_free_irq;
 	}
 
-	return add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
+#ifdef CONFIG_MTD_PARTITIONS
+	ret = add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
+#endif
+	return ret;
 
 fail_free_irq:
 	free_irq(IRQ_NAND, info);
@@ -1192,7 +1195,9 @@  static int pxa3xx_nand_remove(struct platform_device *pdev)
 	platform_set_drvdata(pdev, NULL);
 
 	del_mtd_device(mtd);
+#ifdef CONFIG_MTD_PARTITIONS
 	del_mtd_partitions(mtd);
+#endif
 	free_irq(IRQ_NAND, info);
 	if (use_dma) {
 		pxa_free_dma(info->data_dma_ch);