Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752958AbdFMGwz (ORCPT ); Tue, 13 Jun 2017 02:52:55 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:33495 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752733AbdFMGwx (ORCPT ); Tue, 13 Jun 2017 02:52:53 -0400 From: Tal Shorer To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, balbi@kernel.org, corbet@lwn.net Cc: Tal Shorer Subject: [PATCH v2 5/8] usb: gadget: f_acm: initialize port_line_coding when creating an instance Date: Tue, 13 Jun 2017 09:52:11 +0300 Message-Id: <1497336734-19368-6-git-send-email-tal.shorer@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497336734-19368-1-git-send-email-tal.shorer@gmail.com> References: <1497336734-19368-1-git-send-email-tal.shorer@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1014 Lines: 28 Initialize acm->port_line_coding with something that makes sense so that we can return a valid line coding if the host requests GetLineCoding before requesting SetLineCoding Signed-off-by: Tal Shorer --- drivers/usb/gadget/function/f_acm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c index e023313..188d314 100644 --- a/drivers/usb/gadget/function/f_acm.c +++ b/drivers/usb/gadget/function/f_acm.c @@ -763,6 +763,12 @@ static struct usb_function *acm_alloc_func(struct usb_function_instance *fi) acm->port.func.unbind = acm_unbind; acm->port.func.free_func = acm_free_func; + /* initialize port_line_coding with something that makes sense */ + acm->port_line_coding.dwDTERate = cpu_to_le32(9600); + acm->port_line_coding.bCharFormat = USB_CDC_1_STOP_BITS; + acm->port_line_coding.bParityType = USB_CDC_NO_PARITY; + acm->port_line_coding.bDataBits = 8; + return &acm->port.func; } -- 2.7.4