Skip to contentSkip to conversation

ARM: omap1: add nand_chip declaration

PATCH Superseded Arnd Bergmann 3 participants 6 messages Sep 26, 2018 – Oct 5, 2018

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: omap1: add nand_chip declaration

Recent MTD changes caused a minor build regression on OMAP1:

In file included from arch/arm/mach-omap1/devices.c:31:
arch/arm/mach-omap1/common.h:85:39: error: 'struct nand_chip' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

Fixes 1002aed789bc ("mtd: rawnand: plat_nand: Pass a nand_chip object to all platform_nand_ctrl hooks")
---
 arch/arm/mach-omap1/common.h | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-omap1/common.h +1 -0
index 11b87a4c84d4..82f2c065040a 100644
@@ -82,6 +82,7 @@ void omap1_restart(enum reboot_mode, const char *);
 
 extern void __init omap_check_revision(void);
 
+struct nand_chip;
 extern void omap1_nand_cmd_ctl(struct nand_chip *this, int cmd,
 			       unsigned int ctrl);
 
Signature · 1 line
2.18.0
#1 lore raw

PATCH 2/2 ARM: ixp4xx: include linux/mtd/platnand.h

The platform_nand_data structure definition is required for ixdp425 but has now moved to a new header file:

arch/arm/mach-ixp4xx/ixdp425-setup.c:98:15: error: variable 'ixdp425_flash_nand_data' has initializer but incomplete type

 static struct platform_nand_data ixdp425_flash_nand_data = {
               ^~~~~~~~~~~~~~~~~~

arch/arm/mach-ixp4xx/ixdp425-setup.c:99:3: error: 'struct platform_nand_data' has no member named 'chip'

Fixes 19cf5dfa3a31 ("mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h")
---
 arch/arm/mach-ixp4xx/ixdp425-setup.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-ixp4xx/ixdp425-setup.c +1 -0
index 797e7edc7124..57d7df79d838 100644
@@ -20,6 +20,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/platnand.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
 #include <asm/types.h>
Signature · 1 line
2.18.0
maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ARM: ixp4xx: include linux/mtd/platnand.h

Hi Arnd,

Arnd Bergmann <[email protected]> wrote on Wed, 26 Sep 2018 15:04:39 +0200:

Quoted 11 lines

The platform_nand_data structure definition is required for ixdp425 but has now moved to a new header file:

arch/arm/mach-ixp4xx/ixdp425-setup.c:98:15: error: variable 'ixdp425_flash_nand_data' has initializer but incomplete type

 static struct platform_nand_data ixdp425_flash_nand_data = {
               ^~~~~~~~~~~~~~~~~~

arch/arm/mach-ixp4xx/ixdp425-setup.c:99:3: error: 'struct platform_nand_data' has no member named 'chip'

Fixes 19cf5dfa3a31 ("mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h")

---

Thanks,
Miqu?l

Acked-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] ARM: ixp4xx: include linux/mtd/platnand.h

In reply to Arnd Bergmann
Quoted 4 lines · Arnd Bergmann

The platform_nand_data structure definition is required for ixdp425 but has now moved to a new header file:

arch/arm/mach-ixp4xx/ixdp425-setup.c:98:15: error: variable 'ixdp425_flash_nand_data' has initializer but incomplete type

Quoted 8 lines
 static struct platform_nand_data ixdp425_flash_nand_data = {
               ^~~~~~~~~~~~~~~~~~

arch/arm/mach-ixp4xx/ixdp425-setup.c:99:3: error: 'struct platform_nand_data' has no member named 'chip'

Fixes 19cf5dfa3a31 ("mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h")
---
 arch/arm/mach-ixp4xx/ixdp425-setup.c | 1 +

Right.

Signature · 4 lines
Krzysztof Halasa

Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
maintainer
#4 lore raw

Re: [PATCH 2/2] ARM: ixp4xx: include linux/mtd/platnand.h

In reply to Arnd Bergmann

Hi Arnd,

Arnd Bergmann <[email protected]> wrote on Wed, 26 Sep 2018 15:04:39 +0200:

Quoted 11 lines

The platform_nand_data structure definition is required for ixdp425 but has now moved to a new header file:

arch/arm/mach-ixp4xx/ixdp425-setup.c:98:15: error: variable 'ixdp425_flash_nand_data' has initializer but incomplete type

 static struct platform_nand_data ixdp425_flash_nand_data = {
               ^~~~~~~~~~~~~~~~~~

arch/arm/mach-ixp4xx/ixdp425-setup.c:99:3: error: 'struct platform_nand_data' has no member named 'chip'

Fixes 19cf5dfa3a31 ("mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h")

---

Sorry for the delay, squashed in nand/next with the commit introducing the regression.

Thanks,
Miqu?l

maintainer
#5 lore raw
In reply to Arnd Bergmann

Hi Arnd,

Thanks for the fix, sorry for breaking the build.

Arnd Bergmann <[email protected]> wrote on Wed, 26 Sep 2018 15:04:38 +0200:

Quoted 16 lines

Recent MTD changes caused a minor build regression on OMAP1:

In file included from arch/arm/mach-omap1/devices.c:31:
arch/arm/mach-omap1/common.h:85:39: error: 'struct nand_chip' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

Fixes 1002aed789bc ("mtd: rawnand: plat_nand: Pass a nand_chip object to all platform_nand_ctrl hooks")
---
 arch/arm/mach-omap1/common.h | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-omap1/common.h +0 -0
index 11b87a4c84d4..82f2c065040a 100644

arch/arm/mach-omap1/common.h void omap1_restart(enum reboot_mode, const char *); · line 88

Quoted 7 lines
arch/arm/mach-omap1/common.h +1 -0
@@ -82,6 +82,7 @@ void omap1_restart(enum reboot_mode, const char *);
 
 extern void __init omap_check_revision(void);
 
+struct nand_chip;
 extern void omap1_nand_cmd_ctl(struct nand_chip *this, int cmd,
 			       unsigned int ctrl);
 

Currently I see "#include <linux/mtd/mtd.h>" at the top of this file. That's where the "struct mtd_info" that has been replaced by a "struct nand_chip" was declared. The nand_chip object is declared in <linux/mtd/rawnand.h>.

I think you can remove this include (unneeded anymore for what I see). Then, either you keep the nand_chip forward declaration, or replace the mtd.h include into the rawnand.h one?

Thanks,
Miqu?l