Skip to content

Commit

Permalink
usb_gadget: composite cdc gadget fault handling
Browse files Browse the repository at this point in the history
These two fixes ensure the new "CDC Composite Device" gadget
fails cleanly when it's loaded on hardware that can't support
this particular gadget driver.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent c24f422 commit ac90e36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/cdc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static int __init cdc_do_config(struct usb_configuration *c)
return status;

status = acm_bind_config(c, 0);
if (status == 0)
if (status < 0)
return status;

return 0;
Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/gadget/u_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,9 @@ void gserial_cleanup(void)
unsigned i;
struct gs_port *port;

if (!gs_tty_driver)
return;

/* start sysfs and /dev/ttyGS* node removal */
for (i = 0; i < n_ports; i++)
tty_unregister_device(gs_tty_driver, i);
Expand Down

0 comments on commit ac90e36

Please sign in to comment.