summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFrancesco Lavra <francescolavra@interfree.it>2009-12-08 09:54:11 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 14:53:07 -0800
commita91b0c502285fd0c569fae1222fdd945ef739233 (patch)
treeb8aa93dca7ff9f2c7a7764cd6c9820e1570ed8d7 /drivers
parentaf2ac1a091bc8bee73d7837b73ebfb00b917aece (diff)
downloadop-kernel-dev-a91b0c502285fd0c569fae1222fdd945ef739233.zip
op-kernel-dev-a91b0c502285fd0c569fae1222fdd945ef739233.tar.gz
cdc_acm: add reset_resume method
Add reset resume logic to the cdc acm driver Signed-off-by: Francesco Lavra <francescolavra@interfree.it> Acked-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/class/cdc-acm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 34d4eb9..ef2e6f9 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1460,6 +1460,23 @@ err_out:
return rv;
}
+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);
+}
+
#endif /* CONFIG_PM */
#define NOKIA_PCSUITE_ACM_INFO(x) \
@@ -1602,6 +1619,7 @@ static struct usb_driver acm_driver = {
#ifdef CONFIG_PM
.suspend = acm_suspend,
.resume = acm_resume,
+ .reset_resume = acm_reset_resume,
#endif
.id_table = acm_ids,
#ifdef CONFIG_PM
OpenPOWER on IntegriCloud