From patchwork Wed Aug 16 13:22:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 9903791 X-Patchwork-Delegate: geert@linux-m68k.org 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 C7B2F60231 for ; Wed, 16 Aug 2017 13:22:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9AA8289E7 for ; Wed, 16 Aug 2017 13:22:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE3F0289EE; Wed, 16 Aug 2017 13:22:48 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 5EEA7289E7 for ; Wed, 16 Aug 2017 13:22:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751781AbdHPNWr (ORCPT ); Wed, 16 Aug 2017 09:22:47 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:38077 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751692AbdHPNWp (ORCPT ); Wed, 16 Aug 2017 09:22:45 -0400 Received: by mail-wr0-f196.google.com with SMTP id g32so3046239wrd.5; Wed, 16 Aug 2017 06:22:44 -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=AL68WzQH86O95xEkbbeXLHgrbmyoa+eiaqaY6m4tWqQ=; b=dyR9BX7Cif92bdJACqO6xMmSbFdaANeoHr4rkF4+wMUP5mMFESBqh/sBBHVpQYYOes rx7VVeN40tePvBt9fWtdca8yQSilAeXGgQbrmSyfRq7VVPKNciHHmcY20VS1qwOgcWfx EpP8mP4ilPY8S6cMkqUoXcErzoF4EfxfcXwxa9rgNeoTeIoRvfKcbC69wlIpaUTfRYxM CzbpzXd4Qja85DS1mwD8ltvi5IYfEd6OjTAVvLAJ4WypvAskxK1Q0a+Z7u9Jn61S38fr gTnHR1zDa+LvcDD38CMkMEtVKIs6dsyb8l4IXcVNzuq1Y+dCLjEuutj7SHbmvb50BlCO ylGQ== 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=AL68WzQH86O95xEkbbeXLHgrbmyoa+eiaqaY6m4tWqQ=; b=b529firruxxRRhfBjhqoSKDAMGNMSir50bakBRTLcNky8la++J0bVCdU8QKK8Vd0H9 6nbe+XMN29TMdOyOajs5DJ9XZZ1W8rcJBA1zRIUOOfVJeo8i4sEnLvQVCCjpi8zOlGDm fdoQWcT9k5B+af2ziNN4gYmz1LSf6xn+q85me560JPfwqZCCJLFKHVVMfX1qevo2Fx1p ccm1ftsKLONiXmRWdOZl8Ij5hIJTzjsZ3tL51QlnFnxf8/2oo0I+ozbJEA99ZJo3a/MC K7hGgRsG7shhdNXZGptg2/ikqffCqd/a2JMf7ivXrkgnisT93qP94SX7WBztlyNKfs6u vGjw== X-Gm-Message-State: AHYfb5j7ZgY7BJEVPviAS5YToNtCbo2pH0sr2+APzCWLmwElEQXHRPU2 qlQo61e66JwUB+160/A= X-Received: by 10.223.155.210 with SMTP id e18mr1145832wrc.55.1502889763277; Wed, 16 Aug 2017 06:22:43 -0700 (PDT) Received: from groucho.site (ipbcc2817c.dynamic.kabel-deutschland.de. [188.194.129.124]) by smtp.gmail.com with ESMTPSA id m130sm1054894wma.27.2017.08.16.06.22.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Aug 2017 06:22:42 -0700 (PDT) From: Ulrich Hecht To: linux-serial@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com, wsa@the-dreams.de, robh@kernel.org, peda@axentia.se, geert@linux-m68k.org, linux-i2c@vger.kernel.org, Ulrich Hecht Subject: [PATCH 3/6] serial: core: support deferring serdev controller registration Date: Wed, 16 Aug 2017 15:22:25 +0200 Message-Id: <1502889748-31499-4-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502889748-31499-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1502889748-31499-1-git-send-email-ulrich.hecht+renesas@gmail.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP serdev controllers may depend on other devices (such as multiplexers) and thus require deferred probing support. Signed-off-by: Ulrich Hecht --- drivers/tty/serial/serial_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index f534a40..30a8997 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2785,6 +2785,10 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) uport->line, uport->dev, port, uport->tty_groups); if (likely(!IS_ERR(tty_dev))) { device_set_wakeup_capable(tty_dev, 1); + } else if (PTR_ERR(tty_dev) == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + state->uart_port = NULL; + goto out; } else { dev_err(uport->dev, "Cannot register tty device on line %d\n", uport->line);