Skip to content

Commit

Permalink
USB: gadget: pxa25x_udc vbus sense initialization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Jan 7, 2009
1 parent c48a515 commit b40fc2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/pxa25x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b40fc2a

Please sign in to comment.