Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299138
b: refs/heads/master
c: 891a3b1
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Apr 9, 2012
1 parent 67f5ae2 commit 49c6430
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 35 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: 3a450850e2bb0f92cacb12da90fe98eccd105468
refs/heads/master: 891a3b1fddb24b4b53426685bd0390bb74c9b5b3
5 changes: 0 additions & 5 deletions trunk/drivers/usb/serial/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ static int usb_serial_device_probe(struct device *dev)
retval = -ENODEV;
goto exit;
}
if (port->dev_state != PORT_REGISTERING)
goto exit;

driver = port->serial->type;
if (driver->port_probe) {
Expand Down Expand Up @@ -98,9 +96,6 @@ static int usb_serial_device_remove(struct device *dev)
if (!port)
return -ENODEV;

if (port->dev_state != PORT_UNREGISTERING)
return retval;

device_remove_file(&port->dev, &dev_attr_port_number);

driver = port->serial->type;
Expand Down
23 changes: 2 additions & 21 deletions trunk/drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,17 +1070,12 @@ int usb_serial_probe(struct usb_interface *interface,
port = serial->port[i];
dev_set_name(&port->dev, "ttyUSB%d", port->number);
dbg ("%s - registering %s", __func__, dev_name(&port->dev));
port->dev_state = PORT_REGISTERING;
device_enable_async_suspend(&port->dev);

retval = device_add(&port->dev);
if (retval) {
if (retval)
dev_err(&port->dev, "Error registering port device, "
"continuing\n");
port->dev_state = PORT_UNREGISTERED;
} else {
port->dev_state = PORT_REGISTERED;
}
}

usb_serial_console_init(debug, minor);
Expand Down Expand Up @@ -1124,22 +1119,8 @@ void usb_serial_disconnect(struct usb_interface *interface)
}
kill_traffic(port);
cancel_work_sync(&port->work);
if (port->dev_state == PORT_REGISTERED) {

/* Make sure the port is bound so that the
* driver's port_remove method is called.
*/
if (!port->dev.driver) {
int rc;

port->dev.driver =
&serial->type->driver;
rc = device_bind_driver(&port->dev);
}
port->dev_state = PORT_UNREGISTERING;
if (device_is_registered(&port->dev))
device_del(&port->dev);
port->dev_state = PORT_UNREGISTERED;
}
}
}
serial->type->disconnect(serial);
Expand Down
8 changes: 0 additions & 8 deletions trunk/include/linux/usb/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
/* parity check flag */
#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))

enum port_dev_state {
PORT_UNREGISTERED,
PORT_REGISTERING,
PORT_REGISTERED,
PORT_UNREGISTERING,
};

/* USB serial flags */
#define USB_SERIAL_WRITE_BUSY 0

Expand Down Expand Up @@ -124,7 +117,6 @@ struct usb_serial_port {
char throttle_req;
unsigned long sysrq; /* sysrq timeout */
struct device dev;
enum port_dev_state dev_state;
};
#define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev)

Expand Down

0 comments on commit 49c6430

Please sign in to comment.