static int gport_disconnect(struct f_gser *gser)
{
	unsigned port_num;

	pr_debug("%s: transport: %s f_gser: %p gserial: %p port_num: %d\n",
			__func__, xport_to_str(gser->transport),
			gser, &gser->port, gser->port_num);

	port_num = gserial_ports[gser->port_num].client_port_num;

	switch (gser->transport) {
	case USB_GADGET_XPORT_TTY:
		gserial_disconnect(&gser->port);
		break;
	case USB_GADGET_XPORT_SDIO:
		gsdio_disconnect(&gser->port, port_num);
		break;
	case USB_GADGET_XPORT_SMD:
		gsmd_disconnect(&gser->port, port_num);
		break;
	case USB_GADGET_XPORT_HSIC:
		ghsic_ctrl_disconnect(&gser->port, port_num);
		ghsic_data_disconnect(&gser->port, port_num);
		break;
	case USB_GADGET_XPORT_HSUART:
		ghsuart_data_disconnect(&gser->port, port_num);
		break;
	default:
		pr_err("%s: Un-supported transport:%s\n", __func__,
				xport_to_str(gser->transport));
		return -ENODEV;
	}

	return 0;
}
Exemple #2
0
static int gport_disconnect(struct f_gser *gser)
{
	unsigned port_num;

	pr_debug("daniel.kang %s: transport:%s f_gser:%p gserial:%p port_num:%d\n",
			__func__, transport_to_str(gser->transport),
			gser, &gser->port, gser->port_num);

	port_num = gserial_ports[gser->port_num].client_port_num;

	switch (gser->transport) {
	case USB_GADGET_FSERIAL_TRANSPORT_TTY:
		gserial_disconnect(&gser->port);
		break;
	case USB_GADGET_FSERIAL_TRANSPORT_SDIO:
		gsdio_disconnect(&gser->port, port_num);
		break;
	case USB_GADGET_FSERIAL_TRANSPORT_SMD:
		gsmd_disconnect(&gser->port, port_num);
		break;
	default:
		pr_err("%s: Un-supported transport:%s\n", __func__,
				transport_to_str(gser->transport));
		return -ENODEV;
	}

	return 0;
}