USB: gadget: pxa25x_udc vbus sense initialization
authorDavid Brownell <dbrownell@users.sourceforge.net>
Mon, 24 Nov 2008 19:43:30 +0000 (11:43 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 7 Jan 2009 18:00:02 +0000 (10:00 -0800)
Some code in the pxa25x_udc driver wrongly expects the value
of is_vbus_present() to be 0/1, not zero/nonzero ... cope.
Issue noted by Jaya Kumar <jayakumar.lkml@gmail.com>

This bug has been around since July 2007, and has a simple
workaround:  unplug the Linux gadget, then re-plug it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/pxa25x_udc.c

index 697a0ca349bf09b66cfadab7f87ffc1176e08b61..9b36205c5759d3d1f8cf11b8edeba1958d1371e1 100644 (file)
@@ -2198,7 +2198,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
        udc_disable(dev);
        udc_reinit(dev);
 
-       dev->vbus = is_vbus_present();
+       dev->vbus = !!is_vbus_present();
 
        /* irq setup after old hardware state is cleaned up */
        retval = request_irq(irq, pxa25x_udc_irq,