Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108425
b: refs/heads/master
c: 0282b7f
h: refs/heads/master
i:
  108423: be54a76
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Aug 14, 2008
1 parent c4a6657 commit cfdb2ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e67d70f2f55d90c79dcb384ad5b798f0f9a68085
refs/heads/master: 0282b7f2a874e72c18fcd5a112ccf67f71ba7f5c
7 changes: 3 additions & 4 deletions trunk/drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ static void return_serial(struct usb_serial *serial)

dbg("%s", __func__);

if (serial == NULL)
return;

for (i = 0; i < serial->num_ports; ++i)
serial_table[serial->minor + i] = NULL;
}
Expand All @@ -142,7 +139,8 @@ static void destroy_serial(struct kref *kref)
serial->type->shutdown(serial);

/* return the minor range that this device had */
return_serial(serial);
if (serial->minor != SERIAL_TTY_NO_MINOR)
return_serial(serial);

for (i = 0; i < serial->num_ports; ++i)
serial->port[i]->port.count = 0;
Expand Down Expand Up @@ -575,6 +573,7 @@ static struct usb_serial *create_serial(struct usb_device *dev,
serial->interface = interface;
kref_init(&serial->kref);
mutex_init(&serial->disc_mutex);
serial->minor = SERIAL_TTY_NO_MINOR;

return serial;
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/usb/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#include <linux/mutex.h>

#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
#define SERIAL_TTY_MINORS 255 /* loads of devices :) */
#define SERIAL_TTY_MINORS 254 /* loads of devices :) */
#define SERIAL_TTY_NO_MINOR 255 /* No minor was assigned */

/* The maximum number of ports one device can grab at once */
#define MAX_NUM_PORTS 8
Expand Down

0 comments on commit cfdb2ac

Please sign in to comment.