/* serio_disconnect_port() unbinds a port from its driver. As a side effect all child ports are unbound and destroyed.  */
static void serio_disconnect_port(struct serio *serio)
/* serio_disconnect_port() unbinds a port from its driver. As a side effect all child ports are unbound and destroyed.  */
static void serio_disconnect_port(struct serio *serio)
{
	struct serio *s, *parent;
	if (serio->child) {
		for (s = serio; s->child; s = s->child);
		do {
			parent = s->parent;
			device_release_driver(&s->dev);
			serio_destroy_port(s);
		} while ((s = parent) != serio);
	}
	device_release_driver(&serio->dev);
}