Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2435562imu; Thu, 10 Jan 2019 14:18:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN5scerRAJ2xP4mNqJEN0RayV+4SIJ+XFXteqgK76aAj0CEVLJkdFL6Onf2yA6yyoIyqN3Kc X-Received: by 2002:a65:5c02:: with SMTP id u2mr10851828pgr.13.1547158699048; Thu, 10 Jan 2019 14:18:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547158699; cv=none; d=google.com; s=arc-20160816; b=RSjNYKqblQqifOqWkMfKeW7JHI/NfziWtzYYbki/Zk6DkdP71pNY4LwaJb+R6v2BjV zTd/KSgbiKQ1DLHggnb3ly7kliw0HRn9YA42qAZsAqXFC18s3EyQl3gfss9RXSJTbJKR Mq2WG6kuNMrl8QAot3yMob+5ItT7VljhbK/UDXJgVc/tcv+izYqhuQ4lnOHYUQs0SXY/ BKRiD1e6MzjLC/SEqr/LkNUz3pkEwaPvsFAGLKeFSYhusxTLxKbA/MJexDfBoRBqezRI Hz2IkWpd9XoFbGPDpe2P0utw4Cb5uc4cXG6O9JNDE/9fMrEBFo3PtOpaK6C0CP45YlZP LmPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=dU720+Oq7QbAeQ+eS0YykHl66OzVyftM0om6Kn3WLp8=; b=puRa+AHeh56nME4PDbV4yQNaU25kUwsyMglnlGs8Kdv3i7bK+Fq9ocAGOAW/fhCip0 ds3uhykCA6Sq4WkGT614K+iFJk4Abnu+5Fv8swWZ6Ws36KaC9OZOAFqcG7xvFIoIXCWS ChZBUlx8ZBSPZh3wI/a31SOyGQkw5tlmLlY0wwxqpWZyooNmu99KwjCMzIyop+Yj4OTS 4FRBOYV1eimnbCByZvW6zX/nVFWiUrdF/Kpk41ZvSGOCLW3FIdg1umKnLoZOEIvaIpAI chDtOk9aSjnoT0MCSRlDe5sWtRpO14O9KuoXSDb7zN+YqjH7fgZfuQ7G/eQEJV472Ivv 0wYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 r18si4600346pgb.491.2019.01.10.14.18.04; Thu, 10 Jan 2019 14:18:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729403AbfAJRLr (ORCPT + 99 others); Thu, 10 Jan 2019 12:11:47 -0500 Received: from mx2.suse.de ([195.135.220.15]:53646 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728262AbfAJRLq (ORCPT ); Thu, 10 Jan 2019 12:11:46 -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 7433AAFFD; Thu, 10 Jan 2019 17:11:45 +0000 (UTC) From: Andreas Schwab To: Anup Patel Cc: Greg Kroah-Hartman , Jiri Slaby , Palmer Dabbelt , Albert Ou , Atish Patra , Christoph Hellwig , Rob Herring , linux-riscv@lists.infradead.org, "linux-kernel\@vger.kernel.org List" , linux-serial@vger.kernel.org Subject: [PATCH] tty/serial: use uart_console_write in the RISC-V SBL early console References: <20181204135507.3706-1-anup@brainfault.org> <20181204135507.3706-2-anup@brainfault.org> X-Yow: If I have enough money to buy 5,000 CANS of NOODLE-RONI, can I get a VAT of MARSHMALLOW FLUFF free?? Date: Thu, 10 Jan 2019 18:11:39 +0100 In-Reply-To: (Anup Patel's message of "Thu, 10 Jan 2019 21:47:07 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This enables proper NLCR processing. Suggested-by: Anup Patel Signed-off-by: Andreas Schwab --- drivers/tty/serial/earlycon-riscv-sbi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c index e1a551aae3..ce81523c31 100644 --- a/drivers/tty/serial/earlycon-riscv-sbi.c +++ b/drivers/tty/serial/earlycon-riscv-sbi.c @@ -10,13 +10,16 @@ #include #include -static void sbi_console_write(struct console *con, - const char *s, unsigned int n) +static void sbi_putc(struct uart_port *port, int c) { - int i; + sbi_console_putchar(c); +} - for (i = 0; i < n; ++i) - sbi_console_putchar(s[i]); +static void sbi_console_write(struct console *con, + const char *s, unsigned n) +{ + struct earlycon_device *dev = con->data; + uart_console_write(&dev->port, s, n, sbi_putc); } static int __init early_sbi_setup(struct earlycon_device *device, -- 2.20.1 -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."