Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2775125yba; Mon, 22 Apr 2019 12:44:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWWf/Ecw2+xz40a4hn5nCwFyLkA/denGLwdQGsKcQQOM8wb01AM2uLiJTm6u5RxFuiqWDt X-Received: by 2002:a62:6807:: with SMTP id d7mr21880498pfc.75.1555962247486; Mon, 22 Apr 2019 12:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555962247; cv=none; d=google.com; s=arc-20160816; b=UZmJ0fc9Iup9VhfG+zE8J0EniaoioHWZ36P9p2uzNcMV3dDWMZ1c8syawvrAFtJJ4C xmv/Z8VTibRJsMzWpZ8I/FDZFQ6FjnVxWWOn1/io4v1cEmffH/cJs4Ms8Is8FqpvcOi/ 9IMAf3Lbyl9/7pmaIvGrP9LfFE8c9Ba6OMDYWLQiMj8Cojl2koCNdaAkGoBye+pydwPb Ojr+032HEZ/pMqFRVThsueqv7HJjbXN0DZteEby/araiDIRevxS4ZTn8ZXspfi2pfoCn SHC6+hUpqe9ClZVsnnwgWnALC/xHgVlM/2drM+CQ4I3aLb8H7ADHSDzIv71fXjzirBEC gS6w== 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 :dkim-signature; bh=1im0bFpQIqxdreXuyDwBSs1fr6FNgWNRWW4ZD7Oqi/8=; b=x//C/BlJcADq2rDrIj3tLw+DUNhjc9lR6X17oK+H/gp6nZAgQpP2pvJpwK7/0+CyY8 jE/90enQgoIv5HkvIg64uXxx1rjQ5y+bo9hRez12Z0dyGERDH0vw3B5IVuHGUKj/tXH2 HQBxfdKGM4qNLLqYoKxWg1HdDaOBB1qH+NAZ6soZvtGIYMwNBKDmXgoUKJvWoT2/pGLY uR5dXBijtOx7hmIIw2WHxK7CI6f42sD+8KHPZ6YCJ1DvK+fZZ2acYHBwGoY01U0OkU8f RwITIPzrrRtGvBjBhe4WdjJ52oFpvdV22ql7l6s4Rk/V5jiwRvB5ZAJ1C1WNq5YF0dhJ /raw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Lr6uo1Wv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si13509197plo.118.2019.04.22.12.43.52; Mon, 22 Apr 2019 12:44:07 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=Lr6uo1Wv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728950AbfDVTmo (ORCPT + 99 others); Mon, 22 Apr 2019 15:42:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:43004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728905AbfDVTmh (ORCPT ); Mon, 22 Apr 2019 15:42:37 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BDDC6218D9; Mon, 22 Apr 2019 19:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962156; bh=p7DLkUNcQj6z2owi6qNZbpu2hBtOYk7Udeu4rvRoUVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lr6uo1Wv5RE+kYemFZwlLqP/4tDzn6IzMlGToCd2jiQS6v+96xBNbnokEF37KJ9lj Z8D9jviwyFCNKN0RGEvbvPKiGpAJWw4fmz+nRDo6awOg5EDsZOhP3q0yhBcsQRiXNn oC3n4b+c/jtSVKiurrSxcC3UzGsiP59jpsKEWCkk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Petr=20=C5=A0tetiar?= , Greg Kroah-Hartman , Jiri Slaby , Andrey Batyiev , Sasha Levin , linux-serial@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 24/98] serial: ar933x_uart: Fix build failure with disabled console Date: Mon, 22 Apr 2019 15:40:51 -0400 Message-Id: <20190422194205.10404-24-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194205.10404-1-sashal@kernel.org> References: <20190422194205.10404-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Petr Štetiar [ Upstream commit 72ff51d8dd262d1fef25baedc2ac35116435be47 ] Andrey has reported on OpenWrt's bug tracking system[1], that he currently can't use ar93xx_uart as pure serial UART without console (CONFIG_SERIAL_8250_CONSOLE and CONFIG_SERIAL_AR933X_CONSOLE undefined), because compilation ends with following error: ar933x_uart.c: In function 'ar933x_uart_console_write': ar933x_uart.c:550:14: error: 'struct uart_port' has no member named 'sysrq' So this patch moves all the code related to console handling behind series of CONFIG_SERIAL_AR933X_CONSOLE ifdefs. 1. https://bugs.openwrt.org/index.php?do=details&task_id=2152 Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Andrey Batyiev Reported-by: Andrey Batyiev Tested-by: Andrey Batyiev Signed-off-by: Petr Štetiar Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin (Microsoft) --- drivers/tty/serial/ar933x_uart.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index db5df3d54818..3bdd56a1021b 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -49,11 +49,6 @@ struct ar933x_uart_port { struct clk *clk; }; -static inline bool ar933x_uart_console_enabled(void) -{ - return IS_ENABLED(CONFIG_SERIAL_AR933X_CONSOLE); -} - static inline unsigned int ar933x_uart_read(struct ar933x_uart_port *up, int offset) { @@ -508,6 +503,7 @@ static const struct uart_ops ar933x_uart_ops = { .verify_port = ar933x_uart_verify_port, }; +#ifdef CONFIG_SERIAL_AR933X_CONSOLE static struct ar933x_uart_port * ar933x_console_ports[CONFIG_SERIAL_AR933X_NR_UARTS]; @@ -604,14 +600,7 @@ static struct console ar933x_uart_console = { .index = -1, .data = &ar933x_uart_driver, }; - -static void ar933x_uart_add_console_port(struct ar933x_uart_port *up) -{ - if (!ar933x_uart_console_enabled()) - return; - - ar933x_console_ports[up->port.line] = up; -} +#endif /* CONFIG_SERIAL_AR933X_CONSOLE */ static struct uart_driver ar933x_uart_driver = { .owner = THIS_MODULE, @@ -700,7 +689,9 @@ static int ar933x_uart_probe(struct platform_device *pdev) baud = ar933x_uart_get_baud(port->uartclk, 0, AR933X_UART_MAX_STEP); up->max_baud = min_t(unsigned int, baud, AR933X_UART_MAX_BAUD); - ar933x_uart_add_console_port(up); +#ifdef CONFIG_SERIAL_AR933X_CONSOLE + ar933x_console_ports[up->port.line] = up; +#endif ret = uart_add_one_port(&ar933x_uart_driver, &up->port); if (ret) @@ -749,8 +740,9 @@ static int __init ar933x_uart_init(void) { int ret; - if (ar933x_uart_console_enabled()) - ar933x_uart_driver.cons = &ar933x_uart_console; +#ifdef CONFIG_SERIAL_AR933X_CONSOLE + ar933x_uart_driver.cons = &ar933x_uart_console; +#endif ret = uart_register_driver(&ar933x_uart_driver); if (ret) -- 2.19.1