From 00b040deca907a113f5bef67a6cc7a4f65a5ace9 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 11 Jun 2009 14:29:29 +0100 Subject: [PATCH] tty: resolve some sierra breakage The various merges into the sierra driver inadvertently undid commit 212b8f0c3f5a2280bfa1d6ab13a6fe98552becaa by Elina Pasheva . Put it back so the OBEX port works again. Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/usb/serial/sierra.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 1319b8968d8..222a6230276 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -257,8 +257,19 @@ static int sierra_send_setup(struct usb_serial_port *port) val |= 0x02; /* If composite device then properly report interface */ - if (serial->num_ports == 1) + if (serial->num_ports == 1) { interface = sierra_calc_interface(serial); + /* Control message is sent only to interfaces with + * interrupt_in endpoints + */ + if (port->interrupt_in_urb) { + /* send control message */ + return usb_control_msg(serial->dev, + usb_rcvctrlpipe(serial->dev, 0), + 0x22, 0x21, val, interface, + NULL, 0, USB_CTRL_SET_TIMEOUT); + } + } /* Otherwise the need to do non-composite mapping */ else { @@ -268,11 +279,11 @@ static int sierra_send_setup(struct usb_serial_port *port) interface = 1; else if (port->bulk_out_endpointAddress == 5) interface = 2; - } - return usb_control_msg(serial->dev, + return usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 0x22, 0x21, val, interface, NULL, 0, USB_CTRL_SET_TIMEOUT); + } return 0; } -- 2.11.4.GIT