From patchwork Sat Apr 27 12:51:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7705914D5 for ; Sat, 27 Apr 2019 12:53:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 687B5284E8 for ; Sat, 27 Apr 2019 12:53:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C4A6286B9; Sat, 27 Apr 2019 12:53:09 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 0E046284E8 for ; Sat, 27 Apr 2019 12:53:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726644AbfD0MxI (ORCPT ); Sat, 27 Apr 2019 08:53:08 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:38839 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbfD0MxH (ORCPT ); Sat, 27 Apr 2019 08:53:07 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N8XHV-1gh8Cp1oHJ-014PTe; Sat, 27 Apr 2019 14:52:34 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 01/41] drivers: tty: serial: dz: use dev_err() instead of printk() Date: Sat, 27 Apr 2019 14:51:42 +0200 Message-Id: <1556369542-13247-2-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:ZsvBvAt/rLDu1xNT1sLalxIcX9jz7QA0qevymQS/WxRCH2zr6Wl xgtlPQz+G8tT6HFrUdOePnL/g6Nz/IIjRENpXyf+TYdtSi3HrsJGdjKV+IdrLIpqWKUpGIr dGZH3/KAvVSKXLhp+eDtJ5SZp4iM/k7bWZWc3G+D3RpE/VH31kx+tVU+u8Iwg2ZCwcrt7Md VmQRsAPpOo0raWOEg8/zQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:j2N/FCIfxd4=:bTewDVrnVLOaptDPWAeuYB qRyMUvP7ZPhCmHnVLyv7ju+39CHpoR56I6eeSo+QPHPGCZx3Dqb1I60yuGCld7+3VbN8mYQwM 2ZbCjusuSxTA2+bf+ln2gKOriFRvIYv03fZTu+YI/5yLbx6CSI9l+bTwHEvU0H3ta1wkb3w1G M+LRWzsJhzU1D+iabrBiJqQulwdI3SOWT2P39DSrBTgj2TeG0p6nM0OK9s4d0AagkEnaTtFDS GvIWfSoCbR2/5PkucHigRUl586888kNEamyG3pD+K1ZnRZUvnQt/2bPJMzgLfbBVnFR2n0rOH DsIz1uuQuxZ7xJAdCE1i2GlN5DwfyIfqrtAA5c9XnIO0mqFGZSvMUtg1KOyuRQsHPdH2C4Nkh 8yh/9sHWREWoAj6h1c/8kcQJwWpF/j89Q7lN01agcyFr3XDqClCzOiVbL/cuH2l5+wBbKl4nd gSsSwspQkSoDZm31+uFKkJY6eYFb8qq5u5vRxi5/XyLnlD6Y22WLY90exJLjhzbZ1RBv3msRT j5X6PznC/2y4lrGdO5AgaDwAv8zPI5drxxuPiWfijNEnfgb8HX+g/xkSO/S8J4vLbq4psstD7 q9QxcVenJmTkCoZUZ8DCf0pUWm4fjCG/QmMLXdJHruAEAQLXD/UUAuMqcTlPi/svDYKKsH8aC NgqmkYONc/sKFoFcNypfgkXrsyaRmZhIleuG7ABCNJPmKzGwbidMFStX+km4vIUZ/Cnup6GQS oGpzEdn60+VNwCX/u7Jnm8SJFhRmTuBbIh4ULA== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_err() instead of printk() for more consistent output. (prints device name, etc). Signed-off-by: Enrico Weigelt --- drivers/tty/serial/dz.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index 7b57e84..96e35af 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -416,7 +416,7 @@ static int dz_startup(struct uart_port *uport) IRQF_SHARED, "dz", mux); if (ret) { atomic_add(-1, &mux->irq_guard); - printk(KERN_ERR "dz: Cannot get IRQ %d!\n", dport->port.irq); + dev_err(uport->dev, "Cannot get IRQ %d!\n", dport->port.irq); return ret; } @@ -680,7 +680,7 @@ static int dz_map_port(struct uart_port *uport) uport->membase = ioremap_nocache(uport->mapbase, dec_kn_slot_size); if (!uport->membase) { - printk(KERN_ERR "dz: Cannot map MMIO\n"); + dev_err(uport->dev, "Cannot map MMIO\n"); return -ENOMEM; } return 0; @@ -697,8 +697,8 @@ static int dz_request_port(struct uart_port *uport) if (!request_mem_region(uport->mapbase, dec_kn_slot_size, "dz")) { atomic_add(-1, &mux->map_guard); - printk(KERN_ERR - "dz: Unable to reserve MMIO resource\n"); + dev_err(uport->dev, + "Unable to reserve MMIO resource\n"); return -EBUSY; } } From patchwork Sat Apr 27 12:51:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB70414D5 for ; Sat, 27 Apr 2019 12:56:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA71228B2A for ; Sat, 27 Apr 2019 12:56:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB52628B90; Sat, 27 Apr 2019 12:56:38 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 721C728B2A for ; Sat, 27 Apr 2019 12:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727152AbfD0M4c (ORCPT ); Sat, 27 Apr 2019 08:56:32 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:49175 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbfD0MxK (ORCPT ); Sat, 27 Apr 2019 08:53:10 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M72wZ-1hQgsG1F7v-008djg; Sat, 27 Apr 2019 14:52:35 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 02/41] drivers: tty: serial: dz: include instead of Date: Sat, 27 Apr 2019 14:51:43 +0200 Message-Id: <1556369542-13247-3-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:vWpyHvDheL6gbLjo3etBs2JZ/UueJUyOwv5jXuZL9y2wfL1t2Sz Q/+Nt5v3237WzwYwrkHtvh8CdRpqwPqpHpcjERpTIKU+EcAYTF+qBG0cw4jXtPhcJu5L1xP kkBztdWdJQKAWhxdJmybmuQlVUbgmAr1fvOkc6orv3ghX86g6ax2Ao2WppX1ubS4UHmC3BK omfMVJUQwR4EJT11yTj+A== X-UI-Out-Filterresults: notjunk:1;V03:K0:PWTU6h30wog=:g3KXzB9M32PW8Kl8vCIU73 qJ8Hw/X5UhMxHr5PXZ5NJLP8zF+n5L1AYhbxdz0HkWq3pRijKJD3ZZgMPMXT5AC0MCjgTwTnG BKB6ehulTwMDvn0rk/0UWp57hVY8n65jpID29G2/RtuijyesvETIRsoOmsEDDklXWWrpv6Hvq J5ApyjRxjwebOu+2DLtzw/iHyVZjoSBSJ3tfl+uRrcbirei0rvO8pIPPAp9hShgt6wvsRCnWy 69Nm4xD9n73QNYwZz1WgLz31zuE/AXQbiEv14NTsptf7xQB3TMb47qEcLeEIXQttLDlssfrUu sUnzAbwiXa9qXMynpyfRG2WmHpKy3Sb57NCyp79kJVZNqzTeWy5rJ580LJtiNOnKV5l0NEl4P ft43B9g3QEw0dE2RA1G9sPuGJvuILiXEPeqUqYjhTT+UmVrLG83+OrotnH1YPjhkzWg9WZGyl ZsMxaVC5zUJY8olqHlPJl3lfAv4fxzGIBE75jKtOJwB61iyMmTGCbLZT9aUnRGj+9CHDKLe70 r7+eZMXeXJ9eT1W7HDMQibFCPL6QSTKhCVVawhfq7GZkd2tcZx4GWCO7RGRNgouXD8JVSy7qz m5Wbs2AH+EWnYtwKwE+ERMHMsz/tgMtlUXwgbizNPnSQPzD9LYY+Bqrq0DeP+AXy3VjT0jaZn /zPlxBehxOKrsnCjM3aDW+YERQBO5njRt7YPdL+ImY78ofqqhgs0vMjuBK7/voIREnYQyHmyR QiZRIDUO7YShRpDwljxwkZ//0pWuawyNDeyJ3w== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fixing checkpatch warning: WARNING: Use #include instead of #55: FILE: dz.c:55: +#include Signed-off-by: Enrico Weigelt --- drivers/tty/serial/dz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index 96e35af..fd4f0cc 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -52,7 +52,7 @@ #include #include -#include +#include #include #include From patchwork Sat Apr 27 12:51:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1FB3F1390 for ; Sat, 27 Apr 2019 12:53:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11272202DB for ; Sat, 27 Apr 2019 12:53:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04488212D5; Sat, 27 Apr 2019 12:53:27 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 EFAAC286B2 for ; Sat, 27 Apr 2019 12:53:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727253AbfD0MxZ (ORCPT ); Sat, 27 Apr 2019 08:53:25 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:33807 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbfD0MxX (ORCPT ); Sat, 27 Apr 2019 08:53:23 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N49Yn-1gckUf0Xp3-0101lS; Sat, 27 Apr 2019 14:52:36 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 03/41] drivers: tty: serial: dz: fix missing parentheses Date: Sat, 27 Apr 2019 14:51:44 +0200 Message-Id: <1556369542-13247-4-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:DCKi2YoTk5F832OQUdu63uCQyxtOturAok1rJyvr3Cj1aB4PytR 39oykOLn/6maTSaugkdLtAO+JW6mtXKXNyEKmjf/LfUX+UrtldHzEn6VJRT6Ai5Wmv6fPJu zDbdAsnAWjMsVY/Lfxtu7H3H0VD9b6vzG1KkGY93toXvi1amjf/kUGN1jMaJH9MM+TdtJWy 6Qq+l2SfPMMVa3xrX3Dhg== X-UI-Out-Filterresults: notjunk:1;V03:K0:hCaJcuTMeuA=:EB4ux1IA7Tt2VnO5QHlgjW pkbxMpPw2nta4CmIKC1kcgXZ8R3PVqr7ziHZCtHeUGvHHk9Qk9raYRBGZaF5IqaPVm6CNMnxr 9vty1/D38JGFJJSTwt3NFvurWC70JuBjH/BKAB8yESh6+wLopafjQqQPN8l2KX8SGQjfwv2xO TyzFvmsYNx3rtFuVJ/pJ1vV56+pzzVMgAzd7E0EpyYgb7DGVVlUR2LG1dxWjJ2Hof/It2Rmfz p9izFHquGUwtbxHeqxGGWvM4ijYINTbcCUZVJjV5oJC9/JYWT730WUlA9JIbF2xjIF7PBRVXX kASrSTWn7c2M2sc3c6bB50GRDqBH6dH94gztdOwsPoZ4cj+JQkPM6uX86/TUJ8e4WJY2B5iGU HP7+HVB4tQVuFWqAHT2uGAz6varlOIJ5yKrTIJx6feesH62tAViO17zmGulcYNIxOP3eNPMOD Hmet1YF6m/ZGilYNo9SR/pjTIMz1EyH8o7eL4CQcuBZ9FwhDFRYTxTY15EVLqHyCvQkPg27Rb 8uO0aVYpOJ/qo2qK8zbTnZCXXNRXdpe5e3F/ivKBz+b1Oa+zghaMw2mbTc4DrgKSeZzP1LTNm teKvpXO2ByNWbSgSgXOBtzriQtZsC2TVemyVqTtaDrQpo+R6tvq8EoDpEQZIo8UeRCmxfnM7Q CuTeQ7zz0fUVVIk54pr5H16riYLFpjz7OQg7RqO6kuwjj9BxIwYM6AphowGhGxOWdsrYDcB8I YsZWUl7WRUQ4eG9segmrTeI0ta1XPj9nf9dvOw== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warning: ERROR: Macros with complex values should be enclosed in parentheses #912: FILE: dz.c:912: +#define SERIAL_DZ_CONSOLE &dz_console Signed-off-by: Enrico Weigelt --- drivers/tty/serial/dz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index fd4f0cc..b3e9313 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -909,7 +909,7 @@ static int __init dz_serial_console_init(void) console_initcall(dz_serial_console_init); -#define SERIAL_DZ_CONSOLE &dz_console +#define SERIAL_DZ_CONSOLE (&dz_console) #else #define SERIAL_DZ_CONSOLE NULL #endif /* CONFIG_SERIAL_DZ_CONSOLE */ From patchwork Sat Apr 27 12:51:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32FDC14D5 for ; Sat, 27 Apr 2019 12:55:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 255C828B2A for ; Sat, 27 Apr 2019 12:55:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 197DC28B90; Sat, 27 Apr 2019 12:55:57 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 B649528B2A for ; Sat, 27 Apr 2019 12:55:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726791AbfD0Mz4 (ORCPT ); Sat, 27 Apr 2019 08:55:56 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:43467 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbfD0MxL (ORCPT ); Sat, 27 Apr 2019 08:53:11 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mspy4-1gVqbE43aa-00tCHb; Sat, 27 Apr 2019 14:52:37 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 04/41] drivers: tty: serial: dz: fix use fix bare 'unsigned' Date: Sat, 27 Apr 2019 14:51:45 +0200 Message-Id: <1556369542-13247-5-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:CBJBinnswYpZ8Sdk7wFOAsULywVOOhB0O51QI1ZS6aG2XtvP5Ax rUdddfq4rw+u/9EFqOQzXc3/JM5V7fsK23L/z85bPCOANxd2GuzAoLWyurSK9Ii+GNlroRp D+hqD+3RuR/9qgEHat/Ucs2oZfFOYySxVG+wr6Q+wrWn6MY4YELLqYiMi6+Z1GHMHZ9Sbi6 A0dnBU9i+mqDN3d/fmLxg== X-UI-Out-Filterresults: notjunk:1;V03:K0:MH/lZafoCx0=:C6VQMV1HsKH9OxnmfiwWwi ls6ASJ0mneciKIXS+1V+wSxBJcpan2IpZ08XLTD6SYv7YXOIMII1L/KWbG0T9oFUOLphs/Fg3 l2AlwPRiDgZqonUsBVKpGTsKSv27ETHk1u8CP6XiFhZ9cNW2T3FLm/M/RZiJJEVU+b4hat+oG V/t5hoDjxIiN6XeMIGY3ZKep3tzRsiG+Yf5WrxF7xmHK3ns0GM3BNTiW1nXz2EqwNDtGAyeZq Vvqo3PBXcwPXiB6IUXXnKOdfKgojhgqctY7SufpZAYrm+1D2LBSe3PgUHcGQeS6y3DDBI1EER ik2lMkxjtSrUzyrZhTKgo1kjcSBthFwMG5B29FUWZC9SlsTzEYflKLY1mlrZ/DBKrktMH6+KG e3fXGk80CchhUtjMmL7Eyykp3o924p2zhQIBYAL0puuxE6/cYR/3HyeTlGe42KZuMH9EZn0+g n/3ogS9RFBh7aesoWqrAsTgXRq6ILeiUjg/9gPYWefwJguOeS1NTOW2WOOrphR2Dfrcvy72gC mu2hsdgjoNnA4njyhs3XxuFnlYyWLsuBOT3jqHXTTXDPK9vFMOFSfp50AeuB6lwEo12Rxs0Ip 8eo0NdOrxwE+PMaT+iD6IJzKHMvoTFwflMb6JOcc69Pg8tOMFpOm2QWk0WlCbVyrrlaOAVFD2 JxVH/iny2tox/lLVNnjx1smE1j9T7d7BKieB2e6XjF/H3MzZFm2Qw/hD3pnmYq+Kcy8sdTENK uVS7NH13R3Km3ewXsX6v4Ea4yuju79Q+cCDxjQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warnings: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' #103: FILE: dz.c:103: +static u16 dz_in(struct dz_port *dport, unsigned offset) WARNING: Prefer 'unsigned int' to bare use of 'unsigned' #110: FILE: dz.c:110: +static void dz_out(struct dz_port *dport, unsigned offset, u16 value) Signed-off-by: Enrico Weigelt --- drivers/tty/serial/dz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index b3e9313..559d076 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -100,14 +100,14 @@ static inline struct dz_port *to_dport(struct uart_port *uport) * ------------------------------------------------------------ */ -static u16 dz_in(struct dz_port *dport, unsigned offset) +static u16 dz_in(struct dz_port *dport, unsigned int offset) { void __iomem *addr = dport->port.membase + offset; return readw(addr); } -static void dz_out(struct dz_port *dport, unsigned offset, u16 value) +static void dz_out(struct dz_port *dport, unsigned int offset, u16 value) { void __iomem *addr = dport->port.membase + offset; From patchwork Sat Apr 27 12:51:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAB9614D5 for ; Sat, 27 Apr 2019 12:57:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB85728B2A for ; Sat, 27 Apr 2019 12:57:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCE1F28B90; Sat, 27 Apr 2019 12:57:13 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 65FCA28B2A for ; Sat, 27 Apr 2019 12:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727316AbfD0M5E (ORCPT ); Sat, 27 Apr 2019 08:57:04 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:39929 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbfD0MxH (ORCPT ); Sat, 27 Apr 2019 08:53:07 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mzz6s-1gXTgh3Td8-00x1Ur; Sat, 27 Apr 2019 14:52:37 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 05/41] drivers: tty: serial: dz: use pr_info() instead of incomplete printk() Date: Sat, 27 Apr 2019 14:51:46 +0200 Message-Id: <1556369542-13247-6-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:0divRPlMaEn/Gqkn0bF/qffr0mtJMzUIhhcgUCpKp3L8QfEx3BT Sct6DXQKPsKml0HbjLEbqZ0BVdAAcNgJ6gXOI6JC8K/1+PAe8EFl5Aq1lbdbexf9MvYSvJI wDh21F+qIQxeFuU3Myc3hkjl/lhNuC86c6zCO8DZIQRpkFEogbQN+oxEVR+QjYaXv/F2Er3 D3Hg7fjgdOldNL+SYlAwQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:+RM97HlEygc=:XCYgbldeM4fHTujSYLo9ci ZNeOghoSWPCt1C8c6NBMLSfGNddK58lmCDc3rlfBH3ynfXNXoutb/zjRBWM8D3BIY49a4i4UE w61HuHHGGrE/nW055rXaTuGx9TatMuVoyD47DJXczfb3oO2GbP0EmAQmzpC+6kDBZdseEXdDC Q/7Dzh91Dv5viwhjSOg8QB3blGvc6npMCA3+LRAVdg7cmGKN+31NplbmdslmfdvUCt7Zt8txu wu1qVJ20ms6soMtiV40LnA1aD9QGbuHc7kSx8ChK0JcxawU9TBzFvD7nHcdQCkga/Pam6wIlh SozaRebsNHrmz6K0Nxx5GSTQPTFKcxIbQTjsZTv+UXWB6g6MdVA8xNYDMcxFB3I9a/OOa1+q6 SDNeRbSCUbiTqPPGCr4Wlwd5pr0t1wGkI38yOimXepPKVf4067XO8agDegepX6eMqr1dnbVEl 7E6hKunNpdkhyB0sNKvUPq+uvwV2l/VdX95oOhRD4521oJmMRY3DJ+fuI9JwMF0+0d43RkioS NAq5fkYK+cja/PvgpcgRoKs9fOqvE/DvkG7oyD8aLe7kzR0MXQDK6+nm2GtMVAfo9rLlZIslt eYSqlXLx6iAbP5p7IGgKyS6G3mEq0IT3MizlVzwRrPBrTI6P7aSZVck/9N5HOec9ocrRvZ2zy eP3CmOH7ndIUhAxgSzvJujudRMq1laldwLQ9qL1Fz34ZpgICHygnXc7BQ2s/IBPS3Nvdokjth xKIhRxBJYIbWNhrxBOQ1AQzGdb2SfJPFzpfkeQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the checkpatch warning: WARNING: printk() should include KERN_ facility level #934: FILE: dz.c:934: + printk("%s%s\n", dz_name, dz_version); Signed-off-by: Enrico Weigelt --- drivers/tty/serial/dz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index 559d076..e2670c4 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -931,7 +931,7 @@ static int __init dz_init(void) if (IOASIC) return -ENXIO; - printk("%s%s\n", dz_name, dz_version); + pr_info("%s%s\n", dz_name, dz_version); dz_init_ports(); From patchwork Sat Apr 27 12:51:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6FF46933 for ; Sat, 27 Apr 2019 12:55:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 612DB28B2A for ; Sat, 27 Apr 2019 12:55:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 557CE28B90; Sat, 27 Apr 2019 12:55:32 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 04F0D28B2A for ; Sat, 27 Apr 2019 12:55:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727020AbfD0MxR (ORCPT ); Sat, 27 Apr 2019 08:53:17 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:49763 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbfD0MxQ (ORCPT ); Sat, 27 Apr 2019 08:53:16 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MQ5nE-1h759i2pEm-00M2Ff; Sat, 27 Apr 2019 14:52:38 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 06/41] drivers: tty: serial: sb1250-duart: use dev_err() instead of printk() Date: Sat, 27 Apr 2019 14:51:47 +0200 Message-Id: <1556369542-13247-7-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:virapGaLe72N04lun9WdAKkbszb/ggQMqOiOUSHBcLWgpMmeSap mBYtyGLtkO8bfsb4eQ43Ka/Pvv/b4cCI/WGEqijtDJEFEcNTc93ifR7R/FI82p+Et0Hzuoy 6Mqe+toYlTBM2KOFgvujwEBfyVHzntqNkA4zWfZ1M4ILi8IQFR+Hd6QOrw7CXV2bkioPk2/ 824zpPHm55RHdm67u7Kxw== X-UI-Out-Filterresults: notjunk:1;V03:K0:gJOyTKZqpIg=:tp2oVLfWX5tgJwhU7rJw/s 5xC3YkCNU9Clc7T8duZDvMjLNAqv/hMeDkuQQSl0VFwB/77Xz/6uLhmENAywHnQ/tv5KQ7k+P X9UWHtEtD0eICFfIuNQEVk8Q1vsrEuNpiCnIVQ6AMEHCRTcnAaveMmnXgfeMDyhFJuwk0nf9L DQALyFq0RsHbgzwO4tPR+AHmL8LxevQNFrS6XnH3aHQhZHr2GCgH6P4TJOTYEtv/LqtPy4mVx ZCTsD5oD1hBA+QVf0Pd0xggJm7VCPpuIHTXK3+8waBmtVcTiONHpiiLJ8LfXX5ZlVudpg3fJs 7Km2WOt6iHbRSSP2BK9YWglzHwTAjjGfFFXZX5yZB2VBzzFOHrx8eh/DApk430FdXIzKK+KXW CsVOucv0ERWvtQeWpdeOgZArjzFR+5/OAcw1rQ0/vzqSfqwgmxfG68VyYt/9gWidW+AZLD4IL VuuJLLLY+/ieyyWwCeF54XzbHWRkg65H4yD9Gib1If0oHkvzZ5bsH78my7Ab2SNUDFkxkalbY xRmVs2FRPXJhn3TaJlzs61kfXrxC4ykInMr4wqMqSVZwyFWNiCF9CyaKAQIV8R9zy8hHjFMKv MtfTaICEo7G2x/KLhs20qcpKTe2pGkj5pAmeRCK2KtaY+K3mfJcJW4Cchqv6Cc3SbiOKg5Cyj WIzWAlTpHhNJJdD/7UdFKP76U5ka0AcjgmnSylZj6f6d9Z3HzklBnnFCCZ0CvEuEzTICYXIxC r7oQERNUs9tETo/js3nNih5wcVWQ8qeBOPu63Q== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_err() instead of printk() for more consistent output. (prints device name, etc). Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sb1250-duart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index 329aced..655961c 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c @@ -663,7 +663,6 @@ static void sbd_release_port(struct uart_port *uport) static int sbd_map_port(struct uart_port *uport) { - const char *err = KERN_ERR "sbd: Cannot map MMIO\n"; struct sbd_port *sport = to_sport(uport); struct sbd_duart *duart = sport->duart; @@ -671,7 +670,7 @@ static int sbd_map_port(struct uart_port *uport) uport->membase = ioremap_nocache(uport->mapbase, DUART_CHANREG_SPACING); if (!uport->membase) { - printk(err); + dev_err(uport->dev, "Cannot map MMIO (base)\n"); return -ENOMEM; } @@ -679,7 +678,7 @@ static int sbd_map_port(struct uart_port *uport) sport->memctrl = ioremap_nocache(duart->mapctrl, DUART_CHANREG_SPACING); if (!sport->memctrl) { - printk(err); + dev_err(uport->dev, "Cannot map MMIO (ctrl)\n"); iounmap(uport->membase); uport->membase = NULL; return -ENOMEM; From patchwork Sat Apr 27 12:51:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39E0014D5 for ; Sat, 27 Apr 2019 12:57:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AD8D28B2A for ; Sat, 27 Apr 2019 12:57:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E98528B90; Sat, 27 Apr 2019 12:57:02 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 CB6F228B2A for ; Sat, 27 Apr 2019 12:57:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbfD0MxH (ORCPT ); Sat, 27 Apr 2019 08:53:07 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:57935 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbfD0MxH (ORCPT ); Sat, 27 Apr 2019 08:53:07 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MNss4-1h9I592Io4-00OFB5; Sat, 27 Apr 2019 14:52:39 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 07/41] drivers: tty: serial: sb1250-duart: include instead of Date: Sat, 27 Apr 2019 14:51:48 +0200 Message-Id: <1556369542-13247-8-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:rdRXb5foI78ZUKXg0PVAe5Z5nzYlAxuzsWdK2nGI/ZCG+/6jRlM hI3kp/kBUUgLKHfqLAS7fc8k7GQ2ADy4ZKXhqdqZiryVc7Z/Z2r9L5PNnJpvCGJ5Wm3QKlp qfPO4bQ3xuErAjl1GwNDMV08O2NC44IuFF/UesW2Ttt/YM+Ee5ZbuxprWyPUKJV4WjcRcmA KbeNYOb/RogJgZxW+H2Qg== X-UI-Out-Filterresults: notjunk:1;V03:K0:uIkJBFuyWwE=:my0C5wt5HQzdkDWW3sqLjW G57X9rEDzrdejwTIohdfyXbnVkKKkUjsq7O2WO6aaWwA/K7asaaqwwpANJiqlYwmtNzUe3m2F dIy98aX9m8AzimgrUpqTFcjmsVSy5jVNnA897BjXITdiOKUbqhDiJ8SEfxopoVvXA0ci4pE/u sCpkkmo4B6+eALwD3PacR4l75/GBQIcgR/X9YlludU/jwMa2Liob4BAm+iUTx6dTWwQyokWeE 5ueRRrNwERDVxlERN61XurD0oaRK6EZk3C+alaLfFflaumVLpveKjf8NF9QNOKUCoI5MVXyiX HXunQn4iVV9oEPQo+yLEIGF4UfEE0Rsd1GkU6LkB/+Odbn2uQLNNWiC8KWt07Y56oarXOxrDk lA4uTn5RNuonkl8BJC6IAyi1AfCnyQmAgAOJlNSl4m+3PYHPhOrGjM7sgGTlh19tXj+5/CybH AVSJ2WFmYCNhq6mW/70XSDtRxr/UK1p1rzHbSTsjFAmr4I8RVMaqj3ZxfFotbghjdQK1581Pv 69TkpSYev0ozeW+8xQuT5XGyqbrpcxKEzP7NDPBjAjIAKmwxFXVsCjrsmCQi802n4t/j7rgtj p2/1WTI2ZaKz4ftVg0fU4hcU0pFIksjotyumR0cs9ECKOFII7ztSji+wY2fpiuHhZ8jQiu3Va 80px75vPXYZJQn8SviB8k53dJGNllXCrNlg32KHH9lod8kduYDxsK8NA4RIZxyaO3IOTafLNX tjDPR9hNlZyMzNBlAyzerGiY2oMGtk33LyAGRQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warning: WARNING: Use #include instead of #41: FILE: drivers/tty/serial/sb1250-duart.c:41: +#include Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sb1250-duart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index 655961c..b4342c8 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include From patchwork Sat Apr 27 12:51:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920353 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66219933 for ; Sat, 27 Apr 2019 12:56:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 576F028B2A for ; Sat, 27 Apr 2019 12:56:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4ACE628B90; Sat, 27 Apr 2019 12:56:31 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 EC35728B2A for ; Sat, 27 Apr 2019 12:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727649AbfD0M4I (ORCPT ); Sat, 27 Apr 2019 08:56:08 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:40151 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbfD0MxK (ORCPT ); Sat, 27 Apr 2019 08:53:10 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MmDAW-1gu8kq1m7s-00iDvn; Sat, 27 Apr 2019 14:52:40 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 08/41] drivers: tty: serial: sb1250-duart: fix checkpatch warning on printk() Date: Sat, 27 Apr 2019 14:51:49 +0200 Message-Id: <1556369542-13247-9-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:9XC3q0bfB2HQ4mApDU4u33n5sD/YoC7EqQPmqP5NMOedGA7sE7R zQ+4UMW4bXxRANtgf2zvHO2GKXDxkdKE28JdO/iNudeY0F3mJ+xc3fTNvs7ITqMXpD+h9nY QJb/I3M0+a59qd+LyzEcKpCXtBXjQ/BRgErxc0fambEKaAP14TyYVth7y55V4vy+3k5d+oN x/fGxgcPqoZSgK+QJd3pA== X-UI-Out-Filterresults: notjunk:1;V03:K0:KbQ0fHA3Nqk=:FuSxcrnKlCstL3CnqMetR8 enSY2gm0q2GMzPD3zuPC8fZO7HmPN6yxLTvM8eVFp60ICRPcNK4tMFyvmEXAwQhCqV+QlhVfY /3SomP72AOXBFjUdm37A6u738T8AWaYhzD3ax41xd/91uO6TvCLXB01NFygTZ69KjGGvd6dHl J9lyE8nv3ouQZE4YSkwJ+QPVxRnzV+nPfZBZk/QPt3B8dqdrBa8sVikNqDUZSkcX6lYQS36SE LOscWWeMcd9cDI+xfMIg49C4I58k/YvzfJVXt4DERZ2OqnsDVF39SPQ6mxZd8kyZyvkWY68FT v4aBhQVWDfpD1t0GubgtmYzo8UOl2KV+/SB6VWAzR3um3S2sxVGVPm3DwToX97W+XO2x/IxZK Q6Pr1u8NIEMSywIsghBEkavAFQJyp6Kw1JS9qBGMdHI80KFXdjgfG+6C3hhkvcy6C1d4Y3nMS g+SUL9XMx7ynle+l8ySONYsf3S9/5LAeIgUVPU0xC0OjIcIwKL5yM7en/m6fRkNDK5yzev23m aXQatsJ5bHJbeQqA6Vbp/dppRd+sjlJA37mRBhWORrP0GnCiSK/iBZGK1z624u2RV/axQxVU8 FgXt6VT4izE0gGVOenS522mBiI0JYa1/T+aqrIxVh2Mgd9NqSega9IxAQlHRGjbwRynjJt5Sg 1101agAP9tCRr5Tje2tMwCcYDgbVyx7BPu9adznbugp+wmE/O4zeZ31tCdtTIo7gfOhkLPJ0f XXLVpK9o1Fyph8MTqd6Mt+RVaDYvSrfKML+CcA== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP checkpatch complaints: WARNING: printk() should include KERN_ facility level #698: FILE: drivers/tty/serial/sb1250-duart.c:698: + printk(err); WARNING: printk() should include KERN_ facility level #706: FILE: drivers/tty/serial/sb1250-duart.c:706: + printk(err); Even though it's a false alarm here (the string is already prefixed w/ KERN_ERR), it's nicer to use pr_err() here, which also makes checkpatch happy. Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sb1250-duart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index b4342c8..227af87 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c @@ -689,13 +689,13 @@ static int sbd_map_port(struct uart_port *uport) static int sbd_request_port(struct uart_port *uport) { - const char *err = KERN_ERR "sbd: Unable to reserve MMIO resource\n"; + const char *err = "sbd: Unable to reserve MMIO resource\n"; struct sbd_duart *duart = to_sport(uport)->duart; int ret = 0; if (!request_mem_region(uport->mapbase, DUART_CHANREG_SPACING, "sb1250-duart")) { - printk(err); + pr_err(err); return -EBUSY; } refcount_inc(&duart->map_guard); @@ -703,7 +703,7 @@ static int sbd_request_port(struct uart_port *uport) if (!request_mem_region(duart->mapctrl, DUART_CHANREG_SPACING, "sb1250-duart")) { refcount_dec(&duart->map_guard); - printk(err); + pr_err(err); ret = -EBUSY; } } From patchwork Sat Apr 27 12:51:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2DE4B933 for ; Sat, 27 Apr 2019 12:57:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E14C28B2A for ; Sat, 27 Apr 2019 12:57:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1178B28B90; Sat, 27 Apr 2019 12:57:25 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 B6AB628B2A for ; Sat, 27 Apr 2019 12:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726513AbfD0MxG (ORCPT ); Sat, 27 Apr 2019 08:53:06 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:34529 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726470AbfD0MxF (ORCPT ); Sat, 27 Apr 2019 08:53:05 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MVNF1-1hBGZC1Cwp-00SLNE; Sat, 27 Apr 2019 14:52:41 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 09/41] drivers: tty: serial: sb1250-duart: fill mapsize and use it Date: Sat, 27 Apr 2019 14:51:50 +0200 Message-Id: <1556369542-13247-10-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:ZaCk4lb7tsU+VMSXb76laO+FYz7IB7DvruPd8DW8Z5VN86cLAXx XoTjgpy1D4cW0l6Dtk8ovOsbJ8N9Wa/Bbip0AWVSYaXLx73ljAgB+eT7NLTxRv9yXwxk0n6 HH2/FDKHKTK7DJe3OrFZeO4xRkkEqT/D7RK5KNlvmu7PNcsk+uX5W9PhxlgNSIsAXElPf5S ey1fWSh+9w6GIdr1VGyZQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:bMjmK7y/pZk=:+AFfLGXZen+R/LjlG6zSk7 L8sUEG8PAms3y8zIqVAQwMY6qAqR82Lr0rV3bmYkKN7tHlDRaITbqgcrePCA9GhxzAAamUqAf YwUlxTo4PLwjN1ylObX8wcBa9n6x6fJFhwBBYNjLMxo2rfYeunsf+B/mSAmul4qeuDFXvTiJR rLJjI4Q5l7VTPJ5zet72iWe0Hlp6PHbzAvsjIEeuOp0SraT4dJbsI7FZwjziDhZxH+ATmIsbb Kql4oUhkX+us1ZmJ42xUQasNo8zIArVrpR8vPsLM2jB/KzVDVkBjOTYmsByxB6ebMmMZFuPQd Q1ynq6X0xmA9TnjqSxTZikf1QA00We/n674kmX1LPWfbLz9t1njHTRpVxCALOyNjl22t9oqC0 X5HvRIzJpn99vxUo1kTCGnHvD9Z8ouFu6TplGDfMsbVcUxgipevllxBYDC6h7bNmKhBjqnTMK 06KakDCYlO0MY5EqGM2o5YxobEmB4gMoCiId14JTpNmX/F3DYudyaFLE0P+lWuFO7tUdgIZ/p hgGMynJm3bUU5Gt08dqMxN+WABde7p7fXqouDHErv3RZaOoAz6dcjciU+wuCblZWxT0OC28oP 2u+KrAW0cbW4rM3u3mhzvA4/EA+YrH3HZHdGpWT3e9DlT2ljYYgQBAHO0cTMM/hSp1MuYkjdS 41dTTuSXboMqixDvStEni4kBMKHteWCKINqCGhSJZBVy3lEq2Rb9jsrRZemdRp4Vhj4RMcfhE Fxrt899EKT3VTfQKp4V20bneFn76TA5cuj+Bcg== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fill the struct uart_port->mapsize field and use it, insteaf of hardcoded values in many places. This makes the code layout a bit more consistent and easily allows using generic helpers for the io memory handling. Candidates for such helpers could be eg. the request+ioremap and iounmap+release combinations. Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sb1250-duart.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index 227af87..1184226 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c @@ -658,7 +658,7 @@ static void sbd_release_port(struct uart_port *uport) if(refcount_dec_and_test(&duart->map_guard)) release_mem_region(duart->mapctrl, DUART_CHANREG_SPACING); - release_mem_region(uport->mapbase, DUART_CHANREG_SPACING); + release_mem_region(uport->mapbase, uport->mapsize); } static int sbd_map_port(struct uart_port *uport) @@ -668,7 +668,7 @@ static int sbd_map_port(struct uart_port *uport) if (!uport->membase) uport->membase = ioremap_nocache(uport->mapbase, - DUART_CHANREG_SPACING); + uport->mapsize); if (!uport->membase) { dev_err(uport->dev, "Cannot map MMIO (base)\n"); return -ENOMEM; @@ -693,7 +693,7 @@ static int sbd_request_port(struct uart_port *uport) struct sbd_duart *duart = to_sport(uport)->duart; int ret = 0; - if (!request_mem_region(uport->mapbase, DUART_CHANREG_SPACING, + if (!request_mem_region(uport->mapbase, uport->mapsize, "sb1250-duart")) { pr_err(err); return -EBUSY; @@ -716,7 +716,7 @@ static int sbd_request_port(struct uart_port *uport) } } if (ret) { - release_mem_region(uport->mapbase, DUART_CHANREG_SPACING); + release_mem_region(uport->mapbase, uport->mapsize); return ret; } return 0; @@ -812,6 +812,7 @@ static void __init sbd_probe_duarts(void) uport->ops = &sbd_ops; uport->line = line; uport->mapbase = SBD_CHANREGS(line); + uport->mapsize = DUART_CHANREG_SPACING; } } } From patchwork Sat Apr 27 12:51:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2AB8414D5 for ; Sat, 27 Apr 2019 12:57:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CAD828B2A for ; Sat, 27 Apr 2019 12:57:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1097928B90; Sat, 27 Apr 2019 12:57:05 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 AF7D928B2A for ; Sat, 27 Apr 2019 12:57:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727131AbfD0M5D (ORCPT ); Sat, 27 Apr 2019 08:57:03 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:55791 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbfD0MxH (ORCPT ); Sat, 27 Apr 2019 08:53:07 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MBltM-1hUJWA0Zhs-00CCVD; Sat, 27 Apr 2019 14:52:42 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 10/41] drivers: tty: serial: sb1250-duart: fix missing parentheses Date: Sat, 27 Apr 2019 14:51:51 +0200 Message-Id: <1556369542-13247-11-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:Q5d+R5/xof5LSpkM+m/1QK4rIat5cet+2kq+5TbMlzlAg7YOwcq yY6SxH8FWCXU0xZpYSh06YbjnruYS3jvbIaTQGqHoabIXLaqLV16hsMLD2TgWS4RStegv55 BXylfzMhBa4VLDqOgexGnNJRWU6fc3oOK3V503qwx9kOQsSqkjZe8MoxRvmw7LEmLadmc7U bud6UfVRg0CpivgeZa72w== X-UI-Out-Filterresults: notjunk:1;V03:K0:vacU+lH9z3Y=:pyr1jcpDGvApaYEzFf7e+R TMve7dv5wGRdKDhjI8oStSB5dn5DoxuIjQtwxI7jTd4ue0WswnmOCAVKClxkf4W5Y+po1lpzp uy6mxTJAhaqkZ+uGwup3aHiE2yXSyK5Dtp59G6H8wjH1xJxWJJe3rh1QuItg4GGwqOxe7ZvlT bCfCaP+FUICSNHAr7GAy80cRej9Mbw8LQ/CAIWpG2FHp/HNBuaCWY5bg6pgzDY6U4+Mpk3zpX NFS1TFEHN4C1TorFOl1ieIq8+33dawCeqWbRy63450HHNBOxnTXMXgXVZ2dGvHt/MaKHK5QHX znNS5++8zZ+FgewRGYerTgJaPvxtSpjOrO+jaVu3eScKrVacwFh6aPYL9Tg1gWYFFwQsJ6CzA iKmAZSq55bvXg+JjYDMB6zLZ4DgKDCfJKq+793jpqfro5b1srUPD1zx3NgseUD9Kp6w3sqboX Jvu9ZKFLbaF+cSRGF+A7QScl6NPRPACxYAB2L6P0+kWLYwR7X+40GC4Dw4eh8YRnCKclBPBig 8U4uiH49D8vlepRn823eKH2LdKEGXzfXXG8QTIyXa/vacZIxHEo6Wg3QFLTaPFTQxybxeHFMN sVhpJgAzc594zwa50x10eL253pPhsMkF5H509I0vK9nGkC85rsoXTRr/Co6LoNNGj9pnxWgK9 yOIYFsO9w0GUdP/baMxqZ6uqvZ4AtEaJLlWSshjX/lDO4KbZaj05oKWIdPmB24fo9yrxwcOFJ I5chlHAJ/2z+EvXqOzAr/sxxn02wqDKKYoAVwA== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warning: ERROR: Macros with complex values should be enclosed in parentheses #911: FILE: drivers/tty/serial/sb1250-duart.c:911: +#define SERIAL_SB1250_DUART_CONSOLE &sbd_console Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sb1250-duart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index 1184226..ec74f09 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c @@ -908,7 +908,7 @@ static int __init sbd_serial_console_init(void) console_initcall(sbd_serial_console_init); -#define SERIAL_SB1250_DUART_CONSOLE &sbd_console +#define SERIAL_SB1250_DUART_CONSOLE (&sbd_console) #else #define SERIAL_SB1250_DUART_CONSOLE NULL #endif /* CONFIG_SERIAL_SB1250_DUART_CONSOLE */ From patchwork Sat Apr 27 12:51:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920373 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94ED814DB for ; Sat, 27 Apr 2019 12:57:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86C3928B2A for ; Sat, 27 Apr 2019 12:57:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A78828B7A; Sat, 27 Apr 2019 12:57:25 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 22FE328BAB for ; Sat, 27 Apr 2019 12:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726496AbfD0MxF (ORCPT ); Sat, 27 Apr 2019 08:53:05 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:49953 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725942AbfD0MxF (ORCPT ); Sat, 27 Apr 2019 08:53:05 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M26iv-1hMqrC03Wz-002bb0; Sat, 27 Apr 2019 14:52:43 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 11/41] drivers: tty: serial: sb1250-duart: fix formatting error Date: Sat, 27 Apr 2019 14:51:52 +0200 Message-Id: <1556369542-13247-12-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:+TzVLpdAa88s4dLeOAxWyCsRhuc7KaUZKNLF0uRArPgYGfXSgiH Cc2vSSp3JHtH5Dh6TLARezDiIKDVv/NGSmiD/ku3dsWnfWOrtj1Cfj89ntRTXnSvx6PBKgU dt1TF7JLIo4mMJjyQ165GdSVmp05k1wOQx9x8rk+vVa9HNdzhgzqFQ2ZALqM5/sIDIRqkKv zpE63Uj8QixDSf+H4FfiQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:7g9mhemK6rI=:1LPea258+vT4cAu97il+UN TYKyF9QgPM9xIe6eeQ+jqNe+ggTMLP2Rvkb4j9U9H13Sg9CbVn9iCrF0YTfPvJy7st+0uGM2f /PnRFLO51z8114t2VgJaesPsgRavI/NG+JNJ7cfluxQbMaKGaxT6e/dwtJS7cjr1YYOomqA9G muP/UMza5Daoz+E60ichje3jvTqidA4lMSrQ9I6Hysh36D1wrMiCAB8NPPvc4nrvaddLXw6wB HgP1Z28SnAs7F4M7EpvU2+lQ0OTn37drJgeY/1adD+7p8We3CNEdSVlX/aiCHuYBdhtA0tQwk twP7c4eBkXAVXYagsNKW0MBlXlR0YW7fkDWkpusCcqgmZEquGN++8kKA5YtYIXEcg1RQIv5ze 3sYNpA8wkk3GGqvshvtdRF4i/V07DDAKHjaZS4rViY5umoot7vu2gWZ7lETfiboO5z0AnKiNW ArDLwY9233EwB1kTHm54Jg7uCj6lRpmvrGsTo5d38MvHFBdNvTBRnyt2zIMulQmJtFb8kkKio L5hyUjTr2yPVMh8mBfg+gFuzlyXZDST0R3Rsxc16FX1n2PRzy15BgDF5VnY6vbekE+syIAUnQ CpezAGe8b0r4rC4XtzPF0T9lR/Pa1UWdKJH90iIIxuaLrBDvbaT57qKKbgRo+xkQtguPp6B41 KnkPQ1UxL/FbNXzdFiuI/RSGrM7xIsl18lv3lduPbUzSCDcj7qPBT1cj99Wx+ndaKrPl0OaXi dDx2xwj2GagsyKcjT96JpuA4aPHWH0zLebvvLA== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP checkpatch complains: ERROR: space required before the open parenthesis '(' #659: FILE: drivers/tty/serial/sb1250-duart.c:659: + if(refcount_dec_and_test(&duart->map_guard)) Just add this missing space to make checkpatch happy. Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sb1250-duart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index ec74f09..0023ed0 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c @@ -656,7 +656,7 @@ static void sbd_release_port(struct uart_port *uport) iounmap(uport->membase); uport->membase = NULL; - if(refcount_dec_and_test(&duart->map_guard)) + if (refcount_dec_and_test(&duart->map_guard)) release_mem_region(duart->mapctrl, DUART_CHANREG_SPACING); release_mem_region(uport->mapbase, uport->mapsize); } From patchwork Sat Apr 27 12:51:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE1D0933 for ; Sat, 27 Apr 2019 12:57:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0C7928B2A for ; Sat, 27 Apr 2019 12:57:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94FA928B90; Sat, 27 Apr 2019 12:57:03 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 3A05928B2A for ; Sat, 27 Apr 2019 12:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726578AbfD0MxH (ORCPT ); Sat, 27 Apr 2019 08:53:07 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:60007 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726472AbfD0MxH (ORCPT ); Sat, 27 Apr 2019 08:53:07 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MWRZr-1hIx843db1-00XpY8; Sat, 27 Apr 2019 14:52:44 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 12/41] drivers: tty: serial: uartlite: use dev_dbg() instead of pr_debug() Date: Sat, 27 Apr 2019 14:51:53 +0200 Message-Id: <1556369542-13247-13-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:iKlivJb6BzLykaezfbMDcQZdn+ix2ooVfsC6tW0pEhl98LAPDeE JRRVgVcfczmetBZDaIj6bTxrIsuLJZWRq491LJqAx+h9NbgwnoIDbHxcrTYcX/2PcSRokum actVckV0OuFGgmAK7gUuP0HXW1/BSfc94DTxmg7pJbcD5SZVKeVCxYgAJklKBryYGvN1CJo ibF50Jd1+Py/n87SQbwsQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:u5P2g8JRH2I=:qGaH8ryqR7sUqOGrLtEnq0 2WfUNdHCnLg10s1ecEg65pn/njtDsMqOeP8gNEpxCMTzcWsLT9VA4DU3CEBVa3HCzjiKJcfHG eTHURytwvHGp7s9jZVE5iai0hKZDLmT9tnCMG0O5bDybrILrbz2OaCok/sor106qS90eCocZA WHMkOGw0j1qJeCv0leK1Z4fuVANM96a4sKdqYlnLL2v1g0Yy7Qv2BA/TyHUBS+K7r2RGhcM93 TQCZfinRHziPPxnqY8q6GJipcuPVsuiLqzJC0H8npIwN2FnPLLAPYV/vgXo00WkXMfxjp7mWe s9cDM9K+72I9v9RY2NCSZ4HlPW78uNjLRoKXH9UI6yEUBsHch/+0OxFFZTB2NnEgI5hM4CxaA aW2LQCsOERK9kjsOnJFUi/mvk0axc5fq8TDylOAwQOSe0Nkpla45hTAsiHS221ZrBXCbrV5zA vp2fnOF01p7Eyj5ee/bkdEt+KrcA0YHPLrsTPFX/ReZeKT0iqAavOA1IICkPrbO/J9OgpkqPM +e5kU1Y2uDllo5BJ52L6yldoO9jgsv77olPmdDGKDcAfFx4RUBuMjYer7MOaRBSCwUzPaMwsD tgJ7G6LdN06zK0oIyp9V0oKzUCmMe1VTLSZaAIbSfUawtMPghR9Z49rdDsyfAYZ2DohkJIPTF xQn1Ht0ha1HyECC5uOoj7J38mbBQIygbj3uOhqVZj78SrVH8ls26OFebX6TDxvvF5GTZrl2n3 rnTYYYquT1fzWtIJQj/tIvkv4pDPeDZLTev6ZQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_dbg() instead of pr_debg() for more consistent output. (prints device name, etc). Signed-off-by: Enrico Weigelt Acked-by: Peter Korsgaard --- drivers/tty/serial/uartlite.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index b8b912b..44d65bd 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -352,7 +352,8 @@ static int ulite_request_port(struct uart_port *port) struct uartlite_data *pdata = port->private_data; int ret; - pr_debug("ulite console: port=%p; port->mapbase=%llx\n", + dev_dbg(port->dev, + "ulite console: port=%p; port->mapbase=%llx\n", port, (unsigned long long) port->mapbase); if (!request_mem_region(port->mapbase, ULITE_REGION, "uartlite")) { @@ -519,7 +520,8 @@ static int ulite_console_setup(struct console *co, char *options) /* Has the device been initialized yet? */ if (!port->mapbase) { - pr_debug("console on ttyUL%i not present\n", co->index); + dev_dbg(port->dev, "console on ttyUL%i not present\n", + co->index); return -ENODEV; } From patchwork Sat Apr 27 12:51:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920359 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2ACC1933 for ; Sat, 27 Apr 2019 12:56:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AF3D28B2A for ; Sat, 27 Apr 2019 12:56:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E87F28B90; Sat, 27 Apr 2019 12:56:40 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 ABF5828B2A for ; Sat, 27 Apr 2019 12:56:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbfD0M4i (ORCPT ); Sat, 27 Apr 2019 08:56:38 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:41983 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbfD0MxJ (ORCPT ); Sat, 27 Apr 2019 08:53:09 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MPXpS-1h7dOA2vUw-00MaDR; Sat, 27 Apr 2019 14:52:44 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 13/41] drivers: tty: serial: uartlite: fill mapsize and use it Date: Sat, 27 Apr 2019 14:51:54 +0200 Message-Id: <1556369542-13247-14-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:HsinThJYSBbvZXPfm+0O6kKUO+qcziVpNnYsjWaEzEiMEg9DSuK dNf0rb/MCsWgo6VR685d/dBzsntfhucM9zdpec9KJhVPsvgZXFU+FHm2NA8+p9uNUoUt2t/ 97+mu3GZ0mzF7ACNEs/tQdl8KcWi9bu5JVWLna6RzeYMAWm9wnFG9XjorOOkAQTF4hi7dJB W8BggkCEpEPmgsUJa1QKA== X-UI-Out-Filterresults: notjunk:1;V03:K0:M2CupHkdprI=:t4eNWY5bS1vu92cW6qDWEU ADcR+6Kg7dcevcZPeO14Esbr4UB1TouOkNfW01O86yvYnijA1sc/wnjYLbAFIt0rwXMyPKNGU O/PioqNftTLrLR+ttFEWixd+2dV3vE30I4Ge56dkTfvUCXNuMnkxzEAZskQfusFSpau0qMp3m 4B3eZ7QEbqsajYkwU+gX1wSdVckm7ohYMvPl92gqYlvK0WbrvXhR6X59BXzlQ+TeldpXpLkpt qxNlzP/6DsfSHkrfCntzbFaD4FkxHXnhDUDngfu6J8I1XCkKuDwY7JEfPQIoyLB7Ao7TKq3gj WIlU9tIg7jI/cufHOP/EkSmv0xP8qavjGQazjMDDC57vd+Jovtnwcp3n24xxplR6xxuT5tAwY Wp9TEeiF0rZwe1z9tF6QztbHm2UaaNo2wv6I1A+IN6pVUFBFul9CnwmxQG81GmFjrhxWSgUtJ IMMdF66BcOi48fIhcMfXtDWMpWDXC+uWdiPjeWhQk1RUYc6PrVeGQOYfhDHJelX7nkF9fOJvN yjiW401cuK4NbC6nHAjZULv7zT8Ckza4ID+/BlH0wUfNAkj6i28hgOSsg58c6b5fMCXjyhkJL 5R5FYtY9cs3sxNW2/qp+GIWH0qY3L7sI0LyA/aC3gm70d0HNqsoPZD49KGFdJ75JCDJrwlJ+l +MfViqK0FaiihFHJPKgf95dVxASBqvUqvWXYZbU0XDUpXNVGBfQQpp5jxT6/y8t/byI8M1vTQ ll/ztjVh1UtTy87vhydhWCwlP4maAW5p4lwI3g== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fill the struct uart_port->mapsize field and use it, insteaf of hardcoded values in many places. This makes the code layout a bit more consistent and easily allows using generic helpers for the io memory handling. Candidates for such helpers could be eg. the request+ioremap and iounmap+release combinations. Signed-off-by: Enrico Weigelt Acked-by: Peter Korsgaard --- drivers/tty/serial/uartlite.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 44d65bd..c322ab6 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -342,7 +342,7 @@ static const char *ulite_type(struct uart_port *port) static void ulite_release_port(struct uart_port *port) { - release_mem_region(port->mapbase, ULITE_REGION); + release_mem_region(port->mapbase, port->mapsize); iounmap(port->membase); port->membase = NULL; } @@ -356,15 +356,15 @@ static int ulite_request_port(struct uart_port *port) "ulite console: port=%p; port->mapbase=%llx\n", port, (unsigned long long) port->mapbase); - if (!request_mem_region(port->mapbase, ULITE_REGION, "uartlite")) { + if (!request_mem_region(port->mapbase, port->mapsize, "uartlite")) { dev_err(port->dev, "Memory region busy\n"); return -EBUSY; } - port->membase = ioremap(port->mapbase, ULITE_REGION); + port->membase = ioremap(port->mapbase, port->mapsize); if (!port->membase) { dev_err(port->dev, "Unable to map registers\n"); - release_mem_region(port->mapbase, ULITE_REGION); + release_mem_region(port->mapbase, port->mapsize); return -EBUSY; } @@ -649,6 +649,7 @@ static int ulite_assign(struct device *dev, int id, u32 base, int irq, port->iotype = UPIO_MEM; port->iobase = 1; /* mark port in use */ port->mapbase = base; + port->mapsize = ULITE_REGION; port->membase = NULL; port->ops = &ulite_ops; port->irq = irq; From patchwork Sat Apr 27 12:51:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DD27933 for ; Sat, 27 Apr 2019 12:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F368728B2A for ; Sat, 27 Apr 2019 12:56:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E778028B90; Sat, 27 Apr 2019 12:56:49 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 9F3E528B7A for ; Sat, 27 Apr 2019 12:56:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727021AbfD0M4t (ORCPT ); Sat, 27 Apr 2019 08:56:49 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:59117 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726611AbfD0MxJ (ORCPT ); Sat, 27 Apr 2019 08:53:09 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M7JvQ-1hPrWb2KvE-007on1; Sat, 27 Apr 2019 14:52:45 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 14/41] drivers: tty: serial: uartlite: remove unnecessary braces Date: Sat, 27 Apr 2019 14:51:55 +0200 Message-Id: <1556369542-13247-15-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:HNae7PjeMCnI/fvVc5Vcn1UOQeHvus2cVjs+T9ya7m11++AcCzd Uql6NzhkB+oflvXltCOBqXEgUK5TSZ1hR8ffTPAYNbY/DvgKZZPbUn10MDN7ED70JOmLeJq 1lKUaLw3MrCqMLhiaWDxWKIAGg5En0Qog7emS9vPAAPWKLAw46CPLHZiyXdcej2Fh8Ze+9P mQVxOOn3Z+MSiWhjBR3rg== X-UI-Out-Filterresults: notjunk:1;V03:K0:3t+Nw4JPEJE=:S64AQuvF2U7F25wvtc5XCm nSGvWcPttt+54CgkTz8WBMvqDdTZV1KbKhC11oN+8c/mvl2xjunvnZND4PK83mMayEeOKveGL Rd93v52I09dnYOeNp45XUqp/QksQLz9BPG1DLrjEYZz+ZHPu+6Pe0Rw0dPQ1h1bZtuLIyI8JZ WKqry4ildM4OTi6jM5nTBC+ZbuVxxi0Ov25WThAFtVMLRA+VFSGJ9FwUj5E18pRLO4JnVzA1A /At2a2dq0VbZWlVppOKC3+Wri1v58c0QMeOGg/TTlUbU51qerw8V3YktudCxe4coHD947lYRX hVMg9GHS0eWGn0Zi0jczAgtOciNOv6laK9FPaHZCa/UocjUZFekiZ8I6192ltw0IapPP69sBO ooWqzCwPdibwHdZEY1wGSmtnUFvvz1hDSiMogIa4x22PefBAr9KyHtc++v1P3qbPTaEGS+Eun tEzlO3f6xNCtXADxjqVYUZ3hDlrNQHHJsQI/I9gXDEaMMqxbQKYBUlU4mr+fc9XQ3jwDyNPdP GrbJW24PeowT2zhfXHQ51QUSwk/DyHpQtZxRjBLtbkqXILbsge0ytPII9Peb1wX53WnHrZ1EL uclEJEwocjxNPOvn1Qup74SBDKN2AM7ANqcGrVzZHb8TqKJw8Ksp/NvRXV6WwdAsJOh3ncIrl e2WYHXjOEtHoUrV3DEnBtI+k5GjpjNJViBLGkrTBGEWwCDP/t4KuiepcU5sAE3gMuV0ryxAFc 7LjvLNQI4W2HVfnMPR699cwLCgmbn4KrVtdc/g== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP checkpatch complains: WARNING: braces {} are not necessary for any arm of this statement #489: FILE: drivers/tty/serial/uartlite.c:489: + if (oops_in_progress) { [...] + } else [...] Signed-off-by: Enrico Weigelt Acked-by: Peter Korsgaard --- drivers/tty/serial/uartlite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index c322ab6..4c28600 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -486,9 +486,9 @@ static void ulite_console_write(struct console *co, const char *s, unsigned int ier; int locked = 1; - if (oops_in_progress) { + if (oops_in_progress) locked = spin_trylock_irqsave(&port->lock, flags); - } else + else spin_lock_irqsave(&port->lock, flags); /* save and disable interrupt */ From patchwork Sat Apr 27 12:51:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 59C3A933 for ; Sat, 27 Apr 2019 12:56:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AB6128B2A for ; Sat, 27 Apr 2019 12:56:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E8F128B90; Sat, 27 Apr 2019 12:56:06 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 E0FB728B2A for ; Sat, 27 Apr 2019 12:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727465AbfD0Mz4 (ORCPT ); Sat, 27 Apr 2019 08:55:56 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:43095 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726814AbfD0MxL (ORCPT ); Sat, 27 Apr 2019 08:53:11 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M3UhO-1hKv3E1nDW-000feT; Sat, 27 Apr 2019 14:52:46 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 15/41] drivers: tty: serial: uartlite: fix use fix bare 'unsigned' Date: Sat, 27 Apr 2019 14:51:56 +0200 Message-Id: <1556369542-13247-16-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:H9Hq+xMuwfZXnigABXZrW477+wXowxTgyBBLY0HAV0mnCDYh/e0 TH2w4PbDOyXyM86Lq7DloZ+B8ibFAqHgCXXMWMGOq9YWJ3Y3vlKsyrAZnSi1E5Li5qxc0Ar AY0Hr5JlBrCnebDS4GMDfCcj7dIYVLdfUOg6Bcei5qLQJLaC/QfWMzWDYdXhqXpmqWR3y/g yAdYT/Wa4x9gI+B2VhpoQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:R72cmKom1+A=:uOo1mvuTVbiHsgBqriCUht 6dY33ALRFs0OZberAHetXVBGAXNDyVP94BPwKbiwUt//WjlmiXpuYjDhj83S+8UluwqNM4viT EUygzqv1xc+QMQRr3xF+lNxXktgoicejoz188iDU6b6S4cPL882d2sf9ZdLlnzup2HcwAI7JS 6x49799SF3XTPO+XuJ0llY00fkPDfn4uA39oeLLrbuv3geAjo9xAyCJmxDBfbAu0sxbsCH3zP YNow0lDzCPTXwDoEpirK5YCyPkKdesbKHHbH5k0F2gyAIqhE3ImwDRUs+f+pU5My8q2yh31GI 76c1xKk0HKz7/oSjRMjQTgKb4j5f+Jg0YiHuRH591ObYF8o5/GcnSx9sK1sbrQ3bGRiwU/kJb zM4Rb2dpvvIIG5jmO7pDHpI4gtoSrFsbFUAdOkM+tlLe/t3+7X8YK2TGEB77CAte7MikaF2uS gX6vi6fZ3vRVEjT7A9bPa9w62Saicp1FrW829mcM16x64QqxG9d1O83+q8mdDGQRRdsksYT/K MuelCOp8/rAk/NmhauN9e9GIj7IDtMZONoxnPaO/FgcnC/m+/cQJnC90G6xL8KVH95EwkVKpg zS6EfdvWLefNplLeaVuRERQ6ZDLRf4dB2a36zkSg7R+K8VXdOIW155UoxoAEyz6BEetZx2KxO e2TjiagXV1RqHzcUn1fCiSg8mcHyfwlToF2LzzqlKHyMA1yBhxDcPoc54bcXj0+qVTC64YpJw rptbxTx0/wkORs6LFbtJRaPqlLPPbs2Kr5hC3w== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warnings: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' #562: FILE: drivers/tty/serial/uartlite.c:562: + unsigned retries = 1000000; WARNING: Prefer 'unsigned int' to bare use of 'unsigned' #574: FILE: drivers/tty/serial/uartlite.c:574: + const char *s, unsigned n) Signed-off-by: Enrico Weigelt Acked-by: Peter Korsgaard --- drivers/tty/serial/uartlite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 4c28600..6f79353 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -559,7 +559,7 @@ static void early_uartlite_putc(struct uart_port *port, int c) * we'll never timeout on a working UART. */ - unsigned retries = 1000000; + unsigned int retries = 1000000; /* read status bit - 0x8 offset */ while (--retries && (readl(port->membase + 8) & (1 << 3))) ; @@ -571,7 +571,7 @@ static void early_uartlite_putc(struct uart_port *port, int c) } static void early_uartlite_write(struct console *console, - const char *s, unsigned n) + const char *s, unsigned int n) { struct earlycon_device *device = console->data; uart_console_write(&device->port, s, n, early_uartlite_putc); From patchwork Sat Apr 27 12:51:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C06314D5 for ; Sat, 27 Apr 2019 12:56:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C15E28B2A for ; Sat, 27 Apr 2019 12:56:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F6CF28B90; Sat, 27 Apr 2019 12:56:32 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 F2E2C28B2A for ; Sat, 27 Apr 2019 12:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727512AbfD0M4I (ORCPT ); Sat, 27 Apr 2019 08:56:08 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:52457 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726726AbfD0MxK (ORCPT ); Sat, 27 Apr 2019 08:53:10 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MdeSn-1glaAQ1CHx-00ZjUI; Sat, 27 Apr 2019 14:52:47 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 16/41] drivers: tty: serial: uartlite: fix overlong lines Date: Sat, 27 Apr 2019 14:51:57 +0200 Message-Id: <1556369542-13247-17-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:Ck93dTfp9+M+xebhyVSLDIJuo4MjSGOjDhbkWBRUIflN7U9qSCe pUde8jE0w5A43JR5NuYza+AsYcjHeRQdVwFH5DfzOGQOqRZzgRch+fJcKukuNGfeEOytvZR 5/10Xwz0fpHNGToPKDV3mQbY+HwaGvDTud8ym7VEBca8ousV2I6zja+sNCKPIsmKUiAW4+V hJqAZT0gvkBV1/kztVb2Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:lFLVA5ANqXA=:+nwoqH7LETA5l4ZD6Cy0by 9QQxF9w7JwL9dfUQLkTSklNQAm9TDaWBKAb/AK8KrfiMTcGzLt9Ee5RiujQGuJAuFYCa25OaW PsRCxkE462T85gSy8Pd/1exhcYQsoX46KyLQ4ZKSeHvVV8tbKS/OwkFfGrRHmBQ8UlBeXLZK5 ebF4s0a/Z8QgHeSqLp8Mld3p8Su8UoV9Y8qvT6GUpcFbwp930569alSTM8wqnyrp9aFJ3bviY wC6Tzx19GZ9/leyIqE3JEmv02FWM4Ec4A6QWgiqsopsuDAzIuR2eWi4DxrYaPHzxccOjVXhW2 RfH12CPwxeEkAGqjze7Djw/S5IYL86ng+BscK9UV3x0uudrqH2DvL3151YkbTo13FkHwqeNnW DIe1MAVVKDPOOe4QN7noYVLhRj71YKuN4gMT/LJ+u880TUoLEHCWMILbm5ZFZyvlzBG6K47hU 9N57YDdSPilc+UdCPlSqXcQ4hJByXjZkI6wRREnTfmyit5sfL61G8Cy9lTvJngnoKEflZ/q/D +VkFl7qZhum7WEPeks7u2yKFDTGflXCZYn2mA1tQq+cnqN0OJ85RJZpWS9w6/wqjPbVQmeHnX K1uOze3TXyWYC56Tqwpenyo+uVz9fCc59R4P6VjWRvoYFvUN2alVsNGhQFk7qhdBWZ+GW9efn J+EJarUbpowxoppGXDdCKd50A08hfJxVUT6cLO8NZbGm/sKEm6hc8cXIke/czqdZS6Z34iUaH iiO7jtF61oWxoOCw5a6wqJbKewrFO8VHKUZg/A== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warnings: WARNING: line over 80 characters #283: FILE: drivers/tty/serial/uartlite.c:283: + ret = request_irq(port->irq, ulite_isr, IRQF_SHARED | IRQF_TRIGGER_RISING, WARNING: Missing a blank line after declarations #577: FILE: drivers/tty/serial/uartlite.c:577: + struct earlycon_device *device = console->data; + uart_console_write(&device->port, s, n, early_uartlite_putc); WARNING: line over 80 characters #590: FILE: drivers/tty/serial/uartlite.c:590: +OF_EARLYCON_DECLARE(uartlite_b, "xlnx,opb-uartlite-1.00.b", early_uartlite_setup); WARNING: line over 80 characters #591: FILE: drivers/tty/serial/uartlite.c:591: +OF_EARLYCON_DECLARE(uartlite_a, "xlnx,xps-uartlite-1.00.a", early_uartlite_setup); Signed-off-by: Enrico Weigelt --- drivers/tty/serial/uartlite.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 6f79353..0140cec 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -280,7 +280,8 @@ static int ulite_startup(struct uart_port *port) return ret; } - ret = request_irq(port->irq, ulite_isr, IRQF_SHARED | IRQF_TRIGGER_RISING, + ret = request_irq(port->irq, ulite_isr, + IRQF_SHARED | IRQF_TRIGGER_RISING, "uartlite", port); if (ret) return ret; @@ -574,6 +575,7 @@ static void early_uartlite_write(struct console *console, const char *s, unsigned int n) { struct earlycon_device *device = console->data; + uart_console_write(&device->port, s, n, early_uartlite_putc); } @@ -587,8 +589,10 @@ static int __init early_uartlite_setup(struct earlycon_device *device, return 0; } EARLYCON_DECLARE(uartlite, early_uartlite_setup); -OF_EARLYCON_DECLARE(uartlite_b, "xlnx,opb-uartlite-1.00.b", early_uartlite_setup); -OF_EARLYCON_DECLARE(uartlite_a, "xlnx,xps-uartlite-1.00.a", early_uartlite_setup); +OF_EARLYCON_DECLARE(uartlite_b, "xlnx,opb-uartlite-1.00.b", + early_uartlite_setup); +OF_EARLYCON_DECLARE(uartlite_a, "xlnx,xps-uartlite-1.00.a", + early_uartlite_setup); #endif /* CONFIG_SERIAL_UARTLITE_CONSOLE */ From patchwork Sat Apr 27 12:51:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8EC514D5 for ; Sat, 27 Apr 2019 12:55:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB29728B2A for ; Sat, 27 Apr 2019 12:55:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E79F28B90; Sat, 27 Apr 2019 12:55:55 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 4CC8828B2A for ; Sat, 27 Apr 2019 12:55:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726945AbfD0MxN (ORCPT ); Sat, 27 Apr 2019 08:53:13 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:40281 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbfD0MxM (ORCPT ); Sat, 27 Apr 2019 08:53:12 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mdvyo-1gklM610Mw-00b6vt; Sat, 27 Apr 2019 14:52:48 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 17/41] drivers: tty: serial: apbuart: fix logging calls Date: Sat, 27 Apr 2019 14:51:58 +0200 Message-Id: <1556369542-13247-18-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:74q7QZbgRgRsAUkPp9HoIcby/AiA8t4Mu2TUa7cvirQmdem+3Am 8EQGnLshuK8zT/JT/rXJ1jMsYvUFcIBhmVWtNocXE1OdQlrcN6zxnc0lOKUkbKlCtWRyBOs SfDclKxIBbTDIEFobqRgxh4RYW3wCVdlAW+GkkAV2vRB5P9CXtzp+iTfXlW2e2cAPKtq+p3 x9rgoBVikwGuHrHXLrrgQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:eYy4U1g0WLc=:NNFGO3HSiL3iJ9KcFjVqxr L5C8Q9zl9SvmSbmk/WXj0EtqOWebYE+T7FuU8NbONX8KrKJZIyetKuuIZvT8JMDBFYYByMJZS ZsFYAvVpW3OFJvRwTYlig7Z7pR26iD35iZ9qIWBGrEIbU0eFvBZQ71UaNgyABlpQP25ws5FXx zrLsNqdWLdTYHD+VbjQ2gcBFD+6RdC1lVS7GjBn6O6RXVwO/iyuYzHrqd5SEOWYe1mDV/xpcT firFlNyM/Y3UYi3z9yFwOZm/mLwOjrKLozqyAUIs5Ee1Dmld6FQR8HBR0gglIETNeESeoBwlk j+oqvl9LqtcoRzBeZIaDULJqLJ4PYBQl+ouSd6ruS0W1erDls6LCPPf+9fmou3wGiubPjT5zT ZbgpAa+a1FPjCO83yXjVKgwftQDqhNYdtBRkumaxJv167CNq/8HacT+etLB6xjbv0OqTHED+j UvHg77KbgPh+lW5z+3aUS+YSda3oF0cX02uC6pzmIguLQ6peLHzvjrLLNo+veCHi5xqdsuTc3 1tIcr/FtqrUmGyJUAz09ZrsHVYJ13qXd7jVIIkZlpH+9sVbqBaFk0ImoQJTKOflNY7Mfb14LT WYOkAkc2qSUAf3D4KAVdI2JRi0lez/a/5/g0MNrh/HEtZiDvSBJaDosnHksn31H+JuOZRTpBV XhT4gdKHIwiv+Itmb2O00YCnnIBT4FoF90IGJGwKRMu7AvSI5rBVKeCNSHQbXqFGnfcMvGqVG qH3e6Ibc4dkf9y2PyMnfIib4diOFSWqdZxE4aQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warnings: WARNING: Prefer using '"%s...", __func__' to using 'apbuart_console_setup', this function's name, in a string #491: FILE: drivers/tty/serial/apbuart.c:491: + pr_debug("apbuart_console_setup co=%p, co->index=%i, options=%s\n", WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... #661: FILE: drivers/tty/serial/apbuart.c:661: + printk(KERN_INFO "Serial: GRLIB APBUART driver\n"); WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #666: FILE: drivers/tty/serial/apbuart.c:666: + printk(KERN_ERR "%s: uart_register_driver failed (%i)\n", WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #673: FILE: drivers/tty/serial/apbuart.c:673: + printk(KERN_ERR Signed-off-by: Enrico Weigelt --- drivers/tty/serial/apbuart.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c index 60cd133..d2b86f7 100644 --- a/drivers/tty/serial/apbuart.c +++ b/drivers/tty/serial/apbuart.c @@ -482,8 +482,8 @@ static int __init apbuart_console_setup(struct console *co, char *options) int parity = 'n'; int flow = 'n'; - pr_debug("apbuart_console_setup co=%p, co->index=%i, options=%s\n", - co, co->index, options); + pr_debug("%s() co=%p, co->index=%i, options=%s\n", + __func__, co, co->index, options); /* * Check whether an invalid uart number has been specified, and @@ -650,21 +650,20 @@ static int __init grlib_apbuart_init(void) if (ret) return ret; - printk(KERN_INFO "Serial: GRLIB APBUART driver\n"); + pr_info("Serial: GRLIB APBUART driver\n"); ret = uart_register_driver(&grlib_apbuart_driver); if (ret) { - printk(KERN_ERR "%s: uart_register_driver failed (%i)\n", - __FILE__, ret); + pr_err("%s: uart_register_driver failed (%i)\n", + __func__, ret); return ret; } ret = platform_driver_register(&grlib_apbuart_of_driver); if (ret) { - printk(KERN_ERR - "%s: platform_driver_register failed (%i)\n", - __FILE__, ret); + pr_err("%s: platform_driver_register failed (%i)\n", + __func__, ret); uart_unregister_driver(&grlib_apbuart_driver); return ret; } From patchwork Sat Apr 27 12:51:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920351 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BF2F933 for ; Sat, 27 Apr 2019 12:56:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CB3728B2A for ; Sat, 27 Apr 2019 12:56:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E8F528B90; Sat, 27 Apr 2019 12:56: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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 BC26828B2A for ; Sat, 27 Apr 2019 12:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727653AbfD0M4I (ORCPT ); Sat, 27 Apr 2019 08:56:08 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:56161 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbfD0MxK (ORCPT ); Sat, 27 Apr 2019 08:53:10 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MHoZS-1hX2X90am6-00EvFl; Sat, 27 Apr 2019 14:52:49 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 18/41] drivers: tty: serial: apbuart: use dev_info() instead of printk() Date: Sat, 27 Apr 2019 14:51:59 +0200 Message-Id: <1556369542-13247-19-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:OVKGRVf0aXMWmtc1PHtqfEjiYENJhZU3hpSHmEA0npVSmInw18W peVVZAyjlFJAio3YAZ7zsEC8Fe2VQ89wyDlbJaIzUmZGMMp3iII6gzrN822v79B5j0vvLsh 71zzSbmGgmkHHfJu8peOu878gwp/4AQZkem15Rl7F+pbbfe+1IRXXc3iTGk/vbwXXy8feJ1 A4wTh5WhUYxm3/nJIj4hw== X-UI-Out-Filterresults: notjunk:1;V03:K0:kJPYxrqUW4Q=:IX4zfaBz7w6xvHD6+zvUEx 9lgTvdeuV59hcukEVZymu+p6tcoSHdR0K1YyNeMpb8uyuppx99cFXsn6a/2c3QwCqdTtaOI7b NM555G1mdTA4tx9beSLOpohIzVc1IAh0aF9aqOMLarv10YlFJVBypKsS7eozOr8YjLPwNCA7y xLNnSL9nvqoyuR6pmZ9cvRyyyP6/eYw4Fc/aHOZVjluv6XaHH1kDZqcwruoEvA55uYtvnSHac 9MjLs8ftcbsYmjTSWf1ukKC9wrnPzPU62l5wd6argIoQ2M9shIoE9+TB45W0N7bfJyq0mDbaX TJHKhxyRPW+/7p9yUNV10hZ7DQE+aMsD5fm2A2ANmTrYm1EOuOJrwHBgNOvOC8EJ4+jTkk6/W BwDYOySXQ80cH6wqZIg+DXq1/w/mFQHSkmwtbd0oqKoJWF1i+ZJF+Ic9yETZqxb/VKtT1JjId aY7KauvC1h+u+2i6Ia65kuNV1gsqfMmGLLZjy0AiXOjEvc13FOU1AbsdYNOJA5WSEPHUqWLHT SoAIo9fOAKbG2KsIwCu7Zo2mryl45CvXBMMMbNQ9jt5fV9nD8v7BkFwLkMucoFwqTowZs8u5T g8EDSIiimu5RjbwcGKHM6HD5X5/g/5FrZKGvHbfpY29hrmOad8MLWYtKwnASbuVRUr6XWpvrq WJJr4n5/Cu72gbTk0oEBe4AhzNbI9tMroHYK2nYqhfZrYtIznaI/92IoE9ZcqFvyCxwmiSEKp 6Y0UpIDYj+h2G2Yvy0Vj7nMLmkVAnbhBJyzm0A== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_err() instead of printk() for more consistent output. (prints device name, etc). Signed-off-by: Enrico Weigelt --- drivers/tty/serial/apbuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c index d2b86f7..89e19b6 100644 --- a/drivers/tty/serial/apbuart.c +++ b/drivers/tty/serial/apbuart.c @@ -568,7 +568,7 @@ static int apbuart_probe(struct platform_device *op) apbuart_flush_fifo((struct uart_port *) port); - printk(KERN_INFO "grlib-apbuart at 0x%llx, irq %d\n", + dev_info(&pdev->pdev, "grlib-apbuart at 0x%llx, irq %d\n", (unsigned long long) port->mapbase, port->irq); return 0; } From patchwork Sat Apr 27 12:52:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F143714D5 for ; Sat, 27 Apr 2019 12:55:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E386E28B2A for ; Sat, 27 Apr 2019 12:55:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6E9C28B90; Sat, 27 Apr 2019 12:55:39 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 6BA5B28B2A for ; Sat, 27 Apr 2019 12:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727451AbfD0Mzj (ORCPT ); Sat, 27 Apr 2019 08:55:39 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:60775 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbfD0MxN (ORCPT ); Sat, 27 Apr 2019 08:53:13 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MQ5nE-1h75AP44I4-00M2Ff; Sat, 27 Apr 2019 14:52:50 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 19/41] drivers: tty: serial: apbuart: fix code formatting Date: Sat, 27 Apr 2019 14:52:00 +0200 Message-Id: <1556369542-13247-20-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:pjIAjAgne4QqCMX+FIhXRp8twk2qiMY/VorT1FzzAauzfUv0f0K SouwmsHqH8JyEbDuRqNFwbEIDs+EyWcnB64N7nh/mWQM9zuPT5456futLRKhnzo2DzzmTAO S02Mck6t77pqC6132Z833rEpWkrhCHTZd9aBV6r93jE4Lyyveee4Vx4PENyVvPDGn5fzADC T1cnBnEc7a4HKVi45SoRA== X-UI-Out-Filterresults: notjunk:1;V03:K0:hEOSQVkrBtY=:E2i1fxkjmB++cF1pgysgSC 8hsAb0Aq860XW0owLqBwUm2y5DJXO+V/Is8mFh4c9ru3QfeD9ojJIKExeE/gQMx2UOQEJgGRb nvrMAXOkXd1qYP1gKihMwQy9DHsjWbR3wxj+hp709JVyhiYnLw9UAD3t+5PPNn6ETAr98RQP2 gHqDm/XUrKMU6kMIkWzlIgqfxdvTEA7d7CYJRA9+zsUFW6w+/kxNsRVEd2YH5fKzEWDZTB6mG AA1v18dy6/1w/Ta8+c1Z5r88c2mCOFG/kzIKZoFOpF02Re1cfPJiHtMPLpESpqBGkPJuT0pan wj5zbHmx+ec2NOcEAFhVUHZLEz20D89Udi/Cyt1T8qV0CmOeHhNQKA82G64fYOI5+TUIzx7QC obIBCK9wl1bRvMCTV4E/U6sBvRSiFWt5BcFHib/PhsHSUGo1Qoyf0VIUK6oReuSkCDZLub+8G Ob+eIhsXiwLKrxHAPOJ3mKdJEWu46k9EuJVL6xT+/FJe8XJTXXYFVmn8//sRTXHE9xnvp8m1O 1hpfUx4oFrpuxlBsYSu4W9shD60EHF2Zw/7FCtDHNOWT3igcd4Kn+PwMo93U88O8Llhwj4qEi 0CfcgMV9NBLuRd7LB5vp6/0Y+IfZe9HXOS6bEacBXOvat8PAAolbzxQuW8puvfRpBKG0XLB8X ofUclwTQPMphcmiPqlFXZf2nDhQxa57xuFpm3v4alrdRoOJx+GnGdJbV+E65VwyS+7GmnAy5B A0stBq2sqAbOn5qtmttutC8+4NSushVi0gD3aA== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warnings: WARNING: line over 80 characters #9: FILE: drivers/tty/serial/apbuart.c:9: + * Copyright (C) 2006 Daniel Hellstrom , Aeroflex Gaisler AB WARNING: line over 80 characters #11: FILE: drivers/tty/serial/apbuart.c:11: + * Copyright (C) 2009 Kristoffer Glembo , Aeroflex Gaisler AB WARNING: line over 80 characters #16: FILE: drivers/tty/serial/apbuart.c:16: +#if defined(CONFIG_SERIAL_GRLIB_GAISLER_APBUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) WARNING: labels should not be indented #122: FILE: drivers/tty/serial/apbuart.c:122: + ignore_char: WARNING: Missing a blank line after declarations #186: FILE: drivers/tty/serial/apbuart.c:186: + unsigned int status = UART_GET_STATUS(port); + return status & UART_STATUS_THE ? TIOCSER_TEMT : 0; WARNING: Missing a blank line after declarations #322: FILE: drivers/tty/serial/apbuart.c:322: + int ret = 0; + if (ser->type != PORT_UNKNOWN && ser->type != PORT_APBUART) WARNING: Missing a blank line after declarations #427: FILE: drivers/tty/serial/apbuart.c:427: + unsigned int status; + do { WARNING: Missing a blank line after declarations #463: FILE: drivers/tty/serial/apbuart.c:463: + unsigned int quot, status; + status = UART_GET_STATUS(port); WARNING: line over 80 characters #627: FILE: drivers/tty/serial/apbuart.c:627: + port->membase = ioremap(addr, sizeof(struct grlib_apbuart_regs_map)); WARNING: line over 80 characters #634: FILE: drivers/tty/serial/apbuart.c:634: + port->fifosize = apbuart_scan_fifo_size((struct uart_port *) port, line); Signed-off-by: Enrico Weigelt --- drivers/tty/serial/apbuart.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c index 89e19b6..515a562 100644 --- a/drivers/tty/serial/apbuart.c +++ b/drivers/tty/serial/apbuart.c @@ -6,12 +6,15 @@ * * Copyright (C) 2000 Deep Blue Solutions Ltd. * Copyright (C) 2003 Konrad Eisele - * Copyright (C) 2006 Daniel Hellstrom , Aeroflex Gaisler AB + * Copyright (C) 2006 Daniel Hellstrom , + * Aeroflex Gaisler AB * Copyright (C) 2008 Gilead Kutnick - * Copyright (C) 2009 Kristoffer Glembo , Aeroflex Gaisler AB + * Copyright (C) 2009 Kristoffer Glembo , + * Aeroflex Gaisler AB */ -#if defined(CONFIG_SERIAL_GRLIB_GAISLER_APBUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#if defined(CONFIG_SERIAL_GRLIB_GAISLER_APBUART_CONSOLE) \ + && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ #endif @@ -116,8 +119,7 @@ static void apbuart_rx_chars(struct uart_port *port) uart_insert_char(port, rsr, UART_STATUS_OE, ch, flag); - - ignore_char: +ignore_char: status = UART_GET_STATUS(port); } @@ -181,6 +183,7 @@ static irqreturn_t apbuart_int(int irq, void *dev_id) static unsigned int apbuart_tx_empty(struct uart_port *port) { unsigned int status = UART_GET_STATUS(port); + return status & UART_STATUS_THE ? TIOCSER_TEMT : 0; } @@ -317,6 +320,7 @@ static int apbuart_verify_port(struct uart_port *port, struct serial_struct *ser) { int ret = 0; + if (ser->type != PORT_UNKNOWN && ser->type != PORT_APBUART) ret = -EINVAL; if (ser->irq < 0 || ser->irq >= NR_IRQS) @@ -422,6 +426,7 @@ static void apbuart_flush_fifo(struct uart_port *port) static void apbuart_console_putchar(struct uart_port *port, int ch) { unsigned int status; + do { status = UART_GET_STATUS(port); } while (!UART_TX_READY(status)); @@ -458,6 +463,7 @@ static void apbuart_console_putchar(struct uart_port *port, int ch) if (UART_GET_CTRL(port) & (UART_CTRL_RE | UART_CTRL_TE)) { unsigned int quot, status; + status = UART_GET_STATUS(port); *parity = 'n'; @@ -622,14 +628,16 @@ static int __init grlib_apbuart_configure(void) port = &grlib_apbuart_ports[line]; port->mapbase = addr; - port->membase = ioremap(addr, sizeof(struct grlib_apbuart_regs_map)); + port->membase = ioremap(addr, + sizeof(struct grlib_apbuart_regs_map)); port->irq = 0; port->iotype = UPIO_MEM; port->ops = &grlib_apbuart_ops; port->flags = UPF_BOOT_AUTOCONF; port->line = line; port->uartclk = *freq_hz; - port->fifosize = apbuart_scan_fifo_size((struct uart_port *) port, line); + port->fifosize = apbuart_scan_fifo_size( + (struct uart_port *) port, line); line++; /* We support maximum UART_NR uarts ... */ From patchwork Sat Apr 27 12:52:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9513214D5 for ; Sat, 27 Apr 2019 12:55:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8603228B2A for ; Sat, 27 Apr 2019 12:55:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79E4A28B90; Sat, 27 Apr 2019 12:55:31 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 2A89728B2A for ; Sat, 27 Apr 2019 12:55:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726004AbfD0MzZ (ORCPT ); Sat, 27 Apr 2019 08:55:25 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:48977 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727002AbfD0MxR (ORCPT ); Sat, 27 Apr 2019 08:53:17 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MPooN-1h7uVt3Uzj-00MrCK; Sat, 27 Apr 2019 14:52:51 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 20/41] drivers: tty: serial: cpm_uart: use dev_err()/dev_warn() instead of printk() Date: Sat, 27 Apr 2019 14:52:01 +0200 Message-Id: <1556369542-13247-21-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:gPxg0pvaNEeq5x+UwAsDbHdgypnsGOsK9o3j3foMhaID5KFRvEv 8AvtdT3OHQsnwoPSUVUVgaG7uGVOSNulOF2BUp5euWPO4xOffryfhmOQh75bfkqTrattPsp QFI8+vQMDSRQJ10o81AgQsbvofwXHCA01N/KdcAMGoHFdvQFXnI8JYKNCiQeBe0EpQIxX+K rRBN+WvzZqwD0ZWGZ/IRQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:2ju8YRhuhXY=:onNlvZ0aDrqH1/5VH3xxRk 97sCatc+DPnq24Zb7ZJM6qAh6b3iT6iWeaqZSLN5g857Y4q/gZkpStxTSY0y7/0vVZ2W2K8eN hrg8KTsBqdMCfc4qz0COMhhaiMomIx6Ezqf1jP899W3P6VFeOiJceFdEaDUqJ2x0mkdvjcSjR P3IZevKXifgjbgM0+HGLwqyrJOuozz0fGHG6voJYrbtD0tdC2lAYE9WFwuLR1ujJzxSkwStdT lkylIMBo9lhsNzylPGYzyv4UI8ZZMZrpvojOg3lgZ0vpcI+NQUoteI0P+Wz5lfIyPfcI+6QP5 bcBDKc9LVTJUAbZrZZUPykDkm6du6zW2r19As2FmM093PScDZCbPR2np4C9780LIVQFScmK7B cS6pvNLxOjZG7VrdBAeBHYqG35dNFeg7Y4G/O2pavGZMM/m9VfYlslnOpQpaOA7biLCwDiZ3g ORABcZsNz/R1affuaIPOyjUXod5AymqWkBo/t+ZeZW+oS7GqagtrFM+tD6HiEmEJQjSZyfhnf bbhVVvk5eNalCXzlFJXa8G2brsHEUR05O/eTzVUCsjKTbU69zjG5Y9jitLl1WIhvZoR1wWDxa R6dA3fagJAV0pXITce+DpVexGE7gqSXQvcl0BHe49TekWK+zRLUg8fQRepiwCRKCXuJeJeQ5m uDJWEO3RV24ra1DasOhJ8L4Y3zxtMI650z5aczoHnbcvIKn7BzWRl4VXH6ecpN1d35iAhdifu qDIdgE2pptfSyvUIDQnzvzrSEC1fksYnQ5U6ig== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_err()/dev_warn() instead of printk() for more consistent output. (prints device name, etc). Signed-off-by: Enrico Weigelt Reviewed-by: Christophe Leroy --- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 6 +++--- drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c index b929c7a..374b8bb 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c @@ -265,7 +265,7 @@ static void cpm_uart_int_rx(struct uart_port *port) * later, which will be the next rx-interrupt or a timeout */ if (tty_buffer_request_room(tport, i) < i) { - printk(KERN_WARNING "No room in flip buffer\n"); + dev_warn(port->dev, "No room in flip buffer\n"); return; } @@ -1155,7 +1155,7 @@ static int cpm_uart_init_port(struct device_node *np, if (!pinfo->clk) { data = of_get_property(np, "fsl,cpm-brg", &len); if (!data || len != 4) { - printk(KERN_ERR "CPM UART %pOFn has no/invalid " + dev_err(port->dev, "CPM UART %pOFn has no/invalid " "fsl,cpm-brg property.\n", np); return -EINVAL; } @@ -1164,7 +1164,7 @@ static int cpm_uart_init_port(struct device_node *np, data = of_get_property(np, "fsl,cpm-command", &len); if (!data || len != 4) { - printk(KERN_ERR "CPM UART %pOFn has no/invalid " + dev_err(port->dev, "CPM UART %pOFn has no/invalid " "fsl,cpm-command property.\n", np); return -EINVAL; } diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c index 6a1cd03..ef1ae08 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c @@ -67,7 +67,7 @@ void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port, return pram; if (len != 2) { - printk(KERN_WARNING "cpm_uart[%d]: device tree references " + dev_warn(port->dev, "cpm_uart[%d]: device tree references " "SMC pram, using boot loader/wrapper pram mapping. " "Please fix your device tree to reference the pram " "base register instead.\n", From patchwork Sat Apr 27 12:52:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A471933 for ; Sat, 27 Apr 2019 12:55:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C47D28B2A for ; Sat, 27 Apr 2019 12:55:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 705A828B90; Sat, 27 Apr 2019 12:55:53 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 1FDB928B2A for ; Sat, 27 Apr 2019 12:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727454AbfD0Mzj (ORCPT ); Sat, 27 Apr 2019 08:55:39 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:43639 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfD0MxN (ORCPT ); Sat, 27 Apr 2019 08:53:13 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mspy4-1gVqbT38iO-00tCHb; Sat, 27 Apr 2019 14:52:51 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 21/41] drivers: tty: serial: cpm_uart: fix includes Date: Sat, 27 Apr 2019 14:52:02 +0200 Message-Id: <1556369542-13247-22-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:xQq23jU9i9rUL2fNQuvkwl6eGPDVSQvpkDbQ/zveful4zboC1HW oNd3D0zOYk84zfCJ0Xuzpmh6YQ79oPwoYvw/oeAO14yaLEcslLKcMENViWN+rlXtE9vM1qv 1jCwWuLOXgdLjw4fxAGT3BB8TcpKk2wNp9jWPWPgaYVVv0WEj/TEQ/U7sklnKXLuZSVuAgG ee5Mn3D1VCygJnSepJUyg== X-UI-Out-Filterresults: notjunk:1;V03:K0:xWgBbp/LG7s=:wi8MuLImVy2CGGeEYyoQB2 KMmBNwIQx4fsztqkOwXtcxcWItI9eedJWvICvmKhOlHgaY8MtQ25FTCVmfHiYt3j9gS36aZaa q9Y5EIjEBd+qyl0GLPKh4hpFw2Y9xorJzSRbpppCWg9Lng+zZdTe/MiFG1F7kXNVSzq4lt2hL ezKmIOR+0ajJU88S0pj4Kvx7tgnm1+AxaE/XtB3sMY5Kc/X02sDkvp4m476q2eExmeEHf7yl3 SS9ZDZappKf9esZiUUvzR4FWzO/lGAkyPEM5TbSsWcKPe4Hwz2W19UfQilH2TsF2+lwHqakd/ 0zYcoNC9JBhT5LyMi+bJ4ixLs9s35MALlLW9l9uhuIfzTde5AJ+qVyxmXzjZs7+sgMLLy16T8 wQ26qYtWIfsOeVfD03mLnlq295RwRXRcppjT2NdxNgQCjA8w3sUfILoNLj9Dn8itEgJAMtfl7 V8Cx1WCsQKAgggypWMvmWuYLBZW9OCxv/vxSRFHvIZxRwPaRxNeKsu+/Fbb3nzWRANHyooXV/ DsfRL+yilOXWQavlpzHDrWwcLFWzf4Q6C/lHFEf1NO221QjdJBnEIHiVYjdfQrgI7DXvLr6y0 OOEW7gT7Kv/C1gTmxJIHJCzbWkK13YeuK27LFOraKAE3hMCkeL/cdQE0Eb+TGViA6xDeL5nsA 9JTsphma2cCsaVd+QVzhXQsK2WCBYwcJMcIA1O1vu+w/HuFJbyuBL4ArPqi6deE6sKSH4G7JK UZVfxUQPRjkUPT6CoClRC35MnUhRE+eqWHNnlA== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixing checkpatch warning: WARNING: Use #include instead of #25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:25: +#include WARNING: Use #include instead of +#include WARNING: Use #include instead of +#include Signed-off-by: Enrico Weigelt Reviewed-by: Christophe Leroy --- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 4 ++-- drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c index 374b8bb..c831d31 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c @@ -33,10 +33,10 @@ #include #include #include +#include +#include -#include #include -#include #include #include diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c index ef1ae08..40cfcf4 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c @@ -21,8 +21,8 @@ #include #include #include +#include -#include #include #include #include From patchwork Sat Apr 27 12:52:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22545933 for ; Sat, 27 Apr 2019 12:55:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1388628B2A for ; Sat, 27 Apr 2019 12:55:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0740B28B90; Sat, 27 Apr 2019 12:55:38 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 A543A28B2A for ; Sat, 27 Apr 2019 12:55:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727401AbfD0Mzc (ORCPT ); Sat, 27 Apr 2019 08:55:32 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:33287 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbfD0MxP (ORCPT ); Sat, 27 Apr 2019 08:53:15 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MhUDj-1gqW7b2XwJ-00efAG; Sat, 27 Apr 2019 14:52:52 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 22/41] drivers: tty: serial: cpm_uart: fix logging calls Date: Sat, 27 Apr 2019 14:52:03 +0200 Message-Id: <1556369542-13247-23-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:6aniEe4uJcRcav5vVBfcQ4eLLFWMnqJpVC4vZyHJ9k0A6q/tn4j b9DaJRxToUGOhrA8XctR1mPhJ0cf7Ttk2f4rAFWNa3fQjR7YkDeiN3gu2Jkvl9J2LTCqub4 NvWiLxdxAxFk1k9fhSMKs/EVAw4rvAGYukqY9dkQaz94+MijAkIVPXhEPMgivLXBUM8RACd PwxeoNLw6M7rcZKmGYaIg== X-UI-Out-Filterresults: notjunk:1;V03:K0:N1DUCAE49ps=:6Bg3z0yKDfbQlfXN15vFTK CTXF7meBLhT1JFynkQvUub9OX3IH9Bn32MIrPU8KLGYu6xRSeeA/dv91WkdRSMB7jw5SdnYVU fBjG6PFdpn1ZcQEzJLT3TEeYtiWNSTLLl+4olsmK1UCkntdxplgAH0cDkdqmRgBilTze2f7jr yBoEZG/TEYQR7XOcNbzuiDrCWD/QGrMzOWGTHHxN6hQnmtCwz+JPrD3eLuSj6f48WAbwJlu1K pi/aO1K/KDfh6fTnuKZ0wM3Rb509RDLGyiAS7Cq+EOzAfOuLQxlXxNmBU5uwfoZgNkZxLYXpG LPA/VLSRM/do906EdV+T1SaqdwZoEwTB6TVOR/PMF8++fRGUXP3sVtBYfhqAlLOACU03kvhhT e/wSlyyyIN8laaJjGbbkdmkScfnBHzxwxJJodWsT5x5MW2YdlWf5dVUI7B1fkpyAn6/3PpqHZ ozeZgeiwzfUj7KdmcDro0QCipy3GpQh1Tv0Iq+NqFHBGaR3f3+cWDo3rDMych8CTVLTU1AVkl 2XBtChbNXe7808yH+6vrzkl8qad8i15gpT2NYBjcGcbsv3Jx9SO4lLao075F0ckBuGvZ+84La SuMyHOhs9Ph85GauTE8NUiSCnd851q5KRXd3jTIJoWrjlcnFeyNg6Od4d+LNqplzy1QwNfHER tVlWKkonlZQPDNV6mjAqvrxGHz/Dn/JPo8WteDheS37jlKM3nioX2QkQZjoaYGONVb+tRUXJw jl1OMAdapLwDVC/umjMb4TaNPso7exnunktkrQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warnings by using pr_err(): WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #109: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:109: + printk(KERN_ERR WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #128: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:128: + printk(KERN_ERR WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... + printk(KERN_ERR WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... + printk(KERN_ERR Signed-off-by: Enrico Weigelt Reviewed-by: Christophe Leroy --- drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c | 6 ++---- drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c index 56fc527..aed61e9 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c @@ -71,8 +71,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos); dp_offset = cpm_dpalloc(dpmemsz, 8); if (IS_ERR_VALUE(dp_offset)) { - printk(KERN_ERR - "cpm_uart_cpm1.c: could not allocate buffer descriptors\n"); + pr_err("cpm_uart_cpm1.c: could not allocate buffer descriptors\n"); return -ENOMEM; } dp_mem = cpm_dpram_addr(dp_offset); @@ -90,8 +89,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) if (mem_addr == NULL) { cpm_dpfree(dp_offset); - printk(KERN_ERR - "cpm_uart_cpm1.c: could not allocate coherent memory\n"); + pr_err("cpm_uart_cpm1.c: could not allocate coherent memory\n"); return -ENOMEM; } diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c index 40cfcf4..a0fccda 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c @@ -106,8 +106,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos); dp_offset = cpm_dpalloc(dpmemsz, 8); if (IS_ERR_VALUE(dp_offset)) { - printk(KERN_ERR - "cpm_uart_cpm.c: could not allocate buffer descriptors\n"); + pr_err("cpm_uart_cpm.c: could not allocate buffer descriptors\n"); return -ENOMEM; } @@ -125,8 +124,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) if (mem_addr == NULL) { cpm_dpfree(dp_offset); - printk(KERN_ERR - "cpm_uart_cpm.c: could not allocate coherent memory\n"); + pr_err("cpm_uart_cpm.c: could not allocate coherent memory\n"); return -ENOMEM; } From patchwork Sat Apr 27 12:52:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10BE1933 for ; Sat, 27 Apr 2019 12:54:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F32B0286B2 for ; Sat, 27 Apr 2019 12:54:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5EBF286E0; Sat, 27 Apr 2019 12:54:47 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 93205286B2 for ; Sat, 27 Apr 2019 12:54:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726969AbfD0Myk (ORCPT ); Sat, 27 Apr 2019 08:54:40 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:54689 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727304AbfD0Mxa (ORCPT ); Sat, 27 Apr 2019 08:53:30 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MRTEr-1h6GLw2B53-00NPhG; Sat, 27 Apr 2019 14:52:53 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 23/41] drivers: tty: serial: cpm_uart: fix styling issues Date: Sat, 27 Apr 2019 14:52:04 +0200 Message-Id: <1556369542-13247-24-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:CVjkYwcG+7onfHBaQNovKTeKpoTonT0f2mtSvxJbYPTQ5P27Qql bm2hXQ5MzYvytKmVHr96tZoyT9BsAx1aITPsx+ZQ/Y80RiEOEsBGghiwpDry3B7D80lietP S7LHY1RtNXEi1Xy8Uro7Qk9jPCLsxm3ZdGByAMoweKDddQrUFEn7/28rMNLjbN0MsTynh0q xc6fHl2PHk7s/7c2Apbdg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Y/SKJieP6wk=:bE6j2ZEISFPH35gVY9aksP N2WtRYInPtHzA2XWQehhGr2AnSgWfI93EM/rid30NmbMVmjtGRgOitSGya8spg4IULwveNnx1 FphAFz69Bsk5otla3jHKh3ZNA4oh+BEj4u11Wi/YpobC4dGf/W1F/vpJR2wBziUMxC1EVmtRb NaoGtiuJ4t9HAcJSIiJjSj3GVwGsdBEsZN/qw/NxSFDzXkl1Ho0cYbsazmA/w1I8qusKi254E pJbPQPlZhSUyNFg5n1xYupItzvLjE8oZJWJydmkVaixKN8K7Kv+olix2BqvrCgqjaQnbq+cKS 7DOQUhOgnqmgV/hn6hyXZVMbGBh+MKLy8p2Fp6RrxU8UpVaxcjxbz2RmZkPLfvT+pgJ7iDTe4 k09auReJyjD+OMypadPBmGhLT0EgSqsT2vLQRgAE+yicwLwhpSeOEsrpfyBsLdp0OyWY/f0Ot 1IAHS6w9h/ILLep1wUxBtV5nkq2xE0oLlWNTkSoE+cDQVC1O2Vd7yceDGWYPFvyQjZcQ6+t0p MAlvuHRgCrNhlaLu17VUbMrH8Fv4zSi73kwNGIai/nKYW+Y56rgD8tpIvw4Ed+++TV9Y+3mIk k4sbza6StAlk5z9I0sIrKE1lK7yn9TbNVbCaHc/zgZTRNsxQsSZnbTRH7c//OPjeBIjbaY7cc hDA+C0CRLdNcOrslv8eUJoQHgVHPAHJ42Qo4ShPvkISRFRImnZcPmTMjqXoyQcPx98o7glHUx QRan2bO5p7yU7PrjrWty1zzXKHnjwouFf27a3A== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch errors: ERROR: else should follow close brace '}' #121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121: + } + else WARNING: line over 80 characters #150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150: + pinfo->tx_fifosize), (void __force *)pinfo->mem_addr, WARNING: Block comments should align the * on each line #66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66: + * Check, if transmit buffers are processed +*/ WARNING: braces {} are not necessary for any arm of this statement #170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170: + if (IS_SMC(pinfo)) { [...] + } else { [...] WARNING: labels should not be indented #292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292: + error_return: ERROR: code indent should use tabs where possible #299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299: +^I^I BD_SC_OV | BD_SC_ID);$ WARNING: labels should not be indented #319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319: + handle_error: WARNING: line over 80 characters #423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423: + setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT)); ERROR: space required before the open parenthesis '(' #451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451: + while(!cpm_uart_tx_empty(port)) { WARNING: Missing a blank line after declarations #462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462: + smc_t __iomem *smcp = pinfo->smcp; + clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN); WARNING: line over 80 characters #466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466: + clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); WARNING: Missing a blank line after declarations #466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466: + scc_t __iomem *sccp = pinfo->sccp; + clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); ERROR: code indent should use tabs where possible #484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484: + struct ktermios *termios,$ WARNING: please, no spaces at the start of a line #484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484: + struct ktermios *termios,$ ERROR: code indent should use tabs where possible #485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485: + struct ktermios *old)$ WARNING: please, no spaces at the start of a line #485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485: + struct ktermios *old)$ WARNING: line over 80 characters #624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624: + /* Output in *one* operation, so we don't interrupt RX/TX if they WARNING: Block comments use a trailing */ on a separate line #625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625: + * were already enabled. */ WARNING: line over 80 characters #629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629: + out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize); WARNING: line over 80 characters #773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773: + mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); ERROR: code indent should use tabs where possible #797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797: +^I (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$ ERROR: code indent should use tabs where possible #799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799: +^I (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$ ERROR: code indent should use tabs where possible #836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836: +^I SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$ ERROR: code indent should use tabs where possible #859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859: +^I (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$ ERROR: code indent should use tabs where possible #861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861: +^I (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$ WARNING: space prohibited between function name and open parenthesis '(' #866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866: +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH) WARNING: line over 80 characters #921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921: + clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); WARNING: Missing a blank line after declarations #462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462: + smc_t __iomem *smcp = pinfo->smcp; + clrbits16(&smcp->smc_smcmr, WARNING: Missing a blank line after declarations #467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467: + scc_t __iomem *sccp = pinfo->sccp; + clrbits32(&sccp->scc_gsmrl, ERROR: code indent should use tabs where possible #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151: + struct uart_cpm_port *pinfo)$ WARNING: please, no spaces at the start of a line #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151: + struct uart_cpm_port *pinfo)$ ERROR: "(foo*)" should be "(foo *)" #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161: + struct clk *clk = clk_get(NULL, (const char*)data); WARNING: Missing a blank line after declarations #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162: + struct clk *clk = clk_get(NULL, (const char*)data); + if (!IS_ERR(clk)) ERROR: code indent should use tabs where possible #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169: +^I^I^I "fsl,cpm-brg property.\n", np);$ ERROR: code indent should use tabs where possible #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178: +^I^I "fsl,cpm-command property.\n", np);$ ERROR: code indent should use tabs where possible #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192: WARNING: braces {} are not necessary for any arm of this statement #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279: + if (unlikely(nolock)) { [...] + } else { [...] WARNING: braces {} are not necessary for any arm of this statement #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287: + if (unlikely(nolock)) { [...] + } else { [...] WARNING: line over 80 characters #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354: + clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); ERROR: Macros with complex values should be enclosed in parentheses #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394: +#define CPM_UART_CONSOLE &cpm_scc_uart_console WARNING: Missing a blank line after declarations #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437: + struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev); + return uart_remove_one_port(&cpm_reg, &pinfo->port); WARNING: please, no spaces at the start of a line #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464: + };$ WARNING: Missing a blank line after declarations #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469: + int ret = uart_register_driver(&cpm_reg); + if (ret) WARNING: Missing a blank line after declarations #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062: + int i; + volatile cbd_t *bdp; ERROR: "foo * bar" should be "foo *bar" #19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19: +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup) ERROR: "foo * bar" should be "foo *bar" #25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25: +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up) WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Block comments use * on subsequent lines #106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106: +/* + virtual to phys transtalion ERROR: code indent should use tabs where possible #109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109: + struct uart_cpm_port *pinfo)$ WARNING: please, no spaces at the start of a line #109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109: + struct uart_cpm_port *pinfo)$ ERROR: code indent should use tabs where possible #125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125: + struct uart_cpm_port *pinfo)$ WARNING: please, no spaces at the start of a line #125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125: + struct uart_cpm_port *pinfo)$ Signed-off-by: Enrico Weigelt --- drivers/tty/serial/cpm_uart/cpm_uart.h | 10 +-- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 95 ++++++++++++++++------------- drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h | 4 +- drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c | 6 +- 4 files changed, 64 insertions(+), 51 deletions(-) diff --git a/drivers/tty/serial/cpm_uart/cpm_uart.h b/drivers/tty/serial/cpm_uart/cpm_uart.h index 9f175a9..e7e225f 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart.h +++ b/drivers/tty/serial/cpm_uart/cpm_uart.h @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +/* SPDX-License-Identifier: GPL-2.0 */ /* * Driver for CPM (SCC/SMC) serial ports * @@ -103,10 +103,10 @@ void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port, void scc4_lineif(struct uart_cpm_port *pinfo); /* - virtual to phys transtalion -*/ + * virtual to phys transtalion + */ static inline unsigned long cpu2cpm_addr(void *addr, - struct uart_cpm_port *pinfo) + struct uart_cpm_port *pinfo) { int offset; u32 val = (u32)addr; @@ -122,7 +122,7 @@ static inline unsigned long cpu2cpm_addr(void *addr, } static inline void *cpm2cpu_addr(unsigned long addr, - struct uart_cpm_port *pinfo) + struct uart_cpm_port *pinfo) { int offset; u32 val = addr; diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c index c831d31..4d6cea9 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c @@ -63,7 +63,7 @@ /* * Check, if transmit buffers are processed -*/ + */ static unsigned int cpm_uart_tx_empty(struct uart_port *port) { struct uart_cpm_port *pinfo = @@ -167,11 +167,10 @@ static void cpm_uart_start_tx(struct uart_port *port) } if (cpm_uart_tx_pump(port) != 0) { - if (IS_SMC(pinfo)) { + if (IS_SMC(pinfo)) setbits8(&smcp->smc_smcm, SMCM_TX); - } else { + else setbits16(&sccp->scc_sccm, UART_SCCM_TX); - } } } @@ -289,14 +288,14 @@ static void cpm_uart_int_rx(struct uart_port *port) return; } #endif - error_return: +error_return: tty_insert_flip_char(tport, ch, flg); } /* End while (i--) */ /* This BD is ready to be used again. Clear status. get next */ clrbits16(&bdp->cbd_sc, BD_SC_BR | BD_SC_FR | BD_SC_PR | - BD_SC_OV | BD_SC_ID); + BD_SC_OV | BD_SC_ID); setbits16(&bdp->cbd_sc, BD_SC_EMPTY); if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP) @@ -316,7 +315,7 @@ static void cpm_uart_int_rx(struct uart_port *port) /* Error processing */ - handle_error: +handle_error: /* Statistics */ if (status & BD_SC_BR) port->icount.brk++; @@ -420,7 +419,8 @@ static int cpm_uart_startup(struct uart_port *port) setbits16(&pinfo->smcp->smc_smcmr, (SMCMR_REN | SMCMR_TEN)); } else { setbits16(&pinfo->sccp->scc_sccm, UART_SCCM_RX); - setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT)); + setbits32(&pinfo->sccp->scc_gsmrl, + (SCC_GSMRL_ENR | SCC_GSMRL_ENT)); } return 0; @@ -448,7 +448,7 @@ static void cpm_uart_shutdown(struct uart_port *port) /* If the port is not the console, disable Rx and Tx. */ if (!(pinfo->flags & FLAG_CONSOLE)) { /* Wait for all the BDs marked sent */ - while(!cpm_uart_tx_empty(port)) { + while (!cpm_uart_tx_empty(port)) { set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(2); } @@ -459,12 +459,17 @@ static void cpm_uart_shutdown(struct uart_port *port) /* Stop uarts */ if (IS_SMC(pinfo)) { smc_t __iomem *smcp = pinfo->smcp; - clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN); + + clrbits16(&smcp->smc_smcmr, + SMCMR_REN | SMCMR_TEN); clrbits8(&smcp->smc_smcm, SMCM_RX | SMCM_TX); } else { scc_t __iomem *sccp = pinfo->sccp; - clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); - clrbits16(&sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX); + + clrbits32(&sccp->scc_gsmrl, + SCC_GSMRL_ENR | SCC_GSMRL_ENT); + clrbits16(&sccp->scc_sccm, + UART_SCCM_TX | UART_SCCM_RX); } /* Shut them really down and reinit buffer descriptors */ @@ -481,8 +486,8 @@ static void cpm_uart_shutdown(struct uart_port *port) } static void cpm_uart_set_termios(struct uart_port *port, - struct ktermios *termios, - struct ktermios *old) + struct ktermios *termios, + struct ktermios *old) { int baud; unsigned long flags; @@ -621,12 +626,14 @@ static void cpm_uart_set_termios(struct uart_port *port, * present. */ prev_mode = in_be16(&smcp->smc_smcmr) & (SMCMR_REN | SMCMR_TEN); - /* Output in *one* operation, so we don't interrupt RX/TX if they - * were already enabled. */ + /* Output in *one* operation, so we don't interrupt RX/TX if + * they were already enabled. + */ out_be16(&smcp->smc_smcmr, smcr_mk_clen(bits) | cval | SMCMR_SM_UART | prev_mode); } else { - out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize); + out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, + pinfo->rx_fifosize); out_be16(&pinfo->sccup->scc_maxidl, maxidl); out_be16(&sccp->scc_psmr, (sbits << 12) | scval); } @@ -770,7 +777,8 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo) * buffers in the buffer descriptors, and the * virtual address for us to work with. */ - mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); + mem_addr = pinfo->mem_addr + + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); bdp = pinfo->tx_cur = pinfo->tx_bd_base; for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { out_be32(&bdp->cbd_bufaddr, cpu2cpm_addr(mem_addr, pinfo)); @@ -794,9 +802,9 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo) /* Store address */ out_be16(&pinfo->sccup->scc_genscc.scc_rbase, - (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE); + (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE); out_be16(&pinfo->sccup->scc_genscc.scc_tbase, - (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE); + (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE); /* Set up the uart parameters in the * parameter ram. @@ -833,7 +841,7 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo) */ out_be32(&scp->scc_gsmrh, 0); out_be32(&scp->scc_gsmrl, - SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16); + SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16); /* Enable rx interrupts and clear all pending events. */ out_be16(&scp->scc_sccm, 0); @@ -856,14 +864,14 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo) /* Store address */ out_be16(&pinfo->smcup->smc_rbase, - (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE); + (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE); out_be16(&pinfo->smcup->smc_tbase, - (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE); + (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE); /* * In case SMC1 is being relocated... */ -#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH) +#if defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH) out_be16(&up->smc_rbptr, in_be16(&pinfo->smcup->smc_rbase)); out_be16(&up->smc_tbptr, in_be16(&pinfo->smcup->smc_tbase)); out_be32(&up->smc_rstate, 0); @@ -917,8 +925,10 @@ static int cpm_uart_request_port(struct uart_port *port) clrbits8(&pinfo->smcp->smc_smcm, SMCM_RX | SMCM_TX); clrbits16(&pinfo->smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN); } else { - clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX); - clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); + clrbits16(&pinfo->sccp->scc_sccm, + UART_SCCM_TX | UART_SCCM_RX); + clrbits32(&pinfo->sccp->scc_gsmrl, + SCC_GSMRL_ENR | SCC_GSMRL_ENT); } ret = cpm_uart_allocbuf(pinfo, 0); @@ -1048,9 +1058,10 @@ static void cpm_uart_early_write(struct uart_cpm_port *pinfo, static int poll_wait_key(char *obuf, struct uart_cpm_port *pinfo) { u_char c, *cp; - volatile cbd_t *bdp; int i; + volatile cbd_t *bdp; + /* Get the address of the host memory buffer. */ bdp = pinfo->rx_cur; @@ -1138,7 +1149,7 @@ static void cpm_put_poll_char(struct uart_port *port, struct uart_cpm_port cpm_uart_ports[UART_NR]; static int cpm_uart_init_port(struct device_node *np, - struct uart_cpm_port *pinfo) + struct uart_cpm_port *pinfo) { const u32 *data; void __iomem *mem, *pram; @@ -1148,7 +1159,8 @@ static int cpm_uart_init_port(struct device_node *np, data = of_get_property(np, "clock", NULL); if (data) { - struct clk *clk = clk_get(NULL, (const char*)data); + struct clk *clk = clk_get(NULL, (const char *)data); + if (!IS_ERR(clk)) pinfo->clk = clk; } @@ -1156,7 +1168,7 @@ static int cpm_uart_init_port(struct device_node *np, data = of_get_property(np, "fsl,cpm-brg", &len); if (!data || len != 4) { dev_err(port->dev, "CPM UART %pOFn has no/invalid " - "fsl,cpm-brg property.\n", np); + "fsl,cpm-brg property.\n", np); return -EINVAL; } pinfo->brg = *data; @@ -1165,7 +1177,7 @@ static int cpm_uart_init_port(struct device_node *np, data = of_get_property(np, "fsl,cpm-command", &len); if (!data || len != 4) { dev_err(port->dev, "CPM UART %pOFn has no/invalid " - "fsl,cpm-command property.\n", np); + "fsl,cpm-command property.\n", np); return -EINVAL; } pinfo->command = *data; @@ -1179,7 +1191,7 @@ static int cpm_uart_init_port(struct device_node *np, pinfo->sccp = mem; pinfo->sccup = pram = cpm_uart_map_pram(pinfo, np); } else if (of_device_is_compatible(np, "fsl,cpm1-smc-uart") || - of_device_is_compatible(np, "fsl,cpm2-smc-uart")) { + of_device_is_compatible(np, "fsl,cpm2-smc-uart")) { pinfo->flags |= FLAG_SMC; pinfo->smcp = mem; pinfo->smcup = pram = cpm_uart_map_pram(pinfo, np); @@ -1266,19 +1278,17 @@ static void cpm_uart_console_write(struct console *co, const char *s, unsigned long flags; int nolock = oops_in_progress; - if (unlikely(nolock)) { + if (unlikely(nolock)) local_irq_save(flags); - } else { + else spin_lock_irqsave(&pinfo->port.lock, flags); - } cpm_uart_early_write(pinfo, s, count, true); - if (unlikely(nolock)) { + if (unlikely(nolock)) local_irq_restore(flags); - } else { + else spin_unlock_irqrestore(&pinfo->port.lock, flags); - } } @@ -1341,7 +1351,8 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) out_be16(&pinfo->sccup->scc_brkcr, 0); cpm_line_cr_cmd(pinfo, CPM_CR_GRA_STOP_TX); clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX); - clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); + clrbits32(&pinfo->sccp->scc_gsmrl, + SCC_GSMRL_ENR | SCC_GSMRL_ENT); } ret = cpm_uart_allocbuf(pinfo, 1); @@ -1381,7 +1392,7 @@ static int __init cpm_uart_console_init(void) console_initcall(cpm_uart_console_init); -#define CPM_UART_CONSOLE &cpm_scc_uart_console +#define CPM_UART_CONSOLE (&cpm_scc_uart_console) #else #define CPM_UART_CONSOLE NULL #endif @@ -1424,6 +1435,7 @@ static int cpm_uart_probe(struct platform_device *ofdev) static int cpm_uart_remove(struct platform_device *ofdev) { struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev); + return uart_remove_one_port(&cpm_reg, &pinfo->port); } @@ -1451,11 +1463,12 @@ static int cpm_uart_remove(struct platform_device *ofdev) }, .probe = cpm_uart_probe, .remove = cpm_uart_remove, - }; +}; static int __init cpm_uart_init(void) { int ret = uart_register_driver(&cpm_reg); + if (ret) return ret; diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h b/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h index 18ec084..eafff96 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h @@ -16,13 +16,13 @@ static inline void cpm_set_brg(int brg, int baud) cpm_setbrg(brg, baud); } -static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup) +static inline void cpm_set_scc_fcr(scc_uart_t __iomem *sup) { out_8(&sup->scc_genscc.scc_rfcr, SMC_EB); out_8(&sup->scc_genscc.scc_tfcr, SMC_EB); } -static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up) +static inline void cpm_set_smc_fcr(smc_uart_t __iomem *up) { out_8(&up->smc_rfcr, SMC_EB); out_8(&up->smc_tfcr, SMC_EB); diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c index a0fccda..154ac19 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c @@ -117,8 +117,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) if (is_con) { mem_addr = kzalloc(memsz, GFP_NOWAIT); dma_addr = virt_to_bus(mem_addr); - } - else + } else mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr, GFP_KERNEL); @@ -148,7 +147,8 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo) dma_free_coherent(pinfo->port.dev, L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + L1_CACHE_ALIGN(pinfo->tx_nrfifos * - pinfo->tx_fifosize), (void __force *)pinfo->mem_addr, + pinfo->tx_fifosize), + (void __force *)pinfo->mem_addr, pinfo->dma_addr); cpm_dpfree(pinfo->dp_addr); From patchwork Sat Apr 27 12:52:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920317 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B4CA14D5 for ; Sat, 27 Apr 2019 12:54:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C539212D5 for ; Sat, 27 Apr 2019 12:54:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 305DD286B9; Sat, 27 Apr 2019 12:54:32 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 CFF71212D5 for ; Sat, 27 Apr 2019 12:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727249AbfD0MyZ (ORCPT ); Sat, 27 Apr 2019 08:54:25 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:58021 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727356AbfD0Mxd (ORCPT ); Sat, 27 Apr 2019 08:53:33 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N9MlI-1gfl9m1ece-015ExT; Sat, 27 Apr 2019 14:52:54 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 24/41] drivers: tty: serial: timbuart: use dev_err() instead of printk() Date: Sat, 27 Apr 2019 14:52:05 +0200 Message-Id: <1556369542-13247-25-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:BieBEBBsy2gfEajzWoDGWMcE2Mvq0o7NJ63l6aX+FxhP7ufm2yW 8dXTC3JQUAFY/WCMJ1/1FJOwC4nH5OFd4rdRacx9W0Ygab84QWKSXEPsRUsyINwb9XiMSPm RCcNrFz9CApcr0oX4NbMqQ9F8s3kYV2PWgfs7u2aOEsWDpqGeA0wVWyWwLSbOC/ddaW82Li OjOZ6NUleeV5JtDUVLwHg== X-UI-Out-Filterresults: notjunk:1;V03:K0:JS7vPazR9sY=:wh6dRw4oaWtG3y+0FQ4wKZ 8vb7ymeX2tvwfAYmr9+mJF4S6k4k9U5V2HEyPrbXJ6/0S9GBgBjJsnwpIZ5c9QgEmjdbWNwxg Vu9sf1Y1H5gIZWUsI+qv9PJ9ijIsfYONXKtG98bdpDehmBa5qXmyawHJxhqJs7cRiKkqUAqhY FblvZEXvdgz9TOlb8kRby4CbfcCKnvCbFz4yjEjCjnokt4kucvMTBS3a3i0hZDUtXgg/fUvko g8UHmEKQyTFXGke0jVcSVmWHajcG1LwVu3u1NfrKQSPqjTGOM+lz0jhtq+zv4PDQ2jPV08Idb o/e8xk3mnYBnfPx/mcfQq2eWNyWyx8LzuhwoN/61aCuaXzqf+p2hVM8yePsmjyKQQurXL2qtm hLSGJdkrKlIlIvxUAWWF8pRewTNM7KxRH+HAh51wyAc2pc6Kbz3eMc9VAhgttLdykwXdo4XO/ MHT/R993D1mIhehh6zsGIWqNcm9geCIzmq6h/mVEXRtEqiWomnfCx/WZzeP78227zdQka6OWH AVPG353dCHdmxxwOxXw1IJi3Bd0v4+932OPM18Pb/iC+CGjIyy+yZ1L+8PBnIdRjQf8+mDMzD SreZjfTcmkCfajv+bJY8mQ+JYH8Rxiri6wgGAWTDynnZSmostnIMj5M0gAxG+J412mhB3vQFu lH8SZfCFJ/Q0gFM/aZO2GpwOFmRdwx0qX9iN++Gnue88aT6r05Z83YCxEEVqOSlZgOagQcbFz usYqNiOrhd8kKTnSF8uvixL3c8RNqm8PDX/OFg== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_err() instead of printk() for more consistent output. (prints device name, etc). Signed-off-by: Enrico Weigelt --- drivers/tty/serial/timbuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c index 19d38b5..dcce936 100644 --- a/drivers/tty/serial/timbuart.c +++ b/drivers/tty/serial/timbuart.c @@ -470,8 +470,7 @@ static int timbuart_probe(struct platform_device *dev) err_register: kfree(uart); err_mem: - printk(KERN_ERR "timberdale: Failed to register Timberdale UART: %d\n", - err); + dev_err(&dev->dev, "Failed to register Timberdale UART: %d\n", err); return err; } From patchwork Sat Apr 27 12:52:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88654933 for ; Sat, 27 Apr 2019 12:55:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A59D202DB for ; Sat, 27 Apr 2019 12:55:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DAB728691; Sat, 27 Apr 2019 12:55:19 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 14994202DB for ; Sat, 27 Apr 2019 12:55:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727291AbfD0MzG (ORCPT ); Sat, 27 Apr 2019 08:55:06 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:46351 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727111AbfD0MxU (ORCPT ); Sat, 27 Apr 2019 08:53:20 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MoNy4-1h0jOB13NY-00ooZP; Sat, 27 Apr 2019 14:52:55 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 25/41] drivers: tty: serial: timbuart: fix formatting issues Date: Sat, 27 Apr 2019 14:52:06 +0200 Message-Id: <1556369542-13247-26-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:dHmoa7nRbvk336kCXOJfWYY+mUp7+Lq3TccEDqKxr5HUdU0dY6C yzuj71JxmIOUypO0f3pRhohp2gsNBabdH6V+CbQXryApBGH2Qcpkk/9cghWYtQLFmk7hZJw tepHWArJtIL3O9kTqTVYZs321PvyO/k3/FRT6KFOh/DxNZXymlya5ap69Okq5lTHOD9MAiI qb5auophN8XTtreo3NFMg== X-UI-Out-Filterresults: notjunk:1;V03:K0:1IFakNoqoRU=:g2IC/h4Lb8irwRUcRILQAP iJHtLIZRLP5jlnbby/VOYf6KFSoGCWWof47H5xhbtd8s1pPKoP5Yb+s+gq5hl2M/COoUG5QaR o6990bSVnv8p2v0LIt58daQqegXiGmvrX4cpJlges1GbZrSY/dExLVQyUMuGYKgXZ4gS+QCUi DUWO0R9GfpV81xuEYMWDH+/Bw+/jx758tebwFjMi5P+XAhZe3AahPniroFjOQEaLlPc9OACxV z0m/HLrSRyTVwbdzn/R3WyGR5qG8Qydf6ZCXFxsqGvglAFE7wX96D7Hbirq0yAOWUhNcrV99V nl69e4FBSN4KlDivbdI7WQri0vhNY84IvRo1IiEE/ZHpTnuXBQHi6+rKrCr888njr6X3lV11R +NNhXY2FcFDgZ+HnlvCcFs5NnEra46YiNivW4ohwP8Oc33TYcFbJRX84sZu0ky/s9ufExRy/n oi7lKs3kB8WUj9e5TOxMzeT8ZLvxwUxMNfWe7y49JmYueF3lZK4WAPTe0h3NNGjnfXRcs5X3q Rdh1w66GcZg+tXQYCR/QeLxPzFeL9uKD2DNxghOUH9XdzyEJC73ltkEoOg++LUt52xUMj5LRo HsVfsVAiJN/tqJkb5OzZGSqYP7kx3Ap2w5Tz+Np1uXHj61xGc5qFy/gaf3O2/0K3Be+jXiMFG 34KWo5PYCkalr9cKipeGjgZoZ3bQ0/g8AlKtDf5ADS6q158yxnznvMGHnPdlIOp7B57YTmsrg fLdpcQxU+qvrnDCsyjp/20ZqPkXCHMuK4kASFw== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warnings: WARNING: Missing a blank line after declarations #43: FILE: drivers/tty/serial/timbuart.c:43: + u32 ier = ioread32(port->membase + TIMBUART_IER) & ~RXFLAGS; + iowrite32(ier, port->membase + TIMBUART_IER); WARNING: Missing a blank line after declarations #50: FILE: drivers/tty/serial/timbuart.c:50: + u32 ier = ioread32(port->membase + TIMBUART_IER) & ~TXBAE; + iowrite32(ier, port->membase + TIMBUART_IER); WARNING: Missing a blank line after declarations #86: FILE: drivers/tty/serial/timbuart.c:86: + u8 ch = ioread8(port->membase + TIMBUART_RXFIFO); + port->icount.rx++; WARNING: Missing a blank line after declarations #202: FILE: drivers/tty/serial/timbuart.c:202: + u8 cts = ioread8(port->membase + TIMBUART_CTRL); + dev_dbg(port->dev, "%s - cts %x\n", __func__, cts); WARNING: Block comments use * on subsequent lines #296: FILE: drivers/tty/serial/timbuart.c:296: + /* The serial layer calls into this once with old = NULL when setting + up initially */ WARNING: Block comments use a trailing */ on a separate line #296: FILE: drivers/tty/serial/timbuart.c:296: Signed-off-by: Enrico Weigelt --- drivers/tty/serial/timbuart.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c index dcce936..d80c332 100644 --- a/drivers/tty/serial/timbuart.c +++ b/drivers/tty/serial/timbuart.c @@ -40,6 +40,7 @@ static void timbuart_stop_rx(struct uart_port *port) { /* spin lock held by upper layer, disable all RX interrupts */ u32 ier = ioread32(port->membase + TIMBUART_IER) & ~RXFLAGS; + iowrite32(ier, port->membase + TIMBUART_IER); } @@ -47,6 +48,7 @@ static void timbuart_stop_tx(struct uart_port *port) { /* spinlock held by upper layer, disable TX interrupt */ u32 ier = ioread32(port->membase + TIMBUART_IER) & ~TXBAE; + iowrite32(ier, port->membase + TIMBUART_IER); } @@ -83,6 +85,7 @@ static void timbuart_rx_chars(struct uart_port *port) while (ioread32(port->membase + TIMBUART_ISR) & RXDP) { u8 ch = ioread8(port->membase + TIMBUART_RXFIFO); + port->icount.rx++; tty_insert_flip_char(tport, ch, TTY_NORMAL); } @@ -199,6 +202,7 @@ static void timbuart_tasklet(unsigned long arg) static unsigned int timbuart_get_mctrl(struct uart_port *port) { u8 cts = ioread8(port->membase + TIMBUART_CTRL); + dev_dbg(port->dev, "%s - cts %x\n", __func__, cts); if (cts & TIMBUART_CTRL_CTS) @@ -293,7 +297,8 @@ static void timbuart_set_termios(struct uart_port *port, baud = baudrates[bindex]; /* The serial layer calls into this once with old = NULL when setting - up initially */ + * up initially + */ if (old) tty_termios_copy_hw(termios, old); tty_termios_encode_baud_rate(termios, baud, baud); @@ -500,4 +505,3 @@ static int timbuart_remove(struct platform_device *dev) MODULE_DESCRIPTION("Timberdale UART driver"); MODULE_LICENSE("GPL v2"); MODULE_ALIAS("platform:timb-uart"); - From patchwork Sat Apr 27 12:52:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94AD114D5 for ; Sat, 27 Apr 2019 12:55:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 823E128450 for ; Sat, 27 Apr 2019 12:55:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F822286B9; Sat, 27 Apr 2019 12:55:05 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 136DC28450 for ; Sat, 27 Apr 2019 12:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727158AbfD0MxU (ORCPT ); Sat, 27 Apr 2019 08:53:20 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:47445 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbfD0MxT (ORCPT ); Sat, 27 Apr 2019 08:53:19 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MG9c4-1hYhE40ZmG-00GaDP; Sat, 27 Apr 2019 14:52:56 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 26/41] drivers: tty: serial: sunzilog: use dev_info() instead of printk() Date: Sat, 27 Apr 2019 14:52:07 +0200 Message-Id: <1556369542-13247-27-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:mAhDCbido9+iZFtRE4TdsCbv1vAr9Joy1VbiPU+XYBGA3j+D1i7 8tBC3ZCd802YRf6g/j2wz/Rpr+rNfM3/C9qVun5TY7ecwFsuAGNQ9PkxsomQbrK7CQSqD9t lNVdEtEZXMG24nxtzJ9rZ1N16lMRzqr8eSk0ACn+9ciZWtRdbmtCGj6cenKYS6p9eJZMPGK +Gf+FP3wxSs4kFyyMktug== X-UI-Out-Filterresults: notjunk:1;V03:K0:0SWS/YPHXl4=:xXTpK4xlmi8jyBmh5+ECF2 2f9XUV5idTnhYPicmiA4uN9epzHkr0tM2wgGgfiaPSshMy4/xofCE6fehmo0kVhDKiF8UVbMG XR8itAO4whaeeAqp9zT5DYaaSKJ2vtlF2N3zWHCsj7pHbAGbhkSM9yxnLE5xXWK/rrI3rNFKs YIL05g1WGyY8xdJe4HFEc4NcJhKh0f6h9LUIcxhmKvH9XKe8ycd0Xe3RywlvzHmnWjcU1z9Vj T6vHj0osI3kq595a3frTeGB0+jpxTiEP9p6T6XiuZvNJcMFcVfR19rf4Gj2yDgphVYvMsQryv Ksrc5FpwDCtuUawC5zqz/Epzic7ZckEfLjO0q7+UoqsY0qU2w5PVM0DrEJwWrMmVrMhIrOFFw 81XKksVUTD4AuR+sXqurAVCxRwn6CXlYCaUeQij0f2JVzNuq7fbmsbAgJpeEfV5/tIPLtdEaR vBt9XarGGDlzVuyi92jSjgdBgtKrY7LZr+9m6ioeJxy2ufRg0N32AcwiJeOcaGThmWCpht23Y m1ocX1+Dlr8+TlglVKRnWgCqKWI2lhH9KcTZN8l27ajs49owlLXy8zkyJUHaswH8NaJ7Vo4HJ /Q2JJ0/z9DlIk0AXgG0IJq1NdJttYEUAtvhk5Ms9Ad6jVBqAzeWwQ3FXaB1XSVn+7YmVjffw6 nb8ej0Ia5DlAdpZ4D1aTwGxiigyP+2TidNSBWB6whE/gbiB9kfqBscb0vJZXs8WN/bVMk7qiH gIjVcmF0qrPRPdGta3xTuJy8beZywXyoAWaOnw== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_info() instead of printk() for more consistent output. (prints device name, etc). Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sunzilog.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c index bc7af8b..6285bba 100644 --- a/drivers/tty/serial/sunzilog.c +++ b/drivers/tty/serial/sunzilog.c @@ -1489,14 +1489,12 @@ static int zs_probe(struct platform_device *op) } uart_inst++; } else { - printk(KERN_INFO "%s: Keyboard at MMIO 0x%llx (irq = %d) " + dev_info(&op->dev, "Keyboard at MMIO 0x%llx (irq = %d) " "is a %s\n", - dev_name(&op->dev), (unsigned long long) up[0].port.mapbase, op->archdata.irqs[0], sunzilog_type(&up[0].port)); - printk(KERN_INFO "%s: Mouse at MMIO 0x%llx (irq = %d) " + dev_info(&op->dev, "Mouse at MMIO 0x%llx (irq = %d) " "is a %s\n", - dev_name(&op->dev), (unsigned long long) up[1].port.mapbase, op->archdata.irqs[0], sunzilog_type(&up[1].port)); kbm_inst++; From patchwork Sat Apr 27 12:52:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920323 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C407F1575 for ; Sat, 27 Apr 2019 12:54:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3DF6286B2 for ; Sat, 27 Apr 2019 12:54:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A80B5286E0; Sat, 27 Apr 2019 12:54:40 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 88A71286B2 for ; Sat, 27 Apr 2019 12:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbfD0Myd (ORCPT ); Sat, 27 Apr 2019 08:54:33 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:44773 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbfD0Mxc (ORCPT ); Sat, 27 Apr 2019 08:53:32 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M8yso-1hOCqc49nq-0069pN; Sat, 27 Apr 2019 14:52:57 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 27/41] drivers: tty: serial: sunzilog: fix formatting issues Date: Sat, 27 Apr 2019 14:52:08 +0200 Message-Id: <1556369542-13247-28-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:Z847pBHLI6QbxAGimBdq6+JmZrHYKMuxRAjW98flGjUtS5oHGJC 2yP7klqt22fYcBJ7wz2PjoaV7D64B1mPwQH9AQj7l5Pif1Pndm+YkU0UNordwQ5Wy1IxDut dU/69hgbv0mSPvXN1+wW7rRWDrd2Q3LYi4dUSMc59RL3wnqb6nh5ZX42JvsXC4WFJoJr6tj A9xdCttEcAPucvS++lRjw== X-UI-Out-Filterresults: notjunk:1;V03:K0:AU9H7y3rHqc=:KV7DAkxA+ztT5D1OW4d8ju SdeTngBm2uWP6+kqMqbBcqXig3w/3u0VlHf1UsWWSX20R/I93CTK303/klEiv4WI9z3b2xsbw nm4IexqUdtfveufFrBJ05pEHjjsfoQYTMEF45k8sCo7BcZ5+eazPGsoh1PkbV1WKl0BdBcm0w T0N+kDAeU1qkLyHLh/icSLkHMwOtm4mEmYZYo5/yKixGFxRqh3sGKyfH1LdkYfR54sgTXGfN9 4HXQ9bLSy91Xw3oXIxdahYorq9s14O+z1s5rBTVsWSDkAByqdmaISzfBiKepXgn3fDdEb2B22 9pkHcH38P0Eem5tHNcegF5g3cQXeUaMyzn6RpKx2XGNe6ssb+GFuQIoySpFVFIODal7/6xRXd VZt1mZQHlPQFJXBvLTs3i8GGLY/mDuXl+m5TD2XWuRAFQ7+zgQCAl9noGd54/wcqud3h7jHHS 7pw6srZpGkEp+3TCn2UtbsXdlsAXzFMTERLRI7ERXxbUoNprGTjfSdZ/kbqKl275QmMrtbKvk KvaDabB/78EcoSsFS9vpVkpPVNZ5QXfB60wNdEg2c+YyuIKu07sJwLwWDk3MdUuzAzuY5LEVW sMYVWV5wFwBGOCMSG1hKkmRCUn0iUgdzuC0+ymUJR6LT+iWdoyV+jJR3xQU0XSSrn9PkZND5T Ebq+WWV+DsOfJmpFREW8ZVxEiXU0Upm+cJ1VA3K985Z4JR/Gn4uC5oKfSwJ3cFJ1rAhUd122O KRk1jYCvn65Ie0aTVkoto85wFK3YAVwtOQc+/A== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warnings: WARNING: Use #include instead of #38: FILE: drivers/tty/serial/sunzilog.c:38: +#include WARNING: line over 80 characters #109: FILE: drivers/tty/serial/sunzilog.c:109: +#define ZILOG_CHANNEL_FROM_PORT(PORT) ((struct zilog_channel __iomem *)((PORT)->membase)) WARNING: line over 80 characters #116: FILE: drivers/tty/serial/sunzilog.c:116: +#define ZS_WANTS_MODEM_STATUS(UP) ((UP)->flags & SUNZILOG_FLAG_MODEM_STATUS) WARNING: line over 80 characters #179: FILE: drivers/tty/serial/sunzilog.c:179: +static int __load_zsregs(struct zilog_channel __iomem *channel, unsigned char *regs) WARNING: Missing a blank line after declarations #188: FILE: drivers/tty/serial/sunzilog.c:188: + unsigned char stat = read_zsreg(channel, R1); + if (stat & ALL_SNT) ERROR: trailing whitespace #231: FILE: drivers/tty/serial/sunzilog.c:231: +^I$ WARNING: braces {} are not necessary for any arm of this statement #276: FILE: drivers/tty/serial/sunzilog.c:276: + if (ZS_TX_ACTIVE(up)) { [...] + } else { [...] ERROR: else should follow close brace '}' #378: FILE: drivers/tty/serial/sunzilog.c:378: + } + else if (r1 & PAR_ERR) ERROR: code indent should use tabs where possible #397: FILE: drivers/tty/serial/sunzilog.c:397: +^I^I ^Itty_insert_flip_char(port, ch, flag);$ WARNING: please, no space before tabs #397: FILE: drivers/tty/serial/sunzilog.c:397: +^I^I ^Itty_insert_flip_char(port, ch, flag);$ WARNING: line over 80 characters #440: FILE: drivers/tty/serial/sunzilog.c:440: + /* The Zilog just gives us an interrupt when DCD/CTS/etc. change. WARNING: line over 80 characters #441: FILE: drivers/tty/serial/sunzilog.c:441: + * But it does not tell us which bit has changed, we have to keep WARNING: Missing a blank line after declarations #464: FILE: drivers/tty/serial/sunzilog.c:464: + unsigned char status = readb(&channel->control); + ZSDELAY(); WARNING: line over 80 characters #468: FILE: drivers/tty/serial/sunzilog.c:468: + * It can occur because of how we do serial console writes. It would WARNING: line over 80 characters #469: FILE: drivers/tty/serial/sunzilog.c:469: + * be nice to transmit console writes just like we normally would for WARNING: line over 80 characters #470: FILE: drivers/tty/serial/sunzilog.c:470: + * a TTY line. (ie. buffered and TX interrupt driven). That is not WARNING: line over 80 characters #471: FILE: drivers/tty/serial/sunzilog.c:471: + * easy because console writes cannot sleep. One solution might be WARNING: line over 80 characters #593: FILE: drivers/tty/serial/sunzilog.c:593: +static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *port) WARNING: plain inline is preferred over __inline__ #593: FILE: drivers/tty/serial/sunzilog.c:593: +static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *port) ERROR: trailing whitespace #664: FILE: drivers/tty/serial/sunzilog.c:664: +^I/* NOTE: Not subject to 'transmitter active' rule. */ $ ERROR: trailing whitespace #752: FILE: drivers/tty/serial/sunzilog.c:752: +^I^I/* NOTE: Not subject to 'transmitter active' rule. */ $ ERROR: trailing whitespace #779: FILE: drivers/tty/serial/sunzilog.c:779: +^I^I/* NOTE: Not subject to 'transmitter active' rule. */ $ WARNING: line over 80 characters #999: FILE: drivers/tty/serial/sunzilog.c:999: +static int sunzilog_verify_port(struct uart_port *port, struct serial_struct *ser) WARNING: Missing a blank line after declarations #1142: FILE: drivers/tty/serial/sunzilog.c:1142: + unsigned char val = readb(&channel->control); + if (val & Tx_BUF_EMP) { WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... #1230: FILE: drivers/tty/serial/sunzilog.c:1230: + printk(KERN_INFO "Console: ttyS%d (SunZilog zs%d)\n", WARNING: braces {} are not necessary for single statement blocks #1383: FILE: drivers/tty/serial/sunzilog.c:1383: + if (__load_zsregs(channel, up->curregs)) { + up->flags |= SUNZILOG_FLAG_ESCC; + } WARNING: quoted string split across lines #1493: FILE: drivers/tty/serial/sunzilog.c:1493: + dev_info(&op->dev, "Keyboard at MMIO 0x%llx (irq = %d) " + "is a %s\n", WARNING: quoted string split across lines #1497: FILE: drivers/tty/serial/sunzilog.c:1497: + dev_info(&op->dev, "Mouse at MMIO 0x%llx (irq = %d) " + "is a %s\n", WARNING: Missing a blank line after declarations #1581: FILE: drivers/tty/serial/sunzilog.c:1581: + struct uart_sunzilog_port *up = sunzilog_irq_chain; + err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED, WARNING: line over 80 characters #1590: FILE: drivers/tty/serial/sunzilog.c:1590: + /* printk (KERN_INFO "Enable IRQ for ZILOG Hardware %p\n", up); */ WARNING: line over 80 characters #1627: FILE: drivers/tty/serial/sunzilog.c:1627: + /* printk (KERN_INFO "Disable IRQ for ZILOG Hardware %p\n", up); */ ERROR: trailing statements should be on next line #1248: FILE: drivers/tty/serial/sunzilog.c:1248: + case B150: baud = 150; break; ERROR: trailing statements should be on next line #1249: FILE: drivers/tty/serial/sunzilog.c:1249: + case B300: baud = 300; break; ERROR: trailing statements should be on next line #1250: FILE: drivers/tty/serial/sunzilog.c:1250: + case B600: baud = 600; break; ERROR: trailing statements should be on next line #1251: FILE: drivers/tty/serial/sunzilog.c:1251: + case B1200: baud = 1200; break; ERROR: trailing statements should be on next line #1252: FILE: drivers/tty/serial/sunzilog.c:1252: + case B2400: baud = 2400; break; ERROR: trailing statements should be on next line #1253: FILE: drivers/tty/serial/sunzilog.c:1253: + case B4800: baud = 4800; break; ERROR: trailing statements should be on next line #1254: FILE: drivers/tty/serial/sunzilog.c:1254: + default: case B9600: baud = 9600; break; ERROR: trailing statements should be on next line #1255: FILE: drivers/tty/serial/sunzilog.c:1255: + case B19200: baud = 19200; break; ERROR: trailing statements should be on next line #1256: FILE: drivers/tty/serial/sunzilog.c:1256: + case B38400: baud = 38400; break; Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sunzilog.c | 118 +++++++++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 42 deletions(-) diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c index 6285bba..17b0520 100644 --- a/drivers/tty/serial/sunzilog.c +++ b/drivers/tty/serial/sunzilog.c @@ -106,14 +106,17 @@ struct uart_sunzilog_port { static void sunzilog_putchar(struct uart_port *port, int ch); -#define ZILOG_CHANNEL_FROM_PORT(PORT) ((struct zilog_channel __iomem *)((PORT)->membase)) -#define UART_ZILOG(PORT) ((struct uart_sunzilog_port *)(PORT)) +#define ZILOG_CHANNEL_FROM_PORT(PORT) \ + ((struct zilog_channel __iomem *)((PORT)->membase)) +#define UART_ZILOG(PORT) \ + ((struct uart_sunzilog_port *)(PORT)) #define ZS_IS_KEYB(UP) ((UP)->flags & SUNZILOG_FLAG_CONS_KEYB) #define ZS_IS_MOUSE(UP) ((UP)->flags & SUNZILOG_FLAG_CONS_MOUSE) #define ZS_IS_CONS(UP) ((UP)->flags & SUNZILOG_FLAG_IS_CONS) #define ZS_IS_KGDB(UP) ((UP)->flags & SUNZILOG_FLAG_IS_KGDB) -#define ZS_WANTS_MODEM_STATUS(UP) ((UP)->flags & SUNZILOG_FLAG_MODEM_STATUS) +#define ZS_WANTS_MODEM_STATUS(UP) \ + ((UP)->flags & SUNZILOG_FLAG_MODEM_STATUS) #define ZS_IS_CHANNEL_A(UP) ((UP)->flags & SUNZILOG_FLAG_IS_CHANNEL_A) #define ZS_REGS_HELD(UP) ((UP)->flags & SUNZILOG_FLAG_REGS_HELD) #define ZS_TX_STOPPED(UP) ((UP)->flags & SUNZILOG_FLAG_TX_STOPPED) @@ -176,7 +179,8 @@ static void sunzilog_clear_fifo(struct zilog_channel __iomem *channel) /* This function must only be called when the TX is not busy. The UART * port lock must be held and local interrupts disabled. */ -static int __load_zsregs(struct zilog_channel __iomem *channel, unsigned char *regs) +static int __load_zsregs(struct zilog_channel __iomem *channel, + unsigned char *regs) { int i; int escc; @@ -185,6 +189,7 @@ static int __load_zsregs(struct zilog_channel __iomem *channel, unsigned char *r /* Let pending transmits finish. */ for (i = 0; i < 1000; i++) { unsigned char stat = read_zsreg(channel, R1); + if (stat & ALL_SNT) break; udelay(100); @@ -228,7 +233,7 @@ static int __load_zsregs(struct zilog_channel __iomem *channel, unsigned char *r /* Lower and upper byte of baud rate generator divisor. */ write_zsreg(channel, R12, regs[R12]); write_zsreg(channel, R13, regs[R13]); - + /* Now rewrite R14, with BRENAB (if set). */ write_zsreg(channel, R14, regs[R14]); @@ -273,11 +278,10 @@ static void sunzilog_maybe_update_regs(struct uart_sunzilog_port *up, struct zilog_channel __iomem *channel) { if (!ZS_REGS_HELD(up)) { - if (ZS_TX_ACTIVE(up)) { + if (ZS_TX_ACTIVE(up)) up->flags |= SUNZILOG_FLAG_REGS_HELD; - } else { + else __load_zsregs(channel, up->curregs); - } } } @@ -374,8 +378,7 @@ static void sunzilog_kbdms_receive_chars(struct uart_sunzilog_port *up, up->port.icount.brk++; if (uart_handle_break(&up->port)) continue; - } - else if (r1 & PAR_ERR) + } else if (r1 & PAR_ERR) up->port.icount.parity++; else if (r1 & CRC_ERR) up->port.icount.frame++; @@ -394,7 +397,7 @@ static void sunzilog_kbdms_receive_chars(struct uart_sunzilog_port *up, if (up->port.ignore_status_mask == 0xff || (r1 & up->port.ignore_status_mask) == 0) { - tty_insert_flip_char(port, ch, flag); + tty_insert_flip_char(port, ch, flag); } if (r1 & Rx_OVR) tty_insert_flip_char(port, 0, TTY_OVERRUN); @@ -437,9 +440,9 @@ static void sunzilog_status_handle(struct uart_sunzilog_port *up, if (status & SYNC) up->port.icount.dsr++; - /* The Zilog just gives us an interrupt when DCD/CTS/etc. change. - * But it does not tell us which bit has changed, we have to keep - * track of this ourselves. + /* The Zilog just gives us an interrupt when DCD/CTS/etc. + * change.But it does not tell us which bit has changed, + * we have to keep track of this ourselves. */ if ((status ^ up->prev_status) ^ DCD) uart_handle_dcd_change(&up->port, @@ -461,15 +464,17 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, if (ZS_IS_CONS(up)) { unsigned char status = readb(&channel->control); + ZSDELAY(); /* TX still busy? Just wait for the next TX done interrupt. * - * It can occur because of how we do serial console writes. It would - * be nice to transmit console writes just like we normally would for - * a TTY line. (ie. buffered and TX interrupt driven). That is not - * easy because console writes cannot sleep. One solution might be - * to poll on enough port->xmit space becoming free. -DaveM + * It can occur because of how we do serial console writes. + * It would be nice to transmit console writes just like we + * normally would for a TTY line. (ie. buffered and TX + * interrupt driven). That is not easy because console + * writes cannot sleep. One solution might be to poll on + * enough port->xmit space becoming free. -DaveM */ if (!(status & Tx_BUF_EMP)) return; @@ -590,7 +595,8 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id) /* A convenient way to quickly get R0 status. The caller must _not_ hold the * port lock, it is acquired here. */ -static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *port) +static inline unsigned char +sunzilog_read_channel_status(struct uart_port *port) { struct zilog_channel __iomem *channel; unsigned char status; @@ -661,13 +667,13 @@ static void sunzilog_set_mctrl(struct uart_port *port, unsigned int mctrl) else clear_bits |= DTR; - /* NOTE: Not subject to 'transmitter active' rule. */ + /* NOTE: Not subject to 'transmitter active' rule. */ up->curregs[R5] |= set_bits; up->curregs[R5] &= ~clear_bits; write_zsreg(channel, R5, up->curregs[R5]); } -/* The port lock is held and interrupts are disabled. */ +/* The port lock is held and interrupts are disabled. */ static void sunzilog_stop_tx(struct uart_port *port) { struct uart_sunzilog_port *up = @@ -749,7 +755,7 @@ static void sunzilog_enable_ms(struct uart_port *port) if (new_reg != up->curregs[R15]) { up->curregs[R15] = new_reg; - /* NOTE: Not subject to 'transmitter active' rule. */ + /* NOTE: Not subject to 'transmitter active' rule. */ write_zsreg(channel, R15, up->curregs[R15] & ~WR7pEN); } } @@ -776,7 +782,7 @@ static void sunzilog_break_ctl(struct uart_port *port, int break_state) if (new_reg != up->curregs[R5]) { up->curregs[R5] = new_reg; - /* NOTE: Not subject to 'transmitter active' rule. */ + /* NOTE: Not subject to 'transmitter active' rule. */ write_zsreg(channel, R5, up->curregs[R5]); } @@ -996,7 +1002,8 @@ static void sunzilog_config_port(struct uart_port *port, int flags) } /* We do not support letting the user mess with the divisor, IRQ, etc. */ -static int sunzilog_verify_port(struct uart_port *port, struct serial_struct *ser) +static int sunzilog_verify_port(struct uart_port *port, + struct serial_struct *ser) { return -EINVAL; } @@ -1139,6 +1146,7 @@ static void sunzilog_putchar(struct uart_port *port, int ch) */ do { unsigned char val = readb(&channel->control); + if (val & Tx_BUF_EMP) { ZSDELAY(); break; @@ -1237,15 +1245,34 @@ static int __init sunzilog_console_setup(struct console *con, char *options) * this hackish cflag thing is OK. */ switch (con->cflag & CBAUD) { - case B150: baud = 150; break; - case B300: baud = 300; break; - case B600: baud = 600; break; - case B1200: baud = 1200; break; - case B2400: baud = 2400; break; - case B4800: baud = 4800; break; - default: case B9600: baud = 9600; break; - case B19200: baud = 19200; break; - case B38400: baud = 38400; break; + case B150: + baud = 150; + break; + case B300: + baud = 300; + break; + case B600: + baud = 600; + break; + case B1200: + baud = 1200; + break; + case B2400: + baud = 2400; + break; + case B4800: + baud = 4800; + break; + default: + case B9600: + baud = 9600; + break; + case B19200: + baud = 19200; + break; + case B38400: + baud = 38400; + break; } brg = BPS_TO_BRG(baud, ZS_CLOCK / ZS_CLOCK_DIVISOR); @@ -1380,9 +1407,9 @@ static void sunzilog_init_hw(struct uart_sunzilog_port *up) up->curregs[R14] = BRSRC | BRENAB; up->curregs[R15] = FIFOEN; /* Use FIFO if on ESCC */ up->curregs[R7p] = TxFIFO_LVL | RxFIFO_LVL; - if (__load_zsregs(channel, up->curregs)) { + if (__load_zsregs(channel, up->curregs)) up->flags |= SUNZILOG_FLAG_ESCC; - } + /* Only enable interrupts if an ISR handler available */ if (up->flags & SUNZILOG_FLAG_ISR_HANDLER) up->curregs[R9] |= MIE; @@ -1489,12 +1516,12 @@ static int zs_probe(struct platform_device *op) } uart_inst++; } else { - dev_info(&op->dev, "Keyboard at MMIO 0x%llx (irq = %d) " - "is a %s\n", + dev_info(&op->dev, + "Keyboard at MMIO 0x%llx (irq = %d) is a %s\n", (unsigned long long) up[0].port.mapbase, op->archdata.irqs[0], sunzilog_type(&up[0].port)); - dev_info(&op->dev, "Mouse at MMIO 0x%llx (irq = %d) " - "is a %s\n", + dev_info(&op->dev, + "Mouse at MMIO 0x%llx (irq = %d) is a %s\n", (unsigned long long) up[1].port.mapbase, op->archdata.irqs[0], sunzilog_type(&up[1].port)); kbm_inst++; @@ -1578,6 +1605,7 @@ static int __init sunzilog_init(void) if (zilog_irq) { struct uart_sunzilog_port *up = sunzilog_irq_chain; + err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED, "zs", sunzilog_irq_chain); if (err) @@ -1587,7 +1615,10 @@ static int __init sunzilog_init(void) while (up) { struct zilog_channel __iomem *channel; - /* printk (KERN_INFO "Enable IRQ for ZILOG Hardware %p\n", up); */ + /* printk(KERN_INFO + * "Enable IRQ for ZILOG Hardware %p\n", + * up); + */ channel = ZILOG_CHANNEL_FROM_PORT(&up->port); up->flags |= SUNZILOG_FLAG_ISR_HANDLER; up->curregs[R9] |= MIE; @@ -1624,7 +1655,10 @@ static void __exit sunzilog_exit(void) while (up) { struct zilog_channel __iomem *channel; - /* printk (KERN_INFO "Disable IRQ for ZILOG Hardware %p\n", up); */ + /* printk(KERN_INFO + * "Disable IRQ for ZILOG Hardware %p\n", + * up); + */ channel = ZILOG_CHANNEL_FROM_PORT(&up->port); up->flags &= ~SUNZILOG_FLAG_ISR_HANDLER; up->curregs[R9] &= ~MIE; From patchwork Sat Apr 27 12:52:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC3A914D5 for ; Sat, 27 Apr 2019 12:55:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCB76202DB for ; Sat, 27 Apr 2019 12:55:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFB8328691; Sat, 27 Apr 2019 12:55:18 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 82721202DB for ; Sat, 27 Apr 2019 12:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727350AbfD0MzG (ORCPT ); Sat, 27 Apr 2019 08:55:06 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:55429 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727076AbfD0MxU (ORCPT ); Sat, 27 Apr 2019 08:53:20 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MRCFw-1h5zEz3V3s-00N8iN; Sat, 27 Apr 2019 14:52:57 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 28/41] drivers: tty: serial: sunzilog: fix includes Date: Sat, 27 Apr 2019 14:52:09 +0200 Message-Id: <1556369542-13247-29-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:Vc4oNRhzaq0GImBAR5CgiZ+whb77bqy0PxtEF5afHcYFvx1oVZb siNewF36P93CZkzncVMQnr4mlIS/A8kCZTaukIk2D/GuBtTc3OHRLhlyKjwaq32J2XmrRlB f2vNOVy/3BrWxRfFIWguM5CtYi1a+WcUK3nW67RriXOHA4rE+69skktXGN0uJRmUq+H07n0 K1/tFtsXXjzqS2NXo4RKA== X-UI-Out-Filterresults: notjunk:1;V03:K0:WBmzZwx4lgo=:NspLTi8etU0+1fQAgbr3D+ 7NJFSTzzIk8QcOgiGlxnnfA2ff9WuC2M+mUQl8CvyQPR1cl5KPNVz+Gs6GXBQgE3j+OdFEawT DF05YFVSL08zlHfEFGE/TaD2nZByEqUJeW9HwLJGSeckhVexHLC2nadK/PuPkZ8nQB9SDQC3m ggNu6zfAJ11Ymokt621Nqj/cAvK8z2g4R951W43UVyRBAPjNJLZnAWzl69dWoVEF6khz0dvoy NB6mQKt80tpbAIibungsiH8r/5jjf6cFypWqPbSnSL8aM68Agdeu6XvXr9NvzuK6v7vttxLz1 XLkGi5Z7QILTWz1PWT2CP+pScInyi2KU5cWyYES+DQae3LncVeZn/UZqqvSmcV5vRuSUbWG1S ASupKOd9PdBnOLF7fgH4kGptvX4+k+m8hh+/IHKlLFPs4Z5V07XsPTjGP43ir6PzrBAkofC8R 6L72iwY6PeL8WMTHw/dSgL2YdMYSLFOpnbyHooEr5hYrThcvmcHJ+TqqxR/35kt8iKd/n6kpY SnCPBvP/ssZHx6Ve5P17ibQdCA38lmObFRnsxaRCxeO8ceOqqJJVhD0Rnj9qz0JmfcH23axV0 Cqo9n5OxSPdnKd10oAo8jAWkFqZFJHT3aNUP47SCVF6v8Hc030w7nv5Wy3TQJrANkYGs2zaDK CGdtJifVuhg6VVTvqYCedOdrWh+OZuszAW+DcmULVA8NOVb5UD1WF6EvFALLrnahi67Xh1A+O 1a1p4u9mxM+I2OORa29atLFeiS8iBIPcjEkwbg== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warning: WARNING: Use #include instead of #38: FILE: drivers/tty/serial/sunzilog.c:38: +#include Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sunzilog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c index 17b0520..85edb0d 100644 --- a/drivers/tty/serial/sunzilog.c +++ b/drivers/tty/serial/sunzilog.c @@ -34,8 +34,8 @@ #endif #include #include +#include -#include #include #include #include From patchwork Sat Apr 27 12:52:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 418551390 for ; Sat, 27 Apr 2019 12:53:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F9FB212D5 for ; Sat, 27 Apr 2019 12:53:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 208EC286EE; Sat, 27 Apr 2019 12:53:26 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 9F3A2202DB for ; Sat, 27 Apr 2019 12:53:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727226AbfD0MxY (ORCPT ); Sat, 27 Apr 2019 08:53:24 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:52931 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbfD0MxX (ORCPT ); Sat, 27 Apr 2019 08:53:23 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N5G1V-1gbeYR2mc1-0118EA; Sat, 27 Apr 2019 14:52:58 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 29/41] drivers: tty: serial: sunzilog: cleanup logging Date: Sat, 27 Apr 2019 14:52:10 +0200 Message-Id: <1556369542-13247-30-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:uxxvCa66CYSGi3Em4nuMPvtSzL45VE6ce5qM7EP5uZ2jwnJH/Rf VzWdbFvPirBwCJNu9f+Jwyc9lVwLpUGhejFkC7ldZJdxwR7DA2BRn+Vl0BQckBceQIF7qXC WyxgtztRffigF7v1SzndzvbVeMKNS2DbGfpYfH4EV+kNq293CGWXupsg6VWK6tqIR7aTFMf +tRlOKQpyia0QglzkJKNA== X-UI-Out-Filterresults: notjunk:1;V03:K0:y11A1qYqUqI=:8rPS9vSRvAXoCM5mb5BhuI WjE5yIVWUmfvDmA/AQ4ypZ+srkteIQs198t/oJOqUwZx5Rp3SPAGlO++llU7eG0RNjUsALBZq ZUvb6zw3f9sYxfEGhrGcIODhWtEO5jSQT4jIVhGurbVttXmC6195bA40SA690OEhhnFI/qCEi WSwQCTE70G9mH5ZlezP2NFueEhbG7kWFhxlgd96LRp1M9Nb1RFDllOpLiSlWwuEgrwYc/txEZ Jz5ZQj7Ur9cWxizBCpYX6lQ8MA/6iwg/+OwOBQFBaO9/oRTiS2RJak0h4ldhbLbwq2zihGidG 1rGx2U2IrRbLZ4JMDQtJAaneQYfRx5ecqZDD3UkLCP4Ei05fNui5iI8OpZLsbkAWQMiKsryvO 2kCFC0VRHePJTFZPqt9Ik9I0+gIoWPxwpdB8LfjEbEvj6k6/XPYQgonaBdL12TN97JkTvX7X2 zPhIz62y5IwAPzLzViaQBeYU5gJWmkOIO+mcjozxcMghEPjcS0OHpgnDA8TYNsChOcClWQN5U ZTY0rQijbKo7+Fr6crZw1sEjpHfTqC53E74pOXaRvnpUsI/uBenbneEDtTlLAdpaHpm6wTBvF WLYWF5qQwW7fPx/YeqvLiajUl4U2/pvABrvxsQRwW6Zi/tOfEaKerfDWvrHkfNX97OpQ9rjqO aqTj8y5/k3NSG39yLJhNMUwbIOnBHg3Ua0eJn7jjxkxpYM82/aUzhOuEWTDJOxHkTsenB2gj8 mCkokTH7YsmuOy7tzDvemUKChz641N4UkAKV+w== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix checkpatch warning: WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... #1238: FILE: drivers/tty/serial/sunzilog.c:1238: + printk(KERN_INFO "Console: ttyS%d (SunZilog zs%d)\n", Signed-off-by: Enrico Weigelt --- drivers/tty/serial/sunzilog.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c index 85edb0d..dba723c 100644 --- a/drivers/tty/serial/sunzilog.c +++ b/drivers/tty/serial/sunzilog.c @@ -1235,7 +1235,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options) if (up->port.type != PORT_SUNZILOG) return -1; - printk(KERN_INFO "Console: ttyS%d (SunZilog zs%d)\n", + pr_info("Console: ttyS%d (SunZilog zs%d)\n", (sunzilog_reg.minor - 64) + con->index, con->index); /* Get firmware console settings. */ @@ -1615,9 +1615,8 @@ static int __init sunzilog_init(void) while (up) { struct zilog_channel __iomem *channel; - /* printk(KERN_INFO - * "Enable IRQ for ZILOG Hardware %p\n", - * up); + /* pr_info("Enable IRQ for ZILOG Hardware %p\n", + * up); */ channel = ZILOG_CHANNEL_FROM_PORT(&up->port); up->flags |= SUNZILOG_FLAG_ISR_HANDLER; @@ -1655,9 +1654,8 @@ static void __exit sunzilog_exit(void) while (up) { struct zilog_channel __iomem *channel; - /* printk(KERN_INFO - * "Disable IRQ for ZILOG Hardware %p\n", - * up); + /* pr_info("Disable IRQ for ZILOG Hardware %p\n", + * up); */ channel = ZILOG_CHANNEL_FROM_PORT(&up->port); up->flags &= ~SUNZILOG_FLAG_ISR_HANDLER; From patchwork Sat Apr 27 12:52:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7193E1575 for ; Sat, 27 Apr 2019 12:53:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62B72202DB for ; Sat, 27 Apr 2019 12:53:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55BDB28742; Sat, 27 Apr 2019 12:53:26 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 C3CC6284E8 for ; Sat, 27 Apr 2019 12:53:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727249AbfD0MxZ (ORCPT ); Sat, 27 Apr 2019 08:53:25 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:39275 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727189AbfD0MxY (ORCPT ); Sat, 27 Apr 2019 08:53:24 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MVNF1-1hBGYO2EDP-00SLNE; Sat, 27 Apr 2019 14:52:59 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 30/41] drivers: tty: serial: ioc4_serial: use dev_warn() instead of printk() Date: Sat, 27 Apr 2019 14:52:11 +0200 Message-Id: <1556369542-13247-31-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:feZjQEPGewpWSo2bykBkAQkXP9Lb/ZtVsJ70Hc9aX4own7v09FA e65s7fBpQb+RWeo/XsvBCLQDRKkUOdSWYbg6QCmXdWbNheYrxgq5Ys1L3nrokeJAVzT8JZ+ 6QZ7hrXczsjiQ2m1ogHA/r87Uy8zuLwqRpXTsIxH63Kg2ZR+GURXbvN2XWzuqCWUQaBZhlg o8S6PJbm8wTsqW6D1wobQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:8TG/EySvt9A=:VKahn7CYd/R5vatknv4CIz CuHG0PZc2i5j9rVD60N2maMJL4Ee3r65/zW8DaiDk+zAPuKZD49EeMp7iaffcOumkyFaqiM8t +luCUaXSLZIf7RHuNFPwRYcBWNJ43cJi7sjf0EHHDGmub/EKExgGhgCrjEfa0v+n+448YXMgE lGF3w6/V6Mgt1QZ5pNXeWF0kTQsNJjAb7Y4RqIw7ZbAc+O3V+I9zXf7nSK2JbDaCL8Him2L7f l8QQc+xgVlpNQR0jiD9vdU52hQtY39fI4sqfbvjUsfJnu4SqVjwhNe4jH1PXOZTv5gTw84KBZ NkibSYlQFV3awhW8T9jAFhE9jtPnkYU0Vs7Ac1Oe4MMGZFJvBTZRRyNkitSl8XQbZ1WJfAlbB QS1OAIo9avolslFua/Nuq/y/iOLsNuT9C2ZFuqk4vJzoHfqjcS7qf3z/aagtWWj2Cq7D07Jvt HRLmuFLEuheS+vbBf2jp8nw1xQnRmOgDpcdn5L0cxoJx5Y57gx7DwS6uPN2nKaFxix4vbFLNZ AfH6XBWoj2lDLI2NKOg+owgscan6/eCmalRceowjyuyrdih0blP0ytyJ94NiELQlWc6HPoOGw OFryiG/2U3f/JVqdBhE2/2V0LKzJG1PwuuFYf5G3HVrAhwcwAJIDkFusy40yS4hP/fLgStVPA +nzeqpksFBXQvdpgCQwJ1DcGyWuv+kODQ2uT2nLMPRKYF2bVBXURnsDyBNucI4/XBJ4wnPMl7 6d+ueE0QRBCjWMFi9IaYeMV9hXPhSTm8QIcgHQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_warn() instead of printk() for more consistent output. (prints device name, etc). Signed-off-by: Enrico Weigelt --- drivers/tty/serial/ioc4_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c index db5b979..21c1b8f 100644 --- a/drivers/tty/serial/ioc4_serial.c +++ b/drivers/tty/serial/ioc4_serial.c @@ -2752,7 +2752,7 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd) the_port->dev = &pdev->dev; spin_lock_init(&the_port->lock); if (uart_add_one_port(u_driver, the_port) < 0) { - printk(KERN_WARNING + dev_warn(&pdev->dev, "%s: unable to add port %d bus %d\n", __func__, the_port->line, pdev->bus->number); } else { From patchwork Sat Apr 27 12:52:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6FD7614DB for ; Sat, 27 Apr 2019 12:53:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60F01202DB for ; Sat, 27 Apr 2019 12:53:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55440286B2; Sat, 27 Apr 2019 12:53:54 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 8CE70202DB for ; Sat, 27 Apr 2019 12:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727391AbfD0Mxf (ORCPT ); Sat, 27 Apr 2019 08:53:35 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53113 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727341AbfD0Mxe (ORCPT ); Sat, 27 Apr 2019 08:53:34 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MjSHa-1gwtte1jnW-00kyoz; Sat, 27 Apr 2019 14:53:00 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 31/41] drivers: tty: serial: ioc4_serial: use pr_*() instead of printk() Date: Sat, 27 Apr 2019 14:52:12 +0200 Message-Id: <1556369542-13247-32-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:fiKBrYJqLJy9d6Z3BYp1ydil3/7VOj7rwUo4ZkXQRtmPh18IG2D OSbQN4CxA9/sM8JT9588bdr/VNU9235zcyRb70HnigE6BmAAFSj+at5yTLSkL/h4Pmip7ee GDAfhOzwTUeSUoaLO0jY18ZOJjQOVygnipnz3otEZDoB5G63QWz8jDWSsi1258nEuR+8HaK 5OPNKU1HCgJU5ji/0qhrw== X-UI-Out-Filterresults: notjunk:1;V03:K0:ho4uLvEzDoE=:zuKxJ5kTAAFPPaKmx6pzYV K5UtxYJ5yRYkuve0VdS4JDA4HjVEJWpIfGTgXo0BkyHxJmKDQJlA2Y75xF3pqYxiaHmD53gxv +jLcqiVHeFHSOBbV2ilAiNIQGKY/+gt9oT4D4kg7HOXQTahdLD9KLRBUFBVWjLCTJ0+8eZSTX l+w4bzuctVJs7nnL2yaRun0EgP8/HKp04PYP10rmNvn1DBSDTOGaumxfjtmjtLn4txxqX1Kaf WTbEhxsXzXX+8XrmPY1IDyt11MsJ5Q0LCFqo7BoWcL9YwQ5eWVwGcd+J+RWs5zYRb6n6qXvNI /N0lz5esI0zqgvxkeIw1b7MDbsLOS8srq38jYphUWp4EWMK+TupywYTUIUueEaVs4JmS/u+kD dMHQ0qMSTBIgNRurIxxH2tvLzzgEwybnbFmZ61CXK+lIrBh+eRpvJUb5l6mNYvhm4Fs6jBVzX EXCdNtUU7umfv1tHcjOWeC/GVxfqdLN48x8xYzCsrxTTxUENjz2CrDctArGO1uFHzfzUAJW/Z CptJ+Tuggq9bv4655NFW3zrX67/l8uDUMTEV25Iqkl3aAyMH8VGFWkPYcR+6pIaS60kXU6pKr SL9GQutdI+0iLKzP241WvXCsmxmHZP39WVlm+4f50/JnQtkMS0Ha1BGXez0t+wIK1LBxvL57i 0dr8Z2DLtnc6WgkcZb+q1mJT7gjHIsxH9QJrp7iJzTrZmJwSVNuvJJW4X/ikDE/XFsJXpOHZz 5wiv98GsWC0PqC/r1MyOsrtLqhJiAietiC+CwQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fixes a bunch of checkpatch warnings: WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #930: FILE: drivers/tty/serial/ioc4_serial.c:930: + printk(KERN_ERR WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #945: FILE: drivers/tty/serial/ioc4_serial.c:945: + printk(KERN_ERR WARNING: printk() should include KERN_ facility level #1028: FILE: drivers/tty/serial/ioc4_serial.c:1028: + printk ("%s : %d : mem 0x%p sio_ir 0x%x sio_ies 0x%x " WARNING: space prohibited between function name and open parenthesis '(' #1028: FILE: drivers/tty/serial/ioc4_serial.c:1028: + printk ("%s : %d : mem 0x%p sio_ir 0x%x sio_ies 0x%x " WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... #1064: FILE: drivers/tty/serial/ioc4_serial.c:1064: + printk(KERN_INFO "IOC4 firmware revision %d\n", ioc4_revid); WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #1066: FILE: drivers/tty/serial/ioc4_serial.c:1066: + printk(KERN_WARNING WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #1080: FILE: drivers/tty/serial/ioc4_serial.c:1080: + printk(KERN_WARNING WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #1870: FILE: drivers/tty/serial/ioc4_serial.c:1870: + printk(KERN_WARNING "IOC4 serial: " WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #2170: FILE: drivers/tty/serial/ioc4_serial.c:2170: + printk(KERN_WARNING "IOC4 serial: " WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #2796: FILE: drivers/tty/serial/ioc4_serial.c:2796: + printk(KERN_WARNING WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #2804: FILE: drivers/tty/serial/ioc4_serial.c:2804: + printk(KERN_WARNING WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #2818: FILE: drivers/tty/serial/ioc4_serial.c:2818: + printk(KERN_WARNING "ioc4_attach_one" WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #2828: FILE: drivers/tty/serial/ioc4_serial.c:2828: + printk(KERN_WARNING WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #2861: FILE: drivers/tty/serial/ioc4_serial.c:2861: + printk(KERN_WARNING WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #2917: FILE: drivers/tty/serial/ioc4_serial.c:2917: + printk(KERN_WARNING WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... #2923: FILE: drivers/tty/serial/ioc4_serial.c:2923: + printk(KERN_WARNING Signed-off-by: Enrico Weigelt --- drivers/tty/serial/ioc4_serial.c | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c index 21c1b8f..4ab67f1 100644 --- a/drivers/tty/serial/ioc4_serial.c +++ b/drivers/tty/serial/ioc4_serial.c @@ -927,8 +927,7 @@ static void handle_dma_error_intr(void *arg, uint32_t other_ir) writel(hooks->intr_dma_error, &port->ip_mem->other_ir.raw); if (readl(&port->ip_mem->pci_err_addr_l.raw) & IOC4_PCI_ERR_ADDR_VLD) { - printk(KERN_ERR - "PCI error address is 0x%llx, " + pr_err("PCI error address is 0x%llx, " "master is serial port %c %s\n", (((uint64_t)readl(&port->ip_mem->pci_err_addr_h) << 32) @@ -942,8 +941,7 @@ static void handle_dma_error_intr(void *arg, uint32_t other_ir) if (readl(&port->ip_mem->pci_err_addr_l.raw) & IOC4_PCI_ERR_ADDR_MUL_ERR) { - printk(KERN_ERR - "Multiple errors occurred\n"); + pr_err("Multiple errors occurred\n"); } } spin_unlock_irqrestore(&port->ip_lock, flags); @@ -1025,7 +1023,7 @@ static irqreturn_t ioc4_intr(int irq, void *arg) unsigned long flag; spin_lock_irqsave(&soft->is_ir_lock, flag); - printk ("%s : %d : mem 0x%p sio_ir 0x%x sio_ies 0x%x " + pr_debug("%s : %d : mem 0x%p sio_ir 0x%x sio_ies 0x%x " "other_ir 0x%x other_ies 0x%x mask 0x%x\n", __func__, __LINE__, (void *)mem, readl(&mem->sio_ir.raw), @@ -1061,9 +1059,9 @@ static inline int ioc4_attach_local(struct ioc4_driver_data *idd) /* IOC4 firmware must be at least rev 62 */ pci_read_config_word(pdev, PCI_COMMAND_SPECIAL, &ioc4_revid); - printk(KERN_INFO "IOC4 firmware revision %d\n", ioc4_revid); + pr_info("IOC4 firmware revision %d\n", ioc4_revid); if (ioc4_revid < ioc4_revid_min) { - printk(KERN_WARNING + pr_warn( "IOC4 serial not supported on firmware rev %d, " "please upgrade to rev %d or higher\n", ioc4_revid, ioc4_revid_min); @@ -1077,8 +1075,7 @@ static inline int ioc4_attach_local(struct ioc4_driver_data *idd) port_number++) { port = kzalloc(sizeof(struct ioc4_port), GFP_KERNEL); if (!port) { - printk(KERN_WARNING - "IOC4 serial memory not available for port\n"); + pr_warn("IOC4 serial memory not available for port\n"); goto free; } spin_lock_init(&port->ip_lock); @@ -1867,7 +1864,7 @@ static void handle_intr(void *arg, uint32_t sio_ir) uint32_t shadow; if ( loop_counter-- <= 0 ) { - printk(KERN_WARNING "IOC4 serial: " + pr_warn("IOC4 serial: " "possible hang condition/" "port stuck on interrupt.\n"); break; @@ -2167,7 +2164,7 @@ static inline int do_read(struct uart_port *the_port, unsigned char *buf, entry = (struct ring_entry *)((caddr_t)inring + cons_ptr); if ( loop_counter-- <= 0 ) { - printk(KERN_WARNING "IOC4 serial: " + pr_warn("IOC4 serial: " "possible hang condition/" "port stuck on read.\n"); break; @@ -2793,16 +2790,14 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd) if (!request_mem_region(tmp_addr1, sizeof(struct ioc4_serial), "sioc4_uart")) { - printk(KERN_WARNING - "ioc4 (%p): unable to get request region for " + pr_warn("ioc4 (%p): unable to get request region for " "uart space\n", (void *)idd->idd_pdev); ret = -ENODEV; goto out1; } serial = ioremap(tmp_addr1, sizeof(struct ioc4_serial)); if (!serial) { - printk(KERN_WARNING - "ioc4 (%p) : unable to remap ioc4 serial register\n", + pr_warn("ioc4 (%p) : unable to remap ioc4 serial register\n", (void *)idd->idd_pdev); ret = -ENODEV; goto out2; @@ -2815,7 +2810,7 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd) control = kzalloc(sizeof(struct ioc4_control), GFP_KERNEL); if (!control) { - printk(KERN_WARNING "ioc4_attach_one" + pr_warn("ioc4_attach_one" ": unable to get memory for the IOC4\n"); ret = -ENOMEM; goto out2; @@ -2825,8 +2820,7 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd) /* Allocate the soft structure */ soft = kzalloc(sizeof(struct ioc4_soft), GFP_KERNEL); if (!soft) { - printk(KERN_WARNING - "ioc4 (%p): unable to get memory for the soft struct\n", + pr_warn("ioc4 (%p): unable to get memory for the soft struct\n", (void *)idd->idd_pdev); ret = -ENOMEM; goto out3; @@ -2858,8 +2852,7 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd) "sgi-ioc4serial", soft)) { control->ic_irq = idd->idd_pdev->irq; } else { - printk(KERN_WARNING - "%s : request_irq fails for IRQ 0x%x\n ", + pr_warn("%s : request_irq fails for IRQ 0x%x\n ", __func__, idd->idd_pdev->irq); } ret = ioc4_attach_local(idd); @@ -2914,14 +2907,12 @@ static int __init ioc4_serial_init(void) /* register with serial core */ if ((ret = uart_register_driver(&ioc4_uart_rs232)) < 0) { - printk(KERN_WARNING - "%s: Couldn't register rs232 IOC4 serial driver\n", + pr_warn("%s: Couldn't register rs232 IOC4 serial driver\n", __func__); goto out; } if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) { - printk(KERN_WARNING - "%s: Couldn't register rs422 IOC4 serial driver\n", + pr_warn("%s: Couldn't register rs422 IOC4 serial driver\n", __func__); goto out_uart_rs232; } From patchwork Sat Apr 27 12:52:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7DE2C933 for ; Sat, 27 Apr 2019 12:54:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D0B828691 for ; Sat, 27 Apr 2019 12:54:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A37C286B9; Sat, 27 Apr 2019 12:54:56 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 00B1B28691 for ; Sat, 27 Apr 2019 12:54:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727139AbfD0Myz (ORCPT ); Sat, 27 Apr 2019 08:54:55 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:45157 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbfD0MxZ (ORCPT ); Sat, 27 Apr 2019 08:53:25 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MkYkI-1gvnxz13qI-00m5Hh; Sat, 27 Apr 2019 14:53:01 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 32/41] drivers: tty: serial: 21285: define's for address/size, use mapsize field Date: Sat, 27 Apr 2019 14:52:13 +0200 Message-Id: <1556369542-13247-33-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:iEBl2J6aAGLLUc9gogjDel0fwK0zVBbCxPMJri/kbrSvb4JuRHU dMsu93FBbFwYR3dVsvSh1GJRRBnAct7RY5hnMruBRe4fpX6nxjKZ9a+FpdnPqRrRM6zajm/ Zq6YvL7nAO4JNPTwsDDpcQwnA8FjfR6ICxhwBH3BRm3TCq2eoup3NR3iCqD3FNfZx2YoV/8 V7MKmxrrBIOBo3I5f/tZw== X-UI-Out-Filterresults: notjunk:1;V03:K0:93H1R8MWbBw=:L0iEwc82GdE63pmHfe42UJ uQxcquJ3aJJ6XagNGb5FGjO5+Gqe68JZ8HjPmYBjEOz5cxI4FLV/EJb7ZZ4Y1tXzXf5DmiQSC jGjsnJLejS63nxXDdr7G7i1Zj87ckczGHw41+SX07w+g0h/OAWEt0Qrpak9E3FGVcyCmOJUga hbJqfS4JWsxbQKPw0kI+6ndJ373LfddM/MvpO5ERt4PzWcL0nspeNGet1o9gjCpUiD9nD01IT LngnK8dwnJOnWh/L/7tvgAI9bkBVglAvI4stcaTG+KJ02WFNPNQFlNn3tX8C/qqQ5ZoVtoH0o YCOtR2V+YpRlbPmvzp/NjwosNMtNg2fr2A4+jp8LVxwHEKx6Mq9rQlCZn48cIitdMCx3u2/8Z M7TdoDS9GdEIVYbxytMx9G63q7f34b7N4ovgVOyFqvk3EDR2ExnMQfI79d7+TthEa+OBHcMcP hc4ClgExLQpo/LSINaPEy9n00HY/I4d9QypfPIAHCYEnzCXADrc2t7CkhNepxTht+kgBJy1aS k+FsfSyCi2AqYiHiKoYXXuhlarg3YviDJeu51x/XK4YxQPvIdXBJG5P2i6KsHaq6UluVDG+QC qwQkfxB5GTCJhn4IkC2Um1VQxHSOGPJji3pBLjiV5pKZyGr1odsWyJb3bcwdxoTWDC1A0LmcQ VW3zq4vScC/GbUtZRrJdUVGJaF/4tuvZLntHWr9wcbtii+rDlmL0H4rk+Paj3NeMT503X+vXM zHbXOUjI7IZVWOStZx9mJyCXuG7NHF8tiIcRnA== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of hardcoding raw numbers, add define's for the mmio address/size. Also fill the mapsize field and use it on mem request/release calls, for more consistency and allowing generic helpers to be used later. Signed-off-by: Enrico Weigelt --- drivers/tty/serial/21285.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c index 32b3acf..90684cd 100644 --- a/drivers/tty/serial/21285.c +++ b/drivers/tty/serial/21285.c @@ -27,6 +27,9 @@ #define SERIAL_21285_MAJOR 204 #define SERIAL_21285_MINOR 4 +#define SERIAL_21285_ADDRESS 0x42000160 +#define SERIAL_21285_SIZE 32 + #define RXSTAT_DUMMY_READ 0x80000000 #define RXSTAT_FRAME (1 << 0) #define RXSTAT_PARITY (1 << 1) @@ -305,12 +308,14 @@ static const char *serial21285_type(struct uart_port *port) static void serial21285_release_port(struct uart_port *port) { - release_mem_region(port->mapbase, 32); + release_mem_region(port->mapbase, port->mapsize); } static int serial21285_request_port(struct uart_port *port) { - return request_mem_region(port->mapbase, 32, serial21285_name) + return request_mem_region(port->mapbase, + port->mapsize, + serial21285_name) != NULL ? 0 : -EBUSY; } @@ -354,7 +359,8 @@ static int serial21285_verify_port(struct uart_port *port, struct serial_struct }; static struct uart_port serial21285_port = { - .mapbase = 0x42000160, + .mapbase = SERIAL_21285_BASE, + .mapsize = SERIAL_21285_SIZE, .iotype = UPIO_MEM, .irq = 0, .fifosize = 16, From patchwork Sat Apr 27 12:52:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B700933 for ; Sat, 27 Apr 2019 12:54:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DCE3286B9 for ; Sat, 27 Apr 2019 12:54:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3223C28742; Sat, 27 Apr 2019 12:54:40 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 DAB82286B9 for ; Sat, 27 Apr 2019 12:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727346AbfD0Mxb (ORCPT ); Sat, 27 Apr 2019 08:53:31 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:41939 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727308AbfD0Mx2 (ORCPT ); Sat, 27 Apr 2019 08:53:28 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M2wCi-1hLTog0PAy-003R4p; Sat, 27 Apr 2019 14:53:02 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 33/41] drivers: tty: serial: zs: use dev_err() instead of printk() Date: Sat, 27 Apr 2019 14:52:14 +0200 Message-Id: <1556369542-13247-34-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:QF40RLIzjg39yF+kkJLwWE6eyJO2lDQl6Yzy88yH5771K+U+/wt 1Wjl3D+kIur6TBPIOh4jOyMYXzSox/0XX1Hcf4zFuPQmKc9TKSN1fBoJRYlf+0M/kOR3PC/ l9Y251gM1AKpBxtXImahYkduMkU7yDZeVYsF1N1b7uZfo2UV2TlEEwBb0bCY34hAZbZneXk NbA8aA4/MktrW0coiKTyQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Eh3DZPiCkGY=:tjxD2QwfgapatdwHmJnkdr PSdGT9lcKoxn0vZ7Rp//x/uyFYBtQLUi29IcunkocMEKUs5YJFdHogbVsFAVMVJLZO8ZzntWV O7kttBq5DAGhsobsWXs4e23+7HwMITcEiszncVa9/3sUVc1cH0grthAJlNpQumTFiLTwCEiiy +AFXv1re1PUwC5xEmLzo9ui0isgMgVA1xQUwsRbOaPLMm9NhDZ+d0FJwbTo3KHNsiTsZFuWxL 9JQM7Z22RLBAG9wa3ASrrfM5zKmHkSEOPc2X/N82bli24aD3TTUO9a+J+ojmDWRplKpAIUyZT fXId/zFNr7AEGUcX7VezsKhscHBTO758/ZyMrcgNAMWDnhT/70u6TQvUuOifW8D/Y1Hghh6cB 4QO6ZhurmdxyZ0oOhuThszQgC1ht87ExyjwAYJVydH9z6gq+SRyceTbbE4E3B8S9L8NXdBQ/X zKuAsUqVCpO6cv0AGCVD4beEqaRkWxfry7+cFMzTYdlW9kxaiakkPg3peM6cGo/Y3aOswdDEM yOFjkyXAkmIJS/Cpq3mFMRySCepHNYPls7KvZMbIrJ54ISXVvnt2+YnC5ifFf5IWfXTwyd4en JgZaWxnJ+lu2qoKH06DlO+YuUroKlBo/Cj+M98Q3I29qfcokFkZmGZ4OCqvk9mLjVWnIDVpkp NK+vpcb7NDaHyHNl5rybbr37KyjM3iS4zuldMiVnuspOHZWY+urLdryZZCNfYizdguQmQcDYI VGv8B4cGjKb5Hp8pFpGXlDXptI7yMcxq50+aGQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_err() instead of printk() for more consistent output. (prints device name, etc). Signed-off-by: Enrico Weigelt --- drivers/tty/serial/zs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c index b03d3e4..adbfe79 100644 --- a/drivers/tty/serial/zs.c +++ b/drivers/tty/serial/zs.c @@ -767,7 +767,7 @@ static int zs_startup(struct uart_port *uport) IRQF_SHARED, "scc", scc); if (ret) { atomic_add(-1, &scc->irq_guard); - printk(KERN_ERR "zs: can't get irq %d\n", + dev_err(uport->dev, "zs: can't get irq %d\n", zport->port.irq); return ret; } @@ -995,7 +995,7 @@ static int zs_map_port(struct uart_port *uport) uport->membase = ioremap_nocache(uport->mapbase, ZS_CHAN_IO_SIZE); if (!uport->membase) { - printk(KERN_ERR "zs: Cannot map MMIO\n"); + dev_err(port->dev, "zs: Cannot map MMIO\n"); return -ENOMEM; } return 0; @@ -1006,7 +1006,7 @@ static int zs_request_port(struct uart_port *uport) int ret; if (!request_mem_region(uport->mapbase, ZS_CHAN_IO_SIZE, "scc")) { - printk(KERN_ERR "zs: Unable to reserve MMIO resource\n"); + dev_err(uport->dev, "zs: Unable to reserve MMIO resource\n"); return -EBUSY; } ret = zs_map_port(uport); From patchwork Sat Apr 27 12:52:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 920F014DB for ; Sat, 27 Apr 2019 12:54:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8477B286B9 for ; Sat, 27 Apr 2019 12:54:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78FB6286E0; Sat, 27 Apr 2019 12:54:40 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 288ED286EE for ; Sat, 27 Apr 2019 12:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727338AbfD0Mxb (ORCPT ); Sat, 27 Apr 2019 08:53:31 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:58763 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727324AbfD0Mx3 (ORCPT ); Sat, 27 Apr 2019 08:53:29 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MrQN5-1gyFsf3szn-00oX3M; Sat, 27 Apr 2019 14:53:03 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 34/41] drivers: tty: serial: zs: fill mapsize and use it Date: Sat, 27 Apr 2019 14:52:15 +0200 Message-Id: <1556369542-13247-35-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:zrosD3Ctd1aN0WpNLZFdBQRFBUqXoIn/vK59RCWQKALAv5BYyI4 9kJucz8qp+qIXGcy4ADN10n35GRjp3t1bSz4vEWOCzwTB2XXPf6KteeGAGjUQOXvDMkS0PQ 658vUta/FNmxhHolnomtYwAm2hVQ/rOsExC3aVbcC7iO/2z6qctqb6KpFVlO6xFHXeNXPYX uBsZgE/3Ekcv4Nsi/qZwQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:KnnLQy5706A=:gIgNJYKZQ0XX/Ytqsc0i9l bO959YYz3tQkDcQX9QxnzOyjTiFB/3SnL7a7mJdfscylb4xtGHF8Ca2lF8toEGlTpepvNcD3u q/nsSq3YpagbmFV3RJP2FJ/a2wQNOTqtWrSn+Ufbk9PrY32lTsg4mgCiZO9RqXb+brgG0nr2n Unu5ZCbwOe1acSlJpHBna7JK0aBs8joJUkEL5bpTEBWeI48Dc8g1QcvV0uqUZe+jJPsvzn1Ce Rnsl20iqnyzitjrjZfcx6FuQcgrl90qwOG+9YwdtmHccYrKEwajsy3HckhHj7rku74x5Ywflx BR87rv5gnTMhhBsEQzFH5O3difC0EM84nSVZPBYoUuF89P6kZOPb/xIZQ0LsxmK1gsMErE4dQ gx+9MlNWwLAXqu3sprHSY4/2xEGB8DHEuwAaXAMrUtor6pjz2Re9KLfccujJOlMajeuIRjpvF qo6KNZtJYTmo92CsNrFbLhlfpwe4p9buJtiSD6VKuR7jpSnaSzvsH9ABS+KrwTEXS5bLdcxh+ KA2vMAnfKXFDjsAYCtwLTRxipwutt02+Mg8cBfkEWgv+zNLGcwuo/nJ5L2sFStzZ/an6FlLZE Tzr7OlPZ1IudTpdEBKsseNSAzGMAYrmLd7VO4zG51pJXR1m0v9GkHScPVfPNH/U16MXifWOPE tdmwTQgV8IzEHnsE0FAGdgn+4ZTd5KO4C7SjNOnQIrB9ZALsDjCUkquoAbC+GFHLy+BKJngcs f9jIJFLQ2qoU1mBkm9+zlp5VRMtCHESx7VgPjQ== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fill the struct uart_port->mapsize field and use it, insteaf of hardcoded values in many places. This makes the code layout a bit more consistent and easily allows using generic helpers for the io memory handling. Candidates for such helpers could be eg. the request+ioremap and iounmap+release combinations. Signed-off-by: Enrico Weigelt --- drivers/tty/serial/zs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c index adbfe79..ab432ba 100644 --- a/drivers/tty/serial/zs.c +++ b/drivers/tty/serial/zs.c @@ -986,14 +986,14 @@ static void zs_release_port(struct uart_port *uport) { iounmap(uport->membase); uport->membase = 0; - release_mem_region(uport->mapbase, ZS_CHAN_IO_SIZE); + release_mem_region(uport->mapbase, uport->mapsize); } static int zs_map_port(struct uart_port *uport) { if (!uport->membase) uport->membase = ioremap_nocache(uport->mapbase, - ZS_CHAN_IO_SIZE); + uport->mapsize); if (!uport->membase) { dev_err(port->dev, "zs: Cannot map MMIO\n"); return -ENOMEM; @@ -1005,13 +1005,13 @@ static int zs_request_port(struct uart_port *uport) { int ret; - if (!request_mem_region(uport->mapbase, ZS_CHAN_IO_SIZE, "scc")) { + if (!request_mem_region(uport->mapbase, uport->mapsize, "scc")) { dev_err(uport->dev, "zs: Unable to reserve MMIO resource\n"); return -EBUSY; } ret = zs_map_port(uport); if (ret) { - release_mem_region(uport->mapbase, ZS_CHAN_IO_SIZE); + release_mem_region(uport->mapbase, uport->mapsize); return ret; } return 0; @@ -1113,6 +1113,7 @@ static int __init zs_probe_sccs(void) uport->flags = UPF_BOOT_AUTOCONF; uport->ops = &zs_ops; uport->line = chip * ZS_NUM_CHAN + side; + uport->mapsize = ZS_CHAN_IO_SIZE; uport->mapbase = dec_kn_slot_base + zs_parms.scc[chip] + (side ^ ZS_CHAN_B) * ZS_CHAN_IO_SIZE; From patchwork Sat Apr 27 12:52:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 492B314DB for ; Sat, 27 Apr 2019 12:54:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 386A9212D5 for ; Sat, 27 Apr 2019 12:54:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C3C6286B9; Sat, 27 Apr 2019 12:54:26 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 19AF8212D5 for ; Sat, 27 Apr 2019 12:54:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727363AbfD0MyN (ORCPT ); Sat, 27 Apr 2019 08:54:13 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:46579 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbfD0Mxd (ORCPT ); Sat, 27 Apr 2019 08:53:33 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N79q8-1ghy553AGC-017Rst; Sat, 27 Apr 2019 14:53:03 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 35/41] drivers: tty: serial: 8250: add mapsize to platform data Date: Sat, 27 Apr 2019 14:52:16 +0200 Message-Id: <1556369542-13247-36-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:JcK0nmXUqvVZov6FpygbFCYx2SBIMbt8YBo1Pyu7lLXpjQoFRY+ pUU91A2VFsC0opVj58fPkR0Q6FJXQi2dkc/wvSXJs1UuyFbz9fA4rXDWaSqNdJmI+Ni3NVN GCHT5mxv7iA219z7s0oyXnMLdcGAYrX/sQa9g9+0osWcxqkU8TBbfxVPdIH8z0lkkec4VUA Jy3EMpSULncwPlRSUSCNg== X-UI-Out-Filterresults: notjunk:1;V03:K0:HKE131FklXQ=:N+5TupvitkXMK24q5/jyxA sIX3ic5BD+uHPAGs20GJwkwPl9UDpk0TIanYdXumBoGIe0pn8xQHfMNAGWo6dzwFRYczrf7xW TxJABWtuVu+JiQ10VmrYJ6qbGD6m4TbE/uBc0upnH9JxQ1cVsfzzBmwiGXmmAaK657CfdpoPS Fz7U84teAYYbICi2O4GD/aLJ8uzK2AiOYExJtogutwoUfYQhEeqnt1MAK5B8+inbvVsZudb+l JJHjzlpoU/Oc+93FvVVMaymuIzy9f5R5gZGyofQ18Ch3DkihSAI67zUaYRbcl98qsSoKBF0qU 0Bi3tP98ckrPEa8aT6/eEbWNDmQIaMq18HS/MVAYgP0Spig/t1UW2ix047NzAc3r2ovU57cD/ m3113f332KKSzj3AKd4QtXe9A+c95IFcsbX/8ZcEtEUh4OjJicZ9FooqDctilf0RHzaAa2R0C rBL1UlQkiaGPBiXr/zXerWVeQj+YNsmUc6K/CvV8fuooCj8sZm9wrLZ8jVV/8DBx0EmiKK0FQ FMksN9EPcLIzrmxsrW7WAaj8ObKHty46EJiN+qpvZ7NIRTVKtyKeC7eYev77pxyv6ynBQwIto XvolrpgZ5uald3Dm9wAVwKn9K+v7AhEHQZv/NkEVcxJbA6C5VQ4xHu1nfwLeN8MtF/mnGnkCL 7eovd4m1Pa0fyY2AFdvo5Xvee3L7sL7797X+E77dYhJ60wioVIWdRHlMcJMcL86pG4RtHQe3Y 1TtyyEi0bqAfCKemGdUTrRo5E1LDoLRshCvoXw== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adding a mapsize field for the 8250 port platform data struct, so we can now set the resource size (eg. *1) and don't need funny runtime detections like serial8250_port_size() anymore. For now, serial8250_port_size() is called everytime we need the io resource size. That function checks which chip we actually have and returns the appropriate size. This approach is a bit clumpsy and not entirely easy to understand, and it's a violation of layers :p Obviously, that information cannot change after the driver init, so we can safely do that probing once on driver init and just use the stored value later. *1) arch/mips/alchemy/common/platform.c Signed-off-by: Enrico Weigelt --- drivers/tty/serial/8250/8250_core.c | 1 + include/linux/serial_8250.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index e441221..71a398b 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -814,6 +814,7 @@ static int serial8250_probe(struct platform_device *dev) uart.port.iotype = p->iotype; uart.port.flags = p->flags; uart.port.mapbase = p->mapbase; + uart.port.mapsize = p->mapsize; uart.port.hub6 = p->hub6; uart.port.private_data = p->private_data; uart.port.type = p->type; diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 5a655ba..8b8183a 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -22,6 +22,7 @@ struct plat_serial8250_port { unsigned long iobase; /* io base address */ void __iomem *membase; /* ioremap cookie or NULL */ resource_size_t mapbase; /* resource base */ + resource_size_t mapsize; /* resource size */ unsigned int irq; /* interrupt number */ unsigned long irqflags; /* request_irq flags */ unsigned int uartclk; /* UART clock rate */ From patchwork Sat Apr 27 12:52:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F386B14D5 for ; Sat, 27 Apr 2019 12:54:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4473212D5 for ; Sat, 27 Apr 2019 12:54:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7F22286EE; Sat, 27 Apr 2019 12:54:24 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 61AF2212D5 for ; Sat, 27 Apr 2019 12:54:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727506AbfD0MyO (ORCPT ); Sat, 27 Apr 2019 08:54:14 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:36535 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727357AbfD0Mxd (ORCPT ); Sat, 27 Apr 2019 08:53:33 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MS3r9-1hEZPX2dSN-00TRpw; Sat, 27 Apr 2019 14:53:04 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 36/41] drivers: tty: serial: 8250: store mmio resource size in port struct Date: Sat, 27 Apr 2019 14:52:17 +0200 Message-Id: <1556369542-13247-37-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:5xh4xCURPmXUvaYJVhWOOLAQMBFKolTB1CtYzDRsCmMQTGj9Kze 7Fbh3rf2q+OnFvF6rluf5naHkTWp2AKMpX/8qWmYyA8oK2d2GVmdCXs4872KOgx/atiTp7G d+ALZSGvhXvKgBZpXx6a8p8ION7NAMwQ3bOjpLN0lyMQnletfe+ZuAytTgD3Wq6yfeTr+s+ ZII786NCtXHLUZuyeofOw== X-UI-Out-Filterresults: notjunk:1;V03:K0:GZhL/NKGMsU=:pnMO/pRCh4WLDmq1DpqqkI p740YhoZo3KQxvlsgHWL9Sn+LIr06u69K2ghV8d9qHNzoyiPomaqNU5cnYgdozqeDh29Rsgjv ffKYhEy8LP/dM3+eJZyPqJby5XBIeyw+t/Yz/Gqu5DJyCCZ0qGn+obhaZrEAC1hn0dehex8LH Y29Pludjbv/FLBcUH2QZ5aierVn9/bY69FTIeRIdUACuTWi6mi7zK5YHunkvSlaQzgvdXxNyL dCjmGgw2Amr8S6h7ta+8i/sCpp8B7+3p+92RuIDy5BKINKaXuN3bN9MOGLjDGFwRqgRlti/Dj LliFdWVz1UBHO2VJwClV0KGGWcYUjvjijY7zPH0IEBJB+EhJwtyrQ/KudHTCa33UAXq0+TUAT EpoR7jQNlBnEiT/SFmsOgpGN8b7lsalx7rdGaNRvV+zYtMll9I9Ms1lsgy3xcw4VKqy4dxZuO x+9uYESni8vxxkNVHa0vkDraGm51hKm5cxfVSh9b7Wrq8UfujbcasWoSCOB6Du0TKnFF9opiu cjKF9J4+ZiXNe+dqu7B06scO0AubXzFYOUxDQSf7E44puHzDnYbEZJL1hnVUo1+0uhLdYXcfC fPqwL7DvijxNj/uuYVU5ONNp5roM2diftSzOsvSbGpAzFmDa2YYt9ALX/fURAdlGRPFYSyGIs gMntrnhErYZl3d/3yiz61Pbsjf9nvg9eaN8p31MgENeQofS70cF9FMmSpx7UxWsdjShkic4oX n1nhOD1d3Z+rEp/YJb0U6rAZJ+vN4ZqBpXkcfw== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The io resource size is currently recomputed when it's needed but this actually needs to be done once (or drivers could specify fixed values) Simplify that by doing this computation only once and storing the result into the mapsize field. serial8250_register_8250_port() is now called only once on driver init, the previous call sites now just fetch the value from the mapsize field. Signed-off-by: Enrico Weigelt --- drivers/tty/serial/8250/8250.h | 2 ++ drivers/tty/serial/8250/8250_core.c | 3 +++ drivers/tty/serial/8250/8250_port.c | 33 +++++++++++++++------------------ 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index ebfb0bd..89e3f09 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -255,3 +255,5 @@ static inline int serial_index(struct uart_port *port) { return port->minor - 64; } + +unsigned int serial8250_port_size(struct uart_8250_port *pt); diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 71a398b..a9d4ba1 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -979,6 +979,9 @@ int serial8250_register_8250_port(struct uart_8250_port *up) if (up->port.uartclk == 0) return -EINVAL; + /* compute the mapsize in case the driver didn't specify one */ + up->mapsize = serial8250_port_size(up); + mutex_lock(&serial_mutex); uart = serial8250_find_match_or_unused(&up->port); diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index d2f3310..d09af4c 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2829,7 +2829,7 @@ void serial8250_do_pm(struct uart_port *port, unsigned int state, serial8250_do_pm(port, state, oldstate); } -static unsigned int serial8250_port_size(struct uart_8250_port *pt) +unsigned int serial8250_port_size(struct uart_8250_port *pt) { if (pt->port.mapsize) return pt->port.mapsize; @@ -2849,9 +2849,7 @@ static unsigned int serial8250_port_size(struct uart_8250_port *pt) */ static int serial8250_request_std_resource(struct uart_8250_port *up) { - unsigned int size = serial8250_port_size(up); struct uart_port *port = &up->port; - int ret = 0; switch (port->iotype) { case UPIO_AU: @@ -2863,32 +2861,31 @@ static int serial8250_request_std_resource(struct uart_8250_port *up) if (!port->mapbase) break; - if (!request_mem_region(port->mapbase, size, "serial")) { - ret = -EBUSY; - break; - } + if (!request_mem_region(port->mapbase, + port->mapsize, "serial")) + return -EBUSY; if (port->flags & UPF_IOREMAP) { - port->membase = ioremap_nocache(port->mapbase, size); - if (!port->membase) { - release_mem_region(port->mapbase, size); - ret = -ENOMEM; - } + port->membase = ioremap_nocache(port->mapbase, + port->mapsize); + if (!port->membase) + release_mem_region(port->mapbase, + port->mapsize); + return -ENOMEM; } break; case UPIO_HUB6: case UPIO_PORT: - if (!request_region(port->iobase, size, "serial")) - ret = -EBUSY; + if (!request_region(port->iobase, port->mapsize, "serial")) + return -EBUSY; break; } - return ret; + return 0; } static void serial8250_release_std_resource(struct uart_8250_port *up) { - unsigned int size = serial8250_port_size(up); struct uart_port *port = &up->port; switch (port->iotype) { @@ -2906,12 +2903,12 @@ static void serial8250_release_std_resource(struct uart_8250_port *up) port->membase = NULL; } - release_mem_region(port->mapbase, size); + release_mem_region(port->mapbase, port->mapsize); break; case UPIO_HUB6: case UPIO_PORT: - release_region(port->iobase, size); + release_region(port->iobase, port->mapsize); break; } } From patchwork Sat Apr 27 12:52:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAC7314DB for ; Sat, 27 Apr 2019 12:53:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC62C202DB for ; Sat, 27 Apr 2019 12:53:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C07C6212D5; Sat, 27 Apr 2019 12:53:52 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 AB7CB286EE for ; Sat, 27 Apr 2019 12:53:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727412AbfD0Mxg (ORCPT ); Sat, 27 Apr 2019 08:53:36 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:56653 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727385AbfD0Mxg (ORCPT ); Sat, 27 Apr 2019 08:53:36 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MBltM-1hUJVl230m-00CCVD; Sat, 27 Apr 2019 14:53:05 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 37/41] drivers: tty: serial: 8250: simplify io resource size computation Date: Sat, 27 Apr 2019 14:52:18 +0200 Message-Id: <1556369542-13247-38-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:ZXB7mz06Ly6MRfvhguoHM1IMTFUXYkIayQ68G7Km7tO2KigZSMd WUDQTyk7nJWuJWfpUC2J3DXsXOHpTBXAQKmw4PEK4HGNm8oGTafIAx2Xk8Zj7ZVo8wGvu2C WGMoTc/hfdwrsTKqgRSAMJYHomV0Lqh7b2/oYaNbGzZfASAsdwQhPLui2wYuEQ8VqWoKKUa A6yCc5QHRSyk0dMUcyEUw== X-UI-Out-Filterresults: notjunk:1;V03:K0:93wra+Qsj5Y=:XHwmY3IHMhOTtTwYleFaYp PCXSvCkNG306ssxvH2mmJYSPBHuXbTCJnleHmnh9t9Be+YdN0wLScPfILH4TKc90KfNN8Pxib UrKW6/PxCpLn/Koj4G/g1lu6rJvrRaAw7qAJokpPoKm7tlOoEYEbry5kL7NN9DF8UEmOW6V1R NfGRJ+lr4UX9x5IZAdAWGleM5Uj71lJWViQNgheekR8JDIdAUsTjLCAFS3uORFtDHMEELA5th aIBXftbPsKFzzQwqtp6hKM9Xb+5YtjfYEH+Zcvd/evd24tVRKwoCXUpE6XIXjgWlSg8vRqP5i +FSM27/iGFEOLhfrShGN8Sy9NxN/kONh9wFaa1yjGjTdb6l9VRsBP0TyRCF4/442yovIW/wYl /ctIs4g7N2mOowGIllfQjlzB6Lo319VBhyz7wRm1D7F+/SoLc5fDUClXplUe0JrQcwNsF6pMp mku/zHhL6iDvJtIn1LZ8HdIXWbn0uD4xY8kuBTQhenLreJezjR0STxZ3x1MCjMrYIDyuhL+qe Z5+kqWq4G3SSFzy9KUuq21LUmqFvPKDnZfxekvgX18cU5HyvmnMFbzmG/YLO4bXRj873Hz0ee 7EKcIgxKKL8Hex71R96Nvh25ouN3UuDsS5ISPRwUzfK+FEvkJYmFSnG9zoV90STqGCnyfMdSJ +V+gWcjaqsBs30A/7RLXLbikyKWf01R/0aJ1X6QSSQa+03P0MI4nl4mFPHjcUGTfWZyezKlJ2 JXAC4DHk4/cwvJNWcmd8RV2n2dC+RgUhIxkunA== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simpily io resource size computation by setting mapsize field. Some of the special cases handled by serial8250_port_size() can be simplified by putting this data to corresponding platform data or probe function. Signed-off-by: Enrico Weigelt --- arch/mips/alchemy/common/platform.c | 1 + drivers/tty/serial/8250/8250.h | 1 + drivers/tty/serial/8250/8250_of.c | 1 + drivers/tty/serial/8250/8250_port.c | 6 +----- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index 1454d9f..226096d 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c @@ -51,6 +51,7 @@ static void alchemy_8250_pm(struct uart_port *port, unsigned int state, #define PORT(_base, _irq) \ { \ .mapbase = _base, \ + .mapsize = 0x1000, \ .irq = _irq, \ .regshift = 2, \ .iotype = UPIO_AU, \ diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index 89e3f09..7984aad 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -105,6 +105,7 @@ struct serial8250_config { #define SERIAL8250_PORT(_base, _irq) SERIAL8250_PORT_FLAGS(_base, _irq, 0) +#define SERIAL_RT2880_IOSIZE 0x100 static inline int serial_in(struct uart_8250_port *up, int offset) { diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 0277479c..08157a1 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -185,6 +185,7 @@ static int of_platform_serial_setup(struct platform_device *ofdev, case PORT_RT2880: port->iotype = UPIO_AU; + port->mapsize = SERIAL_RT2880_IOSIZE; break; } diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index d09af4c..51d6076 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2833,11 +2833,7 @@ unsigned int serial8250_port_size(struct uart_8250_port *pt) { if (pt->port.mapsize) return pt->port.mapsize; - if (pt->port.iotype == UPIO_AU) { - if (pt->port.type == PORT_RT2880) - return 0x100; - return 0x1000; - } + if (is_omap1_8250(pt)) return 0x16 << pt->port.regshift; From patchwork Sat Apr 27 12:52:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09F951390 for ; Sat, 27 Apr 2019 12:54:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEE15202DB for ; Sat, 27 Apr 2019 12:54:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E34B7286B9; Sat, 27 Apr 2019 12:54:12 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 8C28D202DB for ; Sat, 27 Apr 2019 12:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727366AbfD0MyG (ORCPT ); Sat, 27 Apr 2019 08:54:06 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:36297 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727363AbfD0Mxe (ORCPT ); Sat, 27 Apr 2019 08:53:34 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N1fei-1gegIM1SdE-011xhz; Sat, 27 Apr 2019 14:53:06 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 38/41] drivers: tty: serial: xilinx_uartps: fill mapsize and use it Date: Sat, 27 Apr 2019 14:52:19 +0200 Message-Id: <1556369542-13247-39-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:VtPNlXzPCRVCI3k6aUN/2RTDRVtNySvUetW2m1i45Od16fYdx6y LS0k0V6K9tTbj9vRmp5ZCjL/mOHH5UpOiIqa//lNidg8lexGQDtGIijbeiQYs9a5ONTZ41P /QJB/7RWi0uO5xDMBNsrF+ru49A7jV2roH/XamiBQrb9q1XduKueamQiuyXwbKmDF6vMy65 SexEhyAOG2uVr2I4z3nnw== X-UI-Out-Filterresults: notjunk:1;V03:K0:vdDn587xvd4=:4RpbDZcbrZSWSyIEGlsv8U 0K/I8sTnMUV5V0+BjvOPaxxEwIozbULnFUa3IkYA47OU1n2ZzOGt7QzRwMPMuqMALSKhvyuAl t6yxt1msPA6kyUDppcf5bgSpylyoQ+W3C3CEite19ArJ0t2AwR6wilppKV3Jh+KUD0mfjD37s puKb7aoMCoZdZ9cOEaWpB8YfmHh2SeNm3SKcsAkE7vcrHhkRch80ahpP21xLnNLrzWFwCiTuU WSN3vp3JWGFtDHw/p2jQySYFGI9Vvh91eVlMxXKQnLF8yiehURKGk5Y9GEuaj9RXP5HmHyXjL lkZ4wlyKfUEpxD3Tl6j6hawA4nl7XcPNysl3Seys3+VcrP/aydSp4ueltBl6mcp8g5r8Iu5uk FkL08ODMZnsQE8pOye6cuMetb4LkUBCKcprXMYP3ryPqZt7eZBS2lqFiNuPM8xsH9a6WEgJYl I8UzUK30NOx46sp+1PsMg6yTempKzXES5ap5lEgIV0nJrAM21L0mN5/+t0oEjzTtfatOFX5uk M8KVoYNe+W+PKDYsTRSESAgizrPxXk4EkwtRVnV0jmEmUaN3alDd8SqnV0Gu3ROymNZhrZzjz UqyzBRlfWbCGoVNw2LXOb1DGrDLQx+dvJriCIMgZ17xzGKlGAboXpbywthlWS4UNNov0IADCk lffkQK22QhbX1XOmZDBYc2dE7NUMWkmiM2KbFwEs43p6iiUf7jDM/pMtGNBfUfwU5YV9haj7W AFEnEYlgHisqoTzmsKB1b9VQMJVErA9QCIapeg== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fill the struct uart_port->mapsize field and use it, insteaf of hardcoded values in many places. This makes the code layout a bit more consistent and easily allows using generic helpers for the io memory handling. Candidates for such helpers could be eg. the request+ioremap and iounmap+release combinations. Signed-off-by: Enrico Weigelt --- drivers/tty/serial/xilinx_uartps.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 74089f5..cf8ca66 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -953,15 +953,15 @@ static int cdns_uart_verify_port(struct uart_port *port, */ static int cdns_uart_request_port(struct uart_port *port) { - if (!request_mem_region(port->mapbase, CDNS_UART_REGISTER_SPACE, + if (!request_mem_region(port->mapbase, port->mapsize, CDNS_UART_NAME)) { return -ENOMEM; } - port->membase = ioremap(port->mapbase, CDNS_UART_REGISTER_SPACE); + port->membase = ioremap(port->mapbase, port->mapsize); if (!port->membase) { dev_err(port->dev, "Unable to map registers\n"); - release_mem_region(port->mapbase, CDNS_UART_REGISTER_SPACE); + release_mem_region(port->mapbase, port->mapsize); return -ENOMEM; } return 0; @@ -976,7 +976,7 @@ static int cdns_uart_request_port(struct uart_port *port) */ static void cdns_uart_release_port(struct uart_port *port) { - release_mem_region(port->mapbase, CDNS_UART_REGISTER_SPACE); + release_mem_region(port->mapbase, port->mapsize); iounmap(port->membase); port->membase = NULL; } @@ -1627,6 +1627,7 @@ static int cdns_uart_probe(struct platform_device *pdev) * and triggers invocation of the config_port() entry point. */ port->mapbase = res->start; + port->mapsize = CDNS_UART_REGISTER_SPACE; port->irq = irq; port->dev = &pdev->dev; port->uartclk = clk_get_rate(cdns_uart_data->uartclk); From patchwork Sat Apr 27 12:52:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F39014D5 for ; Sat, 27 Apr 2019 12:54:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0036F286B2 for ; Sat, 27 Apr 2019 12:54:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E63D7286B9; Sat, 27 Apr 2019 12:54:06 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 90B7E212D5 for ; Sat, 27 Apr 2019 12:54:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726349AbfD0MyB (ORCPT ); Sat, 27 Apr 2019 08:54:01 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:52685 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbfD0Mxe (ORCPT ); Sat, 27 Apr 2019 08:53:34 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N0G5n-1gXkoO0kCt-00xITk; Sat, 27 Apr 2019 14:53:07 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 39/41] drivers: tty: serial: pmac_zilog: fill mapsize and use it Date: Sat, 27 Apr 2019 14:52:20 +0200 Message-Id: <1556369542-13247-40-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:cAQG+0D3UvfMqv8b+CkNtVcswZtDqF2lX087MK9isXMtCtEuT0Z +LMvw9S8Tc3gAW5AwMqdBeMVX80UXPgUiQX3GDAwydtKI18PtYqNh2qK8dQfa4yBEZlrd1g VFeIauCytrNe9vDPPGAAhgPqYDFdooytbUCh1T2kC3df+mNQEgvvapvejEhIxI7xt++ViLv FxMypxg9TvTXo+483DuLg== X-UI-Out-Filterresults: notjunk:1;V03:K0:JbWJYl/z86Y=:AfUHXZyI0rYrTcXrDfF6qI MsyI9ktNaqoSao04HUcu062H3AOny0fTjnjWXA4c4onYTcO/5YLu10OCXHb+J1m+g7hObnhRG vs217EAPsMyd2cL9U16idxvqv6uEZhwiWKRc8xjoS1VopitogudmOcw65b78tGcQw7gYyWfwu fX5DzFve0pRc0ZABVzrzmtBNgMB0ZAYvx/bGUxlsMZcQfXAswkv0MLKUtjDdssmXFHfPJc8a1 jUZ9gAcBppZWcNAh0pYeOZiFih2Ay5KEwtpMNRKs/FQhNJs9GQug75OpzNt1A0zP5pP/fCeeZ EgxiCJvmRtBEE5+YbW7mPe/vZE8JPX/OMJLy0H2dX/BU8ns9ksGXUfJKrjBojS2H+N0TvNxD8 j4VOfUEuWnxcdYiVNPpSvgW2QW/kMAQTxaL/476BeIPYaCDPnor4iJXPadns1/FI4tOxuoXT7 1HHoO9vDgLa2wum+e1Q5XzmgoL8LgaFiycERH7Vzj99V/AhXSPH8ekdU97upV/7AWYCP5A0s6 EBsMyIXgcS+mr5u5R/ywj1LKJhEOsu0eqGvDRvmXhKb99V7HgQv/m6JORXrB1LhNM9ntkwS74 rNqOAeaPVhYsUACPCG9hY4slXpfQwnv4hYc7X5zml1WIGtXaI4pg8Z/bkyyZ8UVzy/EeQvxEP Mw2bqg3M8i7FRPOJ2mkqIDALRn2r7NYhG2CoCrKsNJA/wIZktd7vR8qgXT/4FPtJu76uzg6QN phzqLuS3ZluJDPbcJL8gpTdmNCKe6Z/Zi0wWgw== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fill the struct uart_port->mapsize field and use it, insteaf of hardcoded values in many places. This makes the code layout a bit more consistent and easily allows using generic helpers for the io memory handling. Candidates for such helpers could be eg. the request+ioremap and iounmap+release combinations. Signed-off-by: Enrico Weigelt --- drivers/tty/serial/pmac_zilog.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index bcb5bf7..1fef014 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c @@ -88,6 +88,8 @@ #define PMACZILOG_NAME "ttyPZ" #endif +#define PMZ_MAPSIZE 0x1000 + #define pmz_debug(fmt, arg...) pr_debug("ttyPZ%d: " fmt, uap->port.line, ## arg) #define pmz_error(fmt, arg...) pr_err("ttyPZ%d: " fmt, uap->port.line, ## arg) #define pmz_info(fmt, arg...) pr_info("ttyPZ%d: " fmt, uap->port.line, ## arg) @@ -1411,7 +1413,8 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) if (of_address_to_resource(np, 0, &r_ports)) return -ENODEV; uap->port.mapbase = r_ports.start; - uap->port.membase = ioremap(uap->port.mapbase, 0x1000); + uap->port.mapsize = PMZ_MAPSIZE; + uap->port.membase = ioremap(uap->port.mapbase, uap->port.mapsize); uap->control_reg = uap->port.membase; uap->data_reg = uap->control_reg + 0x10; @@ -1709,6 +1712,7 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) return -ENODEV; uap->port.mapbase = r_ports->start; + uap->port.mapsize = PMZ_MAPSIZE; uap->port.membase = (unsigned char __iomem *) r_ports->start; uap->port.iotype = UPIO_MEM; uap->port.irq = irq; From patchwork Sat Apr 27 12:52:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20CEF14D5 for ; Sat, 27 Apr 2019 12:53:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12C35202DB for ; Sat, 27 Apr 2019 12:53:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06C53212D5; Sat, 27 Apr 2019 12:53:51 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 1A24E286B9 for ; Sat, 27 Apr 2019 12:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727431AbfD0Mxk (ORCPT ); Sat, 27 Apr 2019 08:53:40 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:41279 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727383AbfD0Mxk (ORCPT ); Sat, 27 Apr 2019 08:53:40 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mwwhv-1gb3fT0nff-00yOwS; Sat, 27 Apr 2019 14:53:08 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 40/41] drivers: tty: serial: helper for setting mmio range Date: Sat, 27 Apr 2019 14:52:21 +0200 Message-Id: <1556369542-13247-41-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:vc6wGTaQT5uupsAbTreZS+sSZdK+XaJlhvT04A4iLubNRzD5IPf YPAFQc5vGV+Pk+jx4AQ39iE2rlAHtPW/QsqfgV74Nxmys/AYDobtR0hEBlUQHBmvYoLL0xR XQxKhJsbfgTox/my2891L8/IyJQwk8mMDnx+dEs89rrf/NOEyfUPIMcBkPiwhE0bwqAARyQ PkO/tEXnAuNfYoxPG2X+g== X-UI-Out-Filterresults: notjunk:1;V03:K0:0fn3jPl5GLI=:8ufW2QbxtS+gVFB+NQW1u1 8JHjeYbllrWa5uU4cxUCotmvjIkNGdis89u+uPSuyFgBGmyJBwFdo5yHePu3iPdLG2B1BFOJO foXQ4x0fmbpCh25EffQqOEXIYG7vY3k358LIG2TLIQxadpd4bq2sIwZy7FqVpgQc+u/GEXTd3 Wn/zipp8OdR0jcjLWHyJlof/nIf5+6Z3EhkCE2xQD7oI0Japl61roo6dtokJD59AAdclz2VGl k9X+Ihlopl17s9Br+Bt1SNrS55FFDMpC6YyGOrsrLeIE20ZhIi2NAOG6m9Lj3V/cMZgL4iOuy d88rL7VIy4KysIP0yyoyCRcRxAdyP1OILLtqVCv6ertt6H9/tOvw63iiH3lt+nZ2ioY48WCEZ LCzxc82PTqydfWAXzVyscNyW2Tan2TzmeaC24czKtOkY9uxcT4GFjW0Dd9zUTr55I5z5r/o3+ fqwId2nx+Biz1Eh4HbBPQKK5rIr7Hvxp2wFhFYKr38/yYgSn+HK3a+rX36YJjwgZYS4xZuRPb KeYISc7a/rvtbgvsGsZnc3NQqQN8CbJdf6lRHljqczP2S7HJNYkr5lF+U/qC728wf318smVGo /YvoOMsH57w8LufDHEDU7PtF4FDzpum3jlVa9LpQMuq5pmKWYSl7yYL/rrF461IjDVFgbBIl9 O6zfXAVhU+2Bqicr2w4+ZN8lWh/Yf5Qf++rqvs/lzinWz4LQiHaDmy7DIs3xXa18IgAyexQxr X7p9yVRCoZOh5E1CW23U5VUql4QErQjhEQIXAA== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce a little helpers for settings the mmio range from an struct resource or start/len parameters with less code. (also setting iotype to UPIO_MEM) Also converting drivers to use these new helpers as well as fetching mapsize field instead of using hardcoded values. (the runtime overhead of that should be negligible) The idea is moving to a consistent scheme, so later common calls like request+ioremap combination can be done by generic helpers. Signed-off-by: Enrico Weigelt --- drivers/tty/serial/8250/8250_acorn.c | 5 ++-- drivers/tty/serial/8250/8250_aspeed_vuart.c | 4 +-- drivers/tty/serial/8250/8250_dw.c | 3 +-- drivers/tty/serial/8250/8250_em.c | 2 +- drivers/tty/serial/8250/8250_exar.c | 6 +++-- drivers/tty/serial/8250/8250_hp300.c | 11 +++++--- drivers/tty/serial/8250/8250_of.c | 9 ++----- drivers/tty/serial/meson_uart.c | 5 ++-- drivers/tty/serial/mps2-uart.c | 5 ++-- drivers/tty/serial/pmac_zilog.c | 8 ++---- drivers/tty/serial/vt8500_serial.c | 4 +-- drivers/tty/serial/xilinx_uartps.c | 3 +-- drivers/tty/serial/zs.c | 10 +++++--- include/linux/serial_core.h | 40 +++++++++++++++++++++++++++++ 14 files changed, 76 insertions(+), 39 deletions(-) diff --git a/drivers/tty/serial/8250/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c index 758c4aa..359171b 100644 --- a/drivers/tty/serial/8250/8250_acorn.c +++ b/drivers/tty/serial/8250/8250_acorn.c @@ -63,14 +63,15 @@ struct serial_card_info { uart.port.irq = ec->irq; uart.port.flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ; uart.port.uartclk = type->uartclk; - uart.port.iotype = UPIO_MEM; uart.port.regshift = 2; uart.port.dev = &ec->dev; for (i = 0; i < info->num_ports; i++) { uart.port.membase = info->vaddr + type->offset[i]; - uart.port.mapbase = bus_addr + type->offset[i]; + /* mapsize is computed by serial8250_register_8250_port() */ + uart_memres_set_start_len(&uart.port, + bus_addr + type->offset[i], 0); info->ports[i] = serial8250_register_8250_port(&uart); } diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c index 0438d9a..0e06391 100644 --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c @@ -328,8 +328,6 @@ static int aspeed_vuart_probe(struct platform_device *pdev) memset(&port, 0, sizeof(port)); port.port.private_data = vuart; port.port.membase = vuart->regs; - port.port.mapbase = res->start; - port.port.mapsize = resource_size(res); port.port.startup = aspeed_vuart_startup; port.port.shutdown = aspeed_vuart_shutdown; port.port.throttle = aspeed_vuart_throttle; @@ -337,6 +335,8 @@ static int aspeed_vuart_probe(struct platform_device *pdev) port.port.status = UPSTAT_SYNC_FIFO; port.port.dev = &pdev->dev; + uart_memres_set_res(&port.port, res); + rc = sysfs_create_group(&vuart->dev->kobj, &aspeed_vuart_attr_group); if (rc < 0) return rc; diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index d31b975..cb65256 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -513,18 +513,17 @@ static int dw8250_probe(struct platform_device *pdev) } spin_lock_init(&p->lock); - p->mapbase = regs->start; p->irq = irq; p->handle_irq = dw8250_handle_irq; p->pm = dw8250_do_pm; p->type = PORT_8250; p->flags = UPF_SHARE_IRQ | UPF_FIXED_PORT; p->dev = dev; - p->iotype = UPIO_MEM; p->serial_in = dw8250_serial_in; p->serial_out = dw8250_serial_out; p->set_ldisc = dw8250_set_ldisc; p->set_termios = dw8250_set_termios; + uart_memres_set_res(p, regs); p->membase = devm_ioremap(dev, regs->start, resource_size(regs)); if (!p->membase) diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c index 2a76e22..7610441 100644 --- a/drivers/tty/serial/8250/8250_em.c +++ b/drivers/tty/serial/8250/8250_em.c @@ -100,12 +100,12 @@ static int serial8250_em_probe(struct platform_device *pdev) } memset(&up, 0, sizeof(up)); - up.port.mapbase = regs->start; up.port.irq = irq->start; up.port.type = PORT_UNKNOWN; up.port.flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_IOREMAP; up.port.dev = &pdev->dev; up.port.private_data = priv; + uart_memres_set_res(&up.port, res); clk_prepare_enable(priv->sclk); up.port.uartclk = clk_get_rate(priv->sclk); diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 0089aa3..f4c1289 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -134,8 +134,10 @@ static int default_setup(struct exar8250 *priv, struct pci_dev *pcidev, const struct exar8250_board *board = priv->board; unsigned int bar = 0; - port->port.iotype = UPIO_MEM; - port->port.mapbase = pci_resource_start(pcidev, bar) + offset; + uart_memres_set_start_len(&port->port, + pci_resource_start(pcidev, bar) + offset, + pci_resource_len(pcidev, bar)); + port->port.membase = priv->virt + offset; port->port.regshift = board->reg_shift; diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c index 3012ea0..09f9dd3 100644 --- a/drivers/tty/serial/8250/8250_hp300.c +++ b/drivers/tty/serial/8250/8250_hp300.c @@ -114,7 +114,9 @@ int __init hp300_setup_serial_console(void) pr_info("Serial console is HP APCI 1\n"); port.uartclk = HPAPCI_BAUD_BASE * 16; - port.mapbase = (FRODO_BASE + FRODO_APCI_OFFSET(1)); + uart_memres_set_start_len( + &port, + FRODO_BASE + FRODO_APCI_OFFSET(1), 0); port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE); port.regshift = 2; add_preferred_console("ttyS", port.line, "9600n8"); @@ -131,7 +133,8 @@ int __init hp300_setup_serial_console(void) pr_info("Serial console is HP DCA at select code %d\n", scode); port.uartclk = HPDCA_BAUD_BASE * 16; - port.mapbase = (pa + UART_OFFSET); + + uart_memres_set_start_len(&port, (pa + UART_OFFSET)); port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE); port.regshift = 1; port.irq = DIO_IPL(pa + DIO_VIRADDRBASE); @@ -173,7 +176,9 @@ static int hpdca_init_one(struct dio_dev *d, uart.port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; uart.port.irq = d->ipl; uart.port.uartclk = HPDCA_BAUD_BASE * 16; - uart.port.mapbase = (d->resource.start + UART_OFFSET); + uart_memres_set_start_len(&uart.port, + (d->resource.start + UART_OFFSET), + resource_size(&d->resource)); uart.port.membase = (char *)(uart.port.mapbase + DIO_VIRADDRBASE); uart.port.regshift = 1; uart.port.dev = &d->dev; diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 08157a1..1c5896c 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -96,18 +96,13 @@ static int of_platform_serial_setup(struct platform_device *ofdev, UPF_FIXED_TYPE; spin_lock_init(&port->lock); - if (resource_type(&resource) == IORESOURCE_IO) { - port->iotype = UPIO_PORT; - port->iobase = resource.start; - } else { - port->mapbase = resource.start; - port->mapsize = resource_size(&resource); + uart_memres_set_res(port, &resource); + if (resource_type(&resource) == IORESOURCE_MEM) { /* Check for shifted address mapping */ if (of_property_read_u32(np, "reg-offset", &prop) == 0) port->mapbase += prop; - port->iotype = UPIO_MEM; if (of_property_read_u32(np, "reg-io-width", &prop) == 0) { switch (prop) { case 1: diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index fbc5bc0..bfcaa2f 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -698,9 +698,8 @@ static int meson_uart_probe(struct platform_device *pdev) if (ret) return ret; - port->iotype = UPIO_MEM; - port->mapbase = res_mem->start; - port->mapsize = resource_size(res_mem); + uart_memset_set_res(port, res_mem); + port->irq = res_irq->start; port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY; port->dev = &pdev->dev; diff --git a/drivers/tty/serial/mps2-uart.c b/drivers/tty/serial/mps2-uart.c index 587b42f..a4fd1de 100644 --- a/drivers/tty/serial/mps2-uart.c +++ b/drivers/tty/serial/mps2-uart.c @@ -562,9 +562,8 @@ static int mps2_init_port(struct platform_device *pdev, if (IS_ERR(mps_port->port.membase)) return PTR_ERR(mps_port->port.membase); - mps_port->port.mapbase = res->start; - mps_port->port.mapsize = resource_size(res); - mps_port->port.iotype = UPIO_MEM; + uart_memres_set_res(&mps_port->port, res); + mps_port->port.flags = UPF_BOOT_AUTOCONF; mps_port->port.fifosize = 1; mps_port->port.ops = &mps2_uart_pops; diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 1fef014..7017dd2 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c @@ -1412,8 +1412,7 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) */ if (of_address_to_resource(np, 0, &r_ports)) return -ENODEV; - uap->port.mapbase = r_ports.start; - uap->port.mapsize = PMZ_MAPSIZE; + uart_memres_set_start_len(&uap->port, r_ports.start, PMZ_MAPSIZE); uap->port.membase = ioremap(uap->port.mapbase, uap->port.mapsize); uap->control_reg = uap->port.membase; @@ -1493,7 +1492,6 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) /* * Init remaining bits of "port" structure */ - uap->port.iotype = UPIO_MEM; uap->port.irq = irq_of_parse_and_map(np, 0); uap->port.uartclk = ZS_CLOCK; uap->port.fifosize = 1; @@ -1711,10 +1709,8 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) if (!r_ports || irq <= 0) return -ENODEV; - uap->port.mapbase = r_ports->start; - uap->port.mapsize = PMZ_MAPSIZE; + uart_memres_set_start_len(&uap->port, r_ports->start, PMZ_MAPSIZE); uap->port.membase = (unsigned char __iomem *) r_ports->start; - uap->port.iotype = UPIO_MEM; uap->port.irq = irq; uap->port.uartclk = ZS_CLOCK; uap->port.fifosize = 1; diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index 3d58e9b..b303de4 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c @@ -695,8 +695,6 @@ static int vt8500_serial_probe(struct platform_device *pdev) VT8500_RECOMMENDED_CLK ); vt8500_port->uart.type = PORT_VT8500; - vt8500_port->uart.iotype = UPIO_MEM; - vt8500_port->uart.mapbase = mmres->start; vt8500_port->uart.irq = irqres->start; vt8500_port->uart.fifosize = 16; vt8500_port->uart.ops = &vt8500_uart_pops; @@ -704,6 +702,8 @@ static int vt8500_serial_probe(struct platform_device *pdev) vt8500_port->uart.dev = &pdev->dev; vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; + uart_memres_set_res(&vt8500_port->uart, mmres); + /* Serial core uses the magic "16" everywhere - adjust for it */ vt8500_port->uart.uartclk = 16 * clk_get_rate(vt8500_port->clk) / vt8500_port->clk_predivisor / diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index cf8ca66..895c90c 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1626,8 +1626,7 @@ static int cdns_uart_probe(struct platform_device *pdev) * This function also registers this device with the tty layer * and triggers invocation of the config_port() entry point. */ - port->mapbase = res->start; - port->mapsize = CDNS_UART_REGISTER_SPACE; + uart_memres_set_start_len(res->start, CDNS_UART_REGISTER_SPACE); port->irq = irq; port->dev = &pdev->dev; port->uartclk = clk_get_rate(cdns_uart_data->uartclk); diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c index ab432ba..87990b1 100644 --- a/drivers/tty/serial/zs.c +++ b/drivers/tty/serial/zs.c @@ -1113,10 +1113,12 @@ static int __init zs_probe_sccs(void) uport->flags = UPF_BOOT_AUTOCONF; uport->ops = &zs_ops; uport->line = chip * ZS_NUM_CHAN + side; - uport->mapsize = ZS_CHAN_IO_SIZE; - uport->mapbase = dec_kn_slot_base + - zs_parms.scc[chip] + - (side ^ ZS_CHAN_B) * ZS_CHAN_IO_SIZE; + + uart_memres_set_start_len(dec_kn_slot_base + + zs_parms.scc[chip] + + (side ^ ZS_CHAN_B) * + ZS_CHAN_IO_SIZE, + ZS_CHAN_IO_SIZE); for (i = 0; i < ZS_NUM_REGS; i++) zport->regs[i] = zs_init_regs[i]; diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 5fe2b03..d891c8d 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -427,6 +427,46 @@ void uart_console_write(struct uart_port *port, const char *s, int uart_match_port(struct uart_port *port1, struct uart_port *port2); /* + * set physical io range from struct resource + * if resource is NULL, clear the fields + * also set the iotype to UPIO_MEM + */ +static inline void uart_memres_set_res(struct uart_port *port, + struct resource *res) +{ + if (!res) { + port->mapsize = 0; + port->mapbase = 0; + port->iobase = 0; + return; + } + + if (resource_type(res) == IORESOURCE_IO) { + port->iotype = UPIO_PORT; + port->iobase = resource->start; + return; + } + + uart->mapbase = res->start; + uart->mapsize = resource_size(res); + uart->iotype = UPIO_MEM; +} + +/* + * set physical io range by start address and length + * if resource is NULL, clear the fields + * also set the iotype to UPIO_MEM + */ +static inline void uart_memres_set_start_len(struct uart_driver *uart, + resource_size_t start, + resource_size_t len) +{ + uart->mapbase = start; + uart->mapsize = len; + uart->iotype = UPIO_MEM; +} + +/* * Power Management */ int uart_suspend_port(struct uart_driver *reg, struct uart_port *port); From patchwork Sat Apr 27 12:52:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 10920275 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A846F14D5 for ; Sat, 27 Apr 2019 12:54:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A137202DB for ; Sat, 27 Apr 2019 12:54:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DF9C286B2; Sat, 27 Apr 2019 12:54:00 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 3AEA0202DB for ; Sat, 27 Apr 2019 12:54:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726425AbfD0Mxx (ORCPT ); Sat, 27 Apr 2019 08:53:53 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:54021 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727375AbfD0Mxf (ORCPT ); Sat, 27 Apr 2019 08:53:35 -0400 Received: from orion.localdomain ([77.2.90.210]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M4bA6-1hJp7z0BBm-001m7B; Sat, 27 Apr 2019 14:53:09 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, andrew@aj.id.au, andriy.shevchenko@linux.intel.com, macro@linux-mips.org, vz@mleia.com, slemieux.tyco@gmail.com, khilman@baylibre.com, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, davem@davemloft.net, jacmet@sunsite.dk, linux@prisktech.co.nz, matthias.bgg@gmail.com, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-ia64@vger.kernel.org, linux-amlogic@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH 41/41] drivers: tty: serial: lpc32xx_hs: fill mapsize and use it Date: Sat, 27 Apr 2019 14:52:22 +0200 Message-Id: <1556369542-13247-42-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net> References: <1556369542-13247-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:NfvV5UR6Ok9kQv6ROMSW720NbVRt8zJA2j6SiVCta9zO0Jw5F68 oDYmpeAiqIZsk1sS86lqn4+pdFZWevIEnEZ69zvk7cMJbxGvaG9S0AMXx6E3vAMZVzd7pPE dnjPcyK+WGDDc90Ms7ezLEUDc+ruGvc0EkFIZ+8daJJAv3bsvnnSUMXjXwFBnPEgLp6qoWu RKq97jOfEVGzQSAvfA3Lw== X-UI-Out-Filterresults: notjunk:1;V03:K0:kstkQConv8Y=:FRqaAKBl04WQWWJ/xhmytR ow68932EyMejNE2ydtWTf0Nk48WsWDBX+U00qXQiCeX9RLfuAjZhJilURAne8iEvlgV02R+n0 A2GYXlH6RAocA+3/XNEogage/GN6dO4HAMa6C/jwf7JzbK5UWacs4I86YK6BjId9I8QaBDRgB kf36Yrz9heQ6rpkUEPNwg7vs0J835p/+DW0ua1TLJJlSFnCt+nM1Z7WstcwbivmVU+gVR/Qqx LJN2HlNYlbXhHrWMmA6exILj0ML6d2lYydBx/ivglWsiafz+dSezxWkhz08L8VIqiIK6dShE3 srcNtj9cCMeeXy/WuKz1SoACQyyWLzFX5vJ7HF9AD7gMD8mGgq8+HhaWZ4LUAaR/dSriR/R3e B3lrMjPoO3yEqTwjmVNFPEHpLcxgHp3k0K3Z94bAYryqu/D8Q3Kol+4OglHPh7K6XXE7/78xA oUHoCvvSmoukL8/pOHIkrZr9VoXnBeU4ZV3EjcqSp85aW5Q6jRGfhhvHsog/vo9c0GQByGKDm IhDlqb2OO2SeLSFm9kDdRiPNxLsJCsxNdbJujreUgg5JbBJjQnJ034mhihaiaT1Aiki1mOiMB OI/mo7wAX4gLt7UHYKkjXmMizG1VASLtLoiFffgH9E2VkMfVV4CHN+LQBdpOkpoUf5rl7srXx Kiaqeii/5ydXPnHLqiI2CQtzy/PupKJZ0jWzWsaeQ4xVmH8rQepFc6frR/i5b/8B5xfPqj2Q5 /wVryOKfpTVqR4EsCEJA4sFCJJjcxbeUyiEL7g== Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fill the struct uart_port->mapsize field and use it, insteaf of hardcoded values in many places. This makes the code layout a bit more consistent and easily allows using generic helpers for the io memory handling. Candidates for such helpers could be eg. the request+ioremap and iounmap+release combinations. Signed-off-by: Enrico Weigelt Acked-by: Vladimir Zapolskiy --- drivers/tty/serial/lpc32xx_hs.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c index f4e27d0..d1f09aa 100644 --- a/drivers/tty/serial/lpc32xx_hs.c +++ b/drivers/tty/serial/lpc32xx_hs.c @@ -579,7 +579,7 @@ static void serial_lpc32xx_release_port(struct uart_port *port) port->membase = NULL; } - release_mem_region(port->mapbase, SZ_4K); + release_mem_region(port->mapbase, port->mapsize); } } @@ -590,12 +590,15 @@ static int serial_lpc32xx_request_port(struct uart_port *port) if ((port->iotype == UPIO_MEM32) && (port->mapbase)) { ret = 0; - if (!request_mem_region(port->mapbase, SZ_4K, MODNAME)) + if (!request_mem_region(port->mapbase, + port->mapsize, MODNAME)) ret = -EBUSY; else if (port->flags & UPF_IOREMAP) { - port->membase = ioremap(port->mapbase, SZ_4K); + port->membase = ioremap(port->mapbase, + port->mapsize); if (!port->membase) { - release_mem_region(port->mapbase, SZ_4K); + release_mem_region(port->mapbase, + port->mapsize); ret = -ENOMEM; } } @@ -684,6 +687,7 @@ static int serial_hs_lpc32xx_probe(struct platform_device *pdev) return -ENXIO; } p->port.mapbase = res->start; + p->port.mapsize = SZ_4K; p->port.membase = NULL; ret = platform_get_irq(pdev, 0);