From c4ed4ac198495895fd1620cba15184c3b2d399dc Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Sun, 23 Dec 2012 21:10:18 +0100 Subject: usb: gadget: push tty port allocation from gadget into f_acm It possible to allocate the tty port number within the "instance" structure of the function and there is no need to expose this information within the gadget and therefore it is removed here. This patch converts only f_acm and all its users. The other gadgets will follow once the function is converted to the function interface. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Felipe Balbi --- drivers/usb/gadget/cdc2.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'drivers/usb/gadget/cdc2.c') diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c index 61023aae9865..c6ee6f1558c3 100644 --- a/drivers/usb/gadget/cdc2.c +++ b/drivers/usb/gadget/cdc2.c @@ -108,13 +108,11 @@ static struct eth_dev *the_dev; static struct usb_function *f_acm; static struct usb_function_instance *fi_serial; -static unsigned char tty_line; /* * We _always_ have both CDC ECM and CDC ACM functions. */ static int __init cdc_do_config(struct usb_configuration *c) { - struct f_serial_opts *opts; int status; if (gadget_is_otg(c->cdev->gadget)) { @@ -130,9 +128,6 @@ static int __init cdc_do_config(struct usb_configuration *c) if (IS_ERR(fi_serial)) return PTR_ERR(fi_serial); - opts = container_of(fi_serial, struct f_serial_opts, func_inst); - opts->port_num = tty_line; - f_acm = usb_get_function(fi_serial); if (IS_ERR(f_acm)) goto err_func_acm; @@ -173,11 +168,6 @@ static int __init cdc_bind(struct usb_composite_dev *cdev) if (IS_ERR(the_dev)) return PTR_ERR(the_dev); - /* set up serial link layer */ - status = gserial_alloc_line(&tty_line); - if (status < 0) - goto fail0; - /* Allocate string descriptor numbers ... note that string * contents can be overridden by the composite_dev glue. */ @@ -200,8 +190,6 @@ static int __init cdc_bind(struct usb_composite_dev *cdev) return 0; fail1: - gserial_free_line(tty_line); -fail0: gether_cleanup(the_dev); return status; } @@ -210,7 +198,6 @@ static int __exit cdc_unbind(struct usb_composite_dev *cdev) { usb_put_function(f_acm); usb_put_function_instance(fi_serial); - gserial_free_line(tty_line); gether_cleanup(the_dev); return 0; } -- cgit v1.2.3