コード例 #1
0
static int acm_reset_resume(struct usb_interface *intf)
{
	struct acm *acm = usb_get_intfdata(intf);

	if (test_bit(ASYNCB_INITIALIZED, &acm->port.flags))
		tty_port_tty_hangup(&acm->port, false);

	return acm_resume(intf);
}
コード例 #2
0
ファイル: cdc-acm.c プロジェクト: 33d/linux-2.6.21-hh20
static int acm_reset_resume(struct usb_interface *intf)
{
	struct acm *acm = usb_get_intfdata(intf);
	struct tty_struct *tty;

	if (test_bit(ASYNCB_INITIALIZED, &acm->port.flags)) {
		tty = tty_port_tty_get(&acm->port);
		if (tty) {
			tty_hangup(tty);
			tty_kref_put(tty);
		}
	}

	return acm_resume(intf);
}
コード例 #3
0
static int acm_reset_resume(struct usb_interface *intf)
{
	struct acm *acm = usb_get_intfdata(intf);
	struct tty_struct *tty;

	mutex_lock(&acm->mutex);
	if (acm->port.count) {
		tty = tty_port_tty_get(&acm->port);
		if (tty) {
			tty_hangup(tty);
			tty_kref_put(tty);
		}
	}
	mutex_unlock(&acm->mutex);
	return acm_resume(intf);
}
コード例 #4
0
static int acm_reset_resume(struct usb_interface *intf)
{
	struct acm *acm = usb_get_intfdata(intf);
	struct tty_struct *tty;

	if (!acm) {
		pr_err("%s: !acm\n", __func__);
		return -ENODEV;
	}

	mutex_lock(&acm->mutex);
	if (acm->port.count) {
		tty = tty_port_tty_get(&acm->port);
		if (tty) {
			if (!acm->no_hangup_in_reset_resume)
				tty_hangup(tty);
			tty_kref_put(tty);
		}
	}
	mutex_unlock(&acm->mutex);
	return acm_resume(intf);
}