From 01b3a5e6bfd031735f3b4e8491485d88d366f001 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 12 Nov 2011 16:46:13 +0100 Subject: [PATCH] --- yaml --- r: 275823 b: refs/heads/master c: 770f0baaee0c511d0d466082e72815ed861e301f h: refs/heads/master i: 275821: de924c11455c27da213982a2497afc460d49fc67 275819: 3d2f5b9a01fdfe954d4246a35c84b41a56feb281 275815: c18c3301c581d2f3f55e68d93d69848bfcb3ad75 275807: 5667a066a305bccc0cd80443f1646126ebe29bb0 v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/ohci-at91.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e6ba9462831e..9700435c4455 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5dc2470c602da8851907ec18942cd876c3b4ecc1 +refs/heads/master: 770f0baaee0c511d0d466082e72815ed861e301f diff --git a/trunk/drivers/usb/host/ohci-at91.c b/trunk/drivers/usb/host/ohci-at91.c index ba3a46b78b75..95a9fec38e89 100644 --- a/trunk/drivers/usb/host/ohci-at91.c +++ b/trunk/drivers/usb/host/ohci-at91.c @@ -223,6 +223,9 @@ static void ohci_at91_usb_set_power(struct at91_usbh_data *pdata, int port, int if (port < 0 || port >= 2) return; + if (pdata->vbus_pin[port] <= 0) + return; + gpio_set_value(pdata->vbus_pin[port], !pdata->vbus_pin_inverted ^ enable); } @@ -231,6 +234,9 @@ static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port) if (port < 0 || port >= 2) return -EINVAL; + if (pdata->vbus_pin[port] <= 0) + return -EINVAL; + return gpio_get_value(pdata->vbus_pin[port]) ^ !pdata->vbus_pin_inverted; }