From patchwork Sat Feb 8 11:53:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Christophe PLAGNIOL-VILLARD X-Patchwork-Id: 3610041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 808AFBF418 for ; Sat, 8 Feb 2014 11:54:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7962120138 for ; Sat, 8 Feb 2014 11:54:21 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE91420125 for ; Sat, 8 Feb 2014 11:54:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WC6Tr-00077l-FN; Sat, 08 Feb 2014 11:53:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WC6To-0003Fl-VW; Sat, 08 Feb 2014 11:53:52 +0000 Received: from 10.mo6.mail-out.ovh.net ([87.98.157.236] helo=mo6.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WC6Tk-0003F9-8b for linux-arm-kernel@lists.infradead.org; Sat, 08 Feb 2014 11:53:49 +0000 Received: from mail440.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo6.mail-out.ovh.net (Postfix) with SMTP id BF25D1000B73 for ; Sat, 8 Feb 2014 12:58:52 +0100 (CET) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 8 Feb 2014 13:59:36 +0200 Received: from ns203013.ovh.net (HELO localhost) (plagnioj%jcrosoft.com@91.121.171.124) by ns0.ovh.net with SMTP; 8 Feb 2014 13:59:35 +0200 From: Jean-Christophe PLAGNIOL-VILLARD To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] serial: atmel: evaluate linux,stdout-path property Date: Sat, 8 Feb 2014 12:53:53 +0100 Message-Id: <1391860433-5343-2-git-send-email-plagnioj@jcrosoft.com> X-Mailer: git-send-email 1.8.4.4 In-Reply-To: <1391860433-5343-1-git-send-email-plagnioj@jcrosoft.com> References: <1391860433-5343-1-git-send-email-plagnioj@jcrosoft.com> X-Ovh-Tracer-Id: 2028590158551297021 X-Ovh-Remote: 91.121.171.124 (ns203013.ovh.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrjedvucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrjeehucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140208_065348_413113_CB48BAC1 X-CRM114-Status: GOOD ( 13.25 ) X-Spam-Score: -1.9 (-) Cc: devicetree@vger.kernel.org, Sascha Hauer , Jean-Christophe PLAGNIOL-VILLARD , linux-serial@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP if the driver is built as module skip it as add_preferred_console is not exported Cc: linux-serial@vger.kernel.org Cc: Sascha Hauer Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- drivers/tty/serial/atmel_serial.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index a49f10d..2ade64e 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -2044,6 +2044,19 @@ static struct uart_ops atmel_pops = { #endif }; +static void atmel_of_preferred_console(struct atmel_uart_port *atmel_port, + struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + struct uart_port *port = &atmel_port->uart; + char* option; + + if (!np || !of_device_is_stdout_path(np, &option)) + return; + + add_preferred_console(ATMEL_DEVICENAME, port->line, option); +} + /* * Configure the port from the platform device resource info. */ @@ -2059,6 +2072,9 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port, atmel_init_rs485(atmel_port, pdev); + if (IS_BUILTIN(CONFIG_SERIAL_ATMEL)) + atmel_of_preferred_console(atmel_port, pdev); + port->iotype = UPIO_MEM; port->flags = UPF_BOOT_AUTOCONF; port->ops = &atmel_pops;