aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJustin Waters <justin.waters@timesys.com>2009-04-03 16:06:53 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-04-08 15:36:18 -0400
commit3d6fdf7563d0a67c6973cf421f7405524ed8bdaf (patch)
tree85a7e3357548930e06b161f24e14cc74b1f80aca /drivers
parentd0176f612f5c3edca00b9d0cc65555ad34843ec7 (diff)
[ARM] 5446/1: ohci-at91: Limit vbus_pin assignment to the size of the 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ohci-at91.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 4ed228a89943..bb5e6f671578 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -280,7 +280,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
280 * are always powered while this driver is active, and use 280 * are always powered while this driver is active, and use
281 * active-low power switches. 281 * active-low power switches.
282 */ 282 */
283 for (i = 0; i < pdata->ports; i++) { 283 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
284 if (pdata->vbus_pin[i] <= 0) 284 if (pdata->vbus_pin[i] <= 0)
285 continue; 285 continue;
286 gpio_request(pdata->vbus_pin[i], "ohci_vbus"); 286 gpio_request(pdata->vbus_pin[i], "ohci_vbus");
@@ -298,7 +298,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
298 int i; 298 int i;
299 299
300 if (pdata) { 300 if (pdata) {
301 for (i = 0; i < pdata->ports; i++) { 301 for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
302 if (pdata->vbus_pin[i] <= 0) 302 if (pdata->vbus_pin[i] <= 0)
303 continue; 303 continue;
304 gpio_direction_output(pdata->vbus_pin[i], 1); 304 gpio_direction_output(pdata->vbus_pin[i], 1);