提交 d0176f61 编写于 作者: J Justin Waters 提交者: Russell King

[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: NJustin Waters <justin.waters@timesys.com>
Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Acked-by: NAndrew Victor <linux@maxim.org.za>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 8bd239d2
...@@ -87,7 +87,7 @@ extern void __init at91_add_device_eth(struct at91_eth_data *data); ...@@ -87,7 +87,7 @@ extern void __init at91_add_device_eth(struct at91_eth_data *data);
/* USB Host */ /* USB Host */
struct at91_usbh_data { struct at91_usbh_data {
u8 ports; /* number of ports on root hub */ u8 ports; /* number of ports on root hub */
u8 vbus_pin[]; /* port power-control pin */ u8 vbus_pin[2]; /* port power-control pin */
}; };
extern void __init at91_add_device_usbh(struct at91_usbh_data *data); extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册