OMAP: fix compilation error
Subsystems (2)
PATCH 1/1 OMAP: fix compilation error
Include <linux/platform_device.h> from arch/arm/plat-omap/include/plat/flash.h, otherwise compilation may break with:
In file included from arch/arm/mach-omap1/flash.c:15:arch/arm/plat-omap/include/plat/flash.h:14: warning: 'struct platform_device' declared inside parameter list arch/arm/plat-omap/include/plat/flash.h:14: warning: its scope is only this definition or declaration, which is probably not what you want arch/arm/mach-omap1/flash.c:16: warning: 'struct platform_device' declared inside parameter list arch/arm/mach-omap1/flash.c:17: error: conflicting types for 'omap1_set_vpp' arch/arm/plat-omap/include/plat/flash.h:14: error: previous declaration of 'omap1_set_vpp' was here
Detected and corrected while building for Amstrad Delta, confirmed with omap1_defconfig.
--- arch/arm/plat-omap/include/plat/flash.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/plat-omap/include/plat/flash.h renamed from arch/arm/plat-omap/include/plat/flash.h.orig +1 -0
@@ -10,6 +10,7 @@#define __OMAP_FLASH_H#include <linux/mtd/map.h> +#include <linux/platform_device.h> extern void omap1_set_vpp (struct platform_device *pdev,int enable);
PATCH 1/1 OMAP: fix compilation error
Quoted 10 lines · Janusz Krzysztofik
Include <
linux/platform_device.h> fromarch/arm/plat-omap/include/plat/flash.h, otherwise compilation may break with:In file included from
arch/arm/mach-omap1/flash.c:15:arch/arm/plat-omap/include/plat/flash.h:14: warning: 'structplatform_device' declared inside parameter listarch/arm/plat-omap/include/plat/flash.h:14: warning: its scope is only this definition or declaration, which is probably not what you wantarch/arm/mach-omap1/flash.c:16: warning: 'structplatform_device' declared inside parameter listarch/arm/mach-omap1/flash.c:17: error: conflicting types for 'omap1_set_vpp'arch/arm/plat-omap/include/plat/flash.h:14: error: previous declaration of 'omap1_set_vpp' was here
Just forward-declare the struct by adding:
struct platform_device;
in this header; there's no need to add to the complexities of header file inclusion...
PATCH v2 1/1 OMAP: fix compilation error
Forward-declare platform_device structure in arch/arm/plat-omap/include/plat/flash.h, otherwise compilation may break with:
In file included from arch/arm/mach-omap1/flash.c:15:arch/arm/plat-omap/include/plat/flash.h:14: warning: 'struct platform_device' declared inside parameter list arch/arm/plat-omap/include/plat/flash.h:14: warning: its scope is only this definition or declaration, which is probably not what you want arch/arm/mach-omap1/flash.c:16: warning: 'struct platform_device' declared inside parameter list arch/arm/mach-omap1/flash.c:17: error: conflicting types for 'omap1_set_vpp' arch/arm/plat-omap/include/plat/flash.h:14: error: previous declaration of 'omap1_set_vpp' was here
Detected and corrected while building for Amstrad Delta, confirmed with omap1_defconfig.
---
v1 -> v2 change requested by Russell King (thanks!):
- no need to add to the complexities of header file inclusion
arch/arm/plat-omap/include/plat/flash.h | 1 + 1 file changed, 1 insertion(+)
arch/arm/plat-omap/include/plat/flash.h renamed from arch/arm/plat-omap/include/plat/flash.h.orig +1 -0
@@ -11,6 +11,7 @@#include <linux/mtd/map.h> +struct platform_device ;extern void omap1_set_vpp (struct platform_device *pdev,int enable);#endif
PATCH v2 1/1 OMAP: fix compilation error
Quoted 3 lines · Janusz Krzysztofik
Detected and corrected while building for Amstrad Delta, confirmed with
omap1_defconfig.
Thanks, will queue this fix.
Tony