Skip to contentSkip to conversation

ARM: pxa3xx: fix build error when CONFIG_MTD_PARTITIONS is not defined

PATCH New Mark F. Brown 3 participants 5 messages Aug 26, 2010 – Sep 1, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: pxa3xx: fix build error when CONFIG_MTD_PARTITIONS is not defined

If CONFIG_MTD_PARTITIONS is not defined for pxa3xx NAND driver it will display a build error:

drivers/built-in.o: In function `pxa3xx_nand_remove':
drivers/mtd/nand/pxa3xx_nand.c:1367: undefined reference to del_mtd_partitions' drivers/built-in.o: In function pxa3xx_nand_probe':
drivers/mtd/nand/pxa3xx_nand.c:1334: undefined reference to `add_mtd_partitions'
make: *** [.tmp_vmlinux1] Error 1

Patched against Eric Miao's pxa tree

Mark F. Brown (1):
ARM: pxa3xx: fix build error when CONFIG_MTD_PARTITIONS is not
defined

 drivers/mtd/nand/pxa3xx_nand.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
#1 lore raw

PATCH 1/1 ARM: pxa3xx: fix build error when CONFIG_MTD_PARTITIONS is not defined

---
 drivers/mtd/nand/pxa3xx_nand.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/mtd/nand/pxa3xx_nand.c +6 -0
index 4d89f37..4d01cda 100644
@@ -1320,6 +1320,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 		goto fail_free_irq;
 	}
 
+#ifdef CONFIG_MTD_PARTITIONS
 	if (mtd_has_cmdlinepart()) {
 		static const char *probes[] = { "cmdlinepart", NULL };
 		struct mtd_partition *parts;
@@ -1332,6 +1333,9 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 	}
 
 	return add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
+#else
+	return 0;
+#endif
 
 fail_free_irq:
 	free_irq(irq, info);
@@ -1364,7 +1368,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
 	irq = platform_get_irq(pdev, 0);
 	if (irq >= 0)
 		free_irq(irq, info);
Signature · 1 line
1.7.0.4
#2 lore raw
Quoted 40 lines · Mark F. Brown

---
?drivers/mtd/nand/pxa3xx_nand.c | ? ?6 ++++++
?1 files changed, 6 insertions(+), 0 deletions(-)

drivers/mtd/nand/pxa3xx_nand.c +4 -0
index 4d89f37..4d01cda 100644
@@ -1320,6 +1320,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 ? ? ? ? ? ? ? ?goto fail_free_irq;
 ? ? ? ?}
 
+#ifdef CONFIG_MTD_PARTITIONS
 ? ? ? ?if (mtd_has_cmdlinepart()) {
 ? ? ? ? ? ? ? ?static const char *probes[] = { "cmdlinepart", NULL };
 ? ? ? ? ? ? ? ?struct mtd_partition *parts;
@@ -1332,6 +1333,9 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 ? ? ? ?}
 
 ? ? ? ?return add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
+#else
+ ? ? ? return 0;
+#endif
 

?fail_free_irq:
? ? ? ?free_irq(irq, info);

drivers/mtd/nand/pxa3xx_nand.c +2 -1
@@ -1364,7 +1368,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
 ? ? ? ?irq = platform_get_irq(pdev, 0);
 ? ? ? ?if (irq >= 0)
 ? ? ? ? ? ? ? ?free_irq(irq, info);
--

1.7.0.4

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html Please read the FAQ at ?http://www.tux.org/lkml/

Hi Mark,

Don't forget to cc maintainer of mtd tree. I loop them now.

Thanks
Haojian

#3 lore raw
Quoted 3 lines · Haojian Zhuang

Hi Mark,

Don't forget to cc maintainer of mtd tree. I loop them now.

FYI, the MTD maintainer id dwmw2, I'm just helping him sometimes.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (???????? ?????)