From patchwork Fri Jan 4 11:21:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154767 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp511979ljp; Fri, 4 Jan 2019 03:22:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN4kajl8ZvxXMWP7zIql8QWkbmm8uJKDVrqb38fIUTMV0UgR21InwEoSgG0QWVch38/8nTth X-Received: by 2002:a63:f552:: with SMTP id e18mr20549733pgk.239.1546600922974; Fri, 04 Jan 2019 03:22:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546600922; cv=none; d=google.com; s=arc-20160816; b=HL5UpT02nQBadUE2T2WktWx6F33QxBe4y8nNn/pyiVn8EBNp48yKw0YVGIlU+8lGf2 NGpdqZyDRgqtR6yHdlMNXmjhgmDNiF55PqXtYZcZxscls+eTmQ4Ftm1H7yaANmukPDGF BuTv1Jw3KILaH2x0ZqBuDI2c0fNRTzY5HfAN6ZzvYjpEt7u6F/S7CeYIyZh1Pyynp9zI Wq7zopZSOs3J+5D9MAHVec1qsio9XdQyuibBx1DzoQklWeF3xSWHvD3exAtSZlWIp2FX crtVBN1HFd7rnbqUb657TpHVbsN0XVgYpH2PC+k5JdtLr7po67Gb7X9AZBBCY7z24H8x /pmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tTyqZ20O8FQUkV8erR6c7WaxlzoCOfqtB7c/KCXbIv8=; b=sb+n7r6zBAa3lpQtaHUr5ZUlDF4BwETQcj5AD8cMkcoOU/YGAysuNt8+WXriZyWubW B2jEPvXvxV8UPUyTernSiCbS4wea0uLfRMcaVxuktD8tGP3AMHorsMKnNpm7il/q5E9R kubI+IqOO+3b8Kq+KRueKogHwzrAWIjRQ77Si/8kit2Mvtng4CmDkk35qjnYhKucDTbV PBzsw/17ook7ye69hMC4X+g2kpnrkHIeBbiOkn012jf6SRop3alvP/4TvkkF2/wFfYYu zLSbpIGwVc2ZlE9jjfTnOtxBkDTHW/5azHzvQztIvkVNpYb5uRzAtz5ZOPnStYvYULoL Q9Yg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si9684376pls.71.2019.01.04.03.22.02; Fri, 04 Jan 2019 03:22:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728176AbfADLWB (ORCPT + 5 others); Fri, 4 Jan 2019 06:22:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:52488 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727706AbfADLVr (ORCPT ); Fri, 4 Jan 2019 06:21:47 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4E5EEAEB4; Fri, 4 Jan 2019 11:21:45 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org, linux-serial@vger.kernel.org Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Rob Herring , =?utf-8?q?Andreas_F=C3=A4rber?= , Oliver Neukum , Greg Kroah-Hartman Subject: [PATCH RFC 4/5] usb: cdc-acm: Enable serdev support Date: Fri, 4 Jan 2019 12:21:30 +0100 Message-Id: <20190104112131.14451-5-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190104112131.14451-1-afaerber@suse.de> References: <20190104112131.14451-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Switch from tty_port_register_device() to tty_port_register_device_serdev() and from tty_unregister_device() to tty_port_unregister_device(). On removal of a serdev driver sometimes count mismatch warnings were seen: ttyACM ttyACM0: tty_hangup: tty->count(1) != (#fd's(0) + #kopen's(0)) ttyACM ttyACM0: tty_port_close_start: tty->count = 1 port count = 0 Note: The serdev drivers appear to probe asynchronously as soon as they are registered. Should the USB quirks in probe be moved before registration? No noticeable difference for the devices at hand. Cc: Rob Herring Cc: Johan Hovold Signed-off-by: Andreas Färber --- drivers/usb/class/cdc-acm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.16.4 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index ed8c62b2d9d1..c225a586c524 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1460,7 +1460,7 @@ static int acm_probe(struct usb_interface *intf, usb_set_intfdata(data_interface, acm); usb_get_intf(control_interface); - tty_dev = tty_port_register_device(&acm->port, acm_tty_driver, minor, + tty_dev = tty_port_register_device_serdev(&acm->port, acm_tty_driver, minor, &control_interface->dev); if (IS_ERR(tty_dev)) { rv = PTR_ERR(tty_dev); @@ -1534,7 +1534,7 @@ static void acm_disconnect(struct usb_interface *intf) acm_kill_urbs(acm); cancel_work_sync(&acm->work); - tty_unregister_device(acm_tty_driver, acm->minor); + tty_port_unregister_device(&acm->port, acm_tty_driver, acm->minor); usb_free_urb(acm->ctrlurb); for (i = 0; i < ACM_NW; i++)