[ARM] 5335/1: pxa25x_udc: Fix is_vbus_present to return 1 or 0

the use of is_blah() suggests a 1 or 0 return. This assumption is made in
pxa25x_udc code such as:
dev->vbus = is_vbus_present();
where dev->vbus is a bitfield. This fix allows pxa25x_udc_probe to correctly
detect vbus. Other changes were to make its use consistent in the rest of
the code.

Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Jaya Kumar and committed by Russell King 47fd6f7c 844c6f6a

+7 -7
+7 -7
drivers/usb/gadget/pxa25x_udc.c
··· 141 141 142 142 if (mach->gpio_vbus) { 143 143 int value = gpio_get_value(mach->gpio_vbus); 144 - return mach->gpio_vbus_inverted ? !value : value; 144 + 145 + if (mach->gpio_vbus_inverted) 146 + return !value; 147 + else 148 + return !!value; 145 149 } 146 150 if (mach->udc_is_connected) 147 151 return mach->udc_is_connected(); ··· 986 982 struct pxa25x_udc *udc; 987 983 988 984 udc = container_of(_gadget, struct pxa25x_udc, gadget); 989 - udc->vbus = (is_active != 0); 985 + udc->vbus = is_active; 990 986 DMSG("vbus %s\n", is_active ? "supplied" : "inactive"); 991 987 pullup(udc); 992 988 return 0; ··· 1403 1399 static irqreturn_t udc_vbus_irq(int irq, void *_dev) 1404 1400 { 1405 1401 struct pxa25x_udc *dev = _dev; 1406 - int vbus = gpio_get_value(dev->mach->gpio_vbus); 1407 1402 1408 - if (dev->mach->gpio_vbus_inverted) 1409 - vbus = !vbus; 1410 - 1411 - pxa25x_udc_vbus_session(&dev->gadget, vbus); 1403 + pxa25x_udc_vbus_session(&dev->gadget, is_vbus_present()); 1412 1404 return IRQ_HANDLED; 1413 1405 } 1414 1406