aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Waters <justin.waters@timesys.com>2009-04-03 16:03:59 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-04-08 15:36:16 -0400
commitd0176f612f5c3edca00b9d0cc65555ad34843ec7 (patch)
tree10ce61783c3a53db00e82299762b090c72a96df5
parent8bd239d2ef00ed3319bf7384acd19c8253f0bb68 (diff)
[ARM] 5445/1: AT91: Remove flexible array from USBH platform data
The flexible array in the USBH platform data is not safe to copy. The compiler will not allocate any extra memory for the non-init platform data structure (in the *_devices.c files) since it isn't given any defaults at compile time. When the probe function attempts to address that array, it will actually attempt to access data in an adjacent structure. Since there are currently no (known) implementations of the at91 USBH IP with more than 2 vbus pins, I am capping the value at 2. If somebody tries to assign more, then the compiler will produce a warning. Signed-off-by: Justin Waters <justin.waters@timesys.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-at91/include/mach/board.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index 793fe7b25f36..e6afff849b85 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -87,7 +87,7 @@ extern void __init at91_add_device_eth(struct at91_eth_data *data);
87 /* USB Host */ 87 /* USB Host */
88struct at91_usbh_data { 88struct at91_usbh_data {
89 u8 ports; /* number of ports on root hub */ 89 u8 ports; /* number of ports on root hub */
90 u8 vbus_pin[]; /* port power-control pin */ 90 u8 vbus_pin[2]; /* port power-control pin */
91}; 91};
92extern void __init at91_add_device_usbh(struct at91_usbh_data *data); 92extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
93 93