From patchwork Fri May 25 12:52:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10427377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 751306025B for ; Fri, 25 May 2018 12:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6040529183 for ; Fri, 25 May 2018 12:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53AB829194; Fri, 25 May 2018 12:55:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE3DF29183 for ; Fri, 25 May 2018 12:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933214AbeEYMy2 (ORCPT ); Fri, 25 May 2018 08:54:28 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36173 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752360AbeEYMxi (ORCPT ); Fri, 25 May 2018 08:53:38 -0400 Received: by mail-wr0-f193.google.com with SMTP id k5-v6so9067850wrn.3; Fri, 25 May 2018 05:53:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bktIdSFs7G5m5eV5u4NU4RleAeDHIY86pydO6mxO5YI=; b=pZToNEqw83tBthXw7bwauZL32NL/8WJ8Rn4IP6Cdv18MJ7tYHS1ngdLpaNtiwDDVk+ 7k86ytPrPFqih6K63UnOq9GFLA6zvvzVjKvkanaw4pjfcJge4RnGzJdVIXZ60S0CI0kx a4qreGAKQL5ccNWLiPNbMUMj/Ef0YIyXOGKfAV+SgljoHEXE9Cw3/M8Cn3d419Jj4thd t8uvUyq5jDTSUjU3FAuKUP6uFQAhMx4Dt2NIcquYn/0qk8fZFccg7uVzlMkyXydrwx3H I41WnC+hyX0xuwELf3RO5xvvcON6KLFBlPbAtYshes2lGvGpYc58fTatIDsqTjIf8Hfh xahQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bktIdSFs7G5m5eV5u4NU4RleAeDHIY86pydO6mxO5YI=; b=iqe5AjeagtF7dWnMD4kTcSd0Ls6ylxUxE4/pcGpW834JWJbV3aToG9O0Seat8Le2iD jpTfoiD2px8mdcgVs3/Clzg0Kg1W+81KmHCFG3JOhec3ddXW1n+rfknx5HtHKLaFNnZP LMcTyCyUBjDNkMFOI0ML4G5xQlpumzAU6MtgeC2Vyk/18uUHx0sPKCbxkPzqwQNou2jX Els8YpuUjVT/iP6GKV/ETwCSXHq3jhxM3tYoEqYCsFu7Zy3qwbv3ZolIvdG3Oz/aq3DQ wcDK/AfAvCLu/0kg9AoF+bgthF/a5jg7NdZag7BQt5JNuf1EX82EZJk84nxKhohrXavz /GAg== X-Gm-Message-State: ALKqPwfvl5uj6TL46m4cAXgqAEdHrvYbbJsuwvixE/R6pTa2G59cuEvA nKcTOPB7x7m5E3pFw/qZnHQ= X-Google-Smtp-Source: ADUXVKLvufesBaoF7iqJUpNeZs6lygA8AO8+7VklsmrwtIafuZGqbQDoqP3QCJBkjSH4Gvc7q5cstw== X-Received: by 2002:a19:1f51:: with SMTP id f78-v6mr1489420lff.42.1527252817133; Fri, 25 May 2018 05:53:37 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id y128-v6sm4671897lfc.19.2018.05.25.05.53.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 05:53:35 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1fMCDo-0007ae-GP; Fri, 25 May 2018 14:53:28 +0200 From: Johan Hovold To: Rob Herring Cc: Mark Rutland , Johan Hovold , Greg Kroah-Hartman , Ricardo Ribalda Delgado , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-serial@vger.kernel.org Subject: [RFC PATCH 2/3] USB: serial: enable serdev support Date: Fri, 25 May 2018 14:52:56 +0200 Message-Id: <20180525125257.29124-3-johan@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180525125257.29124-1-johan@kernel.org> References: <20180525125257.29124-1-johan@kernel.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Enable serdev support by using the serdev opt-in tty-port registration helpers. FIXME: serdev core always allocates and registers a serdev controller during port registration only to immediately roll back in the common case when there is no serdev slave defined in firmware FIXME: serdev does not support hotplugging (e.g. tty port hangups) Not-signed-off-by: Johan Hovold --- drivers/usb/serial/bus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index eb0195cf37dd..5f574a418c52 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c @@ -60,8 +60,9 @@ static int usb_serial_device_probe(struct device *dev) } minor = port->minor; - tty_dev = tty_port_register_device(&port->port, usb_serial_tty_driver, - minor, dev); + tty_dev = tty_port_register_device_serdev(&port->port, + usb_serial_tty_driver, + minor, dev); if (IS_ERR(tty_dev)) { retval = PTR_ERR(tty_dev); goto err_port_remove; @@ -105,7 +106,7 @@ static int usb_serial_device_remove(struct device *dev) autopm_err = usb_autopm_get_interface(port->serial->interface); minor = port->minor; - tty_unregister_device(usb_serial_tty_driver, minor); + tty_port_unregister_device(&port->port, usb_serial_tty_driver, minor); driver = port->serial->type; if (driver->port_remove)