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

[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: NJustin Waters <justin.waters@timesys.com>
Acked-by: NAndrew Victor <linux@maxim.org.za>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 d0176f61
...@@ -280,7 +280,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) ...@@ -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 * are always powered while this driver is active, and use
* active-low power switches. * 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) if (pdata->vbus_pin[i] <= 0)
continue; continue;
gpio_request(pdata->vbus_pin[i], "ohci_vbus"); gpio_request(pdata->vbus_pin[i], "ohci_vbus");
...@@ -298,7 +298,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev) ...@@ -298,7 +298,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
int i; int i;
if (pdata) { 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) if (pdata->vbus_pin[i] <= 0)
continue; continue;
gpio_direction_output(pdata->vbus_pin[i], 1); gpio_direction_output(pdata->vbus_pin[i], 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册