Skip to content

Commit

Permalink
[ARM] 5446/1: ohci-at91: Limit vbus_pin assignment to the size of the…
Browse files Browse the repository at this point in the history
… array

Currently, the vbus_pin assignment loop is limited by the value of the "ports"
variable in the platform data.  Now that the vbus_pin array is no longer
flexible, we can use its actual size.

Signed-off-by: Justin Waters <justin.waters@timesys.com>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Justin Waters authored and Russell King committed Apr 8, 2009
1 parent d0176f6 commit 3d6fdf7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/host/ohci-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
* are always powered while this driver is active, and use
* active-low power switches.
*/
for (i = 0; i < pdata->ports; i++) {
for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
if (pdata->vbus_pin[i] <= 0)
continue;
gpio_request(pdata->vbus_pin[i], "ohci_vbus");
Expand All @@ -298,7 +298,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
int i;

if (pdata) {
for (i = 0; i < pdata->ports; i++) {
for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
if (pdata->vbus_pin[i] <= 0)
continue;
gpio_direction_output(pdata->vbus_pin[i], 1);
Expand Down

0 comments on commit 3d6fdf7

Please sign in to comment.