]> git.baikalelectronics.ru Git - kernel.git/commit
[ARM] 5445/1: AT91: Remove flexible array from USBH platform data
authorJustin Waters <justin.waters@timesys.com>
Fri, 3 Apr 2009 20:03:59 +0000 (21:03 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 8 Apr 2009 19:36:16 +0000 (20:36 +0100)
commit2ed0683ec39f79e304e5e317f34047449286e09c
tree10ce61783c3a53db00e82299762b090c72a96df5
parentc3913c3cb2f42922113dcb59a3c9397fe251f386
[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>
arch/arm/mach-at91/include/mach/board.h