From patchwork Mon Jun 10 08:44:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 10984395 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 C9FB092A for ; Mon, 10 Jun 2019 08:45:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5AA0286BE for ; Mon, 10 Jun 2019 08:45:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A49012876D; Mon, 10 Jun 2019 08:45: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2455D286BE for ; Mon, 10 Jun 2019 08:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=HPn0coHdTKnYgw+hJ8rPxF4vwJyV3muMEgHe0nDaFaE=; b=GlM boOnnUq8L3KStnJizrXS82SRVIEFAFKRwlgQjJjoH6J835E/x+qsrIkYtf9tZFhRMy3PRJhLMAQLA lld6l5JrSBsY3W7rRlGkQwHa0XZMH8MEwMrtNF6hUaEgYZ9k7/h0rm22E4jACmJsZYxEfKAVjma// N7R+bWucuyxkCs7fmg8u5rqufpHTmFp11gSj9TXQss63L6+6ysOaj8CCU9MSUZ/KIHJO5/vi/calf WqIde4gPNkpev5fNPTh93yN73affXfGQh2/a3bx/wkYNnjSYlek0JK3Za/JYg8PRBJbBfypoT4bzm 2RN0UICdLthvBIvTBHGQM+9BgVV55aQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haFvi-00060X-Lo; Mon, 10 Jun 2019 08:45:26 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haFvM-0004Wn-KE for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2019 08:45:07 +0000 Received: by mail-wm1-x344.google.com with SMTP id c6so7314667wml.0 for ; Mon, 10 Jun 2019 01:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=qNwGVD0v2tDJVOma8Me2tLXYHNv3uP9ayQAL5Zl5p8M=; b=nSxgBY6UD0ogbvDpleZuxipRQtaVHmWNbd3+eNF78yabI2JIsfMO39rdkJuMbNNNEe uIru4cBb1MmPcYWj/kOLluu1HIst5DczKJbRnNe3C7chIny78xJnJTbDtp/bTTC1rJ9A CmsykBhDqPh7Zez/O5wtjuOyEWDN1wnP4Jnzw4pIcLWrTRNn2YEDYEE0JRNkS8JYgE/M AjOs8MemHx6dr4ab2ob+j1UcCcxRGLyhd5CdXX244kUkBitDNEIpROnrP/ooYoi31a1c SkWZtppIKK3rhjmELkQWW0VubtKtcsVIwBvkvM4IJPb/n+25vEnNmktuAdmvI1nxggCR X/sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=qNwGVD0v2tDJVOma8Me2tLXYHNv3uP9ayQAL5Zl5p8M=; b=MRzFLHpoqy4JJIhhavZCGS5qp2ea8G3rAVZP/yLDL2G9wAKfK3HZlKUkyafqIohhZQ bHHYm7YrmGo+Y5OQhZcZJdU7IzTjq86KDnwJ8DkHVEetVzvi7EAqgo8/+YJiQK4gNj3J 378G4F+Gt81iNBXILuIjF5o/+VVX0d0BrRlZkq0Kt9h99Mm/aH4jykwC9fA9ox5nxZQI g2vIZpBCXCfeqJFMD/fldqH+ooFhfwdf1tWd0vCpqfcsRCTD4NArw+TQ9z0DIKUbO5om v2W/hKSKxSTsZDWYuOX1S03Tw/8PjV8k/gPbtGGwczrmnI3mZQ4FZXBDGv9eTYSPccvA zElg== X-Gm-Message-State: APjAAAU065eDqSK6aw2UhRiEYT+ORkcvaeLBu17jGcmS0DuIItaia5NE ZepoSAtuvEXmN+4I7TGe+coJEew74QFqzg== X-Google-Smtp-Source: APXvYqzqd62YGTXD2QtIldC59KTmIjNitmODkstbY2lZa1eC733LOO1gBiQtxJ40qqkDdHCG3xx5MQ== X-Received: by 2002:a1c:750d:: with SMTP id o13mr12156907wmc.35.1560156301810; Mon, 10 Jun 2019 01:45:01 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id j132sm17445435wmj.21.2019.06.10.01.45.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jun 2019 01:45:01 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, johan@kernel.org, gregkh@linuxfoundation.org Subject: [PATCH 1/2] serial: xilinx_uartps: Fix warnings in the driver Date: Mon, 10 Jun 2019 10:44:55 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_014504_858884_1E689F17 X-CRM114-Status: GOOD ( 11.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nava kishore Manne , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nava kishore Manne This patch fixes the below warning -->Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. -->macros should not use a trailing semicolon. -->line over 80 characters. -->void function return statements are not generally useful. -->Prefer 'unsigned int' to bare use of 'unsigned'. Signed-off-by: Nava kishore Manne Signed-off-by: Michal Simek --- Happy to split it if needed. --- drivers/tty/serial/xilinx_uartps.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 605354fd60b1..6af2886f5ba7 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -35,12 +35,12 @@ /* Rx Trigger level */ static int rx_trigger_level = 56; -module_param(rx_trigger_level, uint, S_IRUGO); +module_param(rx_trigger_level, uint, 0444); MODULE_PARM_DESC(rx_trigger_level, "Rx trigger level, 1-63 bytes"); /* Rx Timeout */ static int rx_timeout = 10; -module_param(rx_timeout, uint, S_IRUGO); +module_param(rx_timeout, uint, 0444); MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255"); /* Register offsets for the UART. */ @@ -199,7 +199,7 @@ struct cdns_platform_data { u32 quirks; }; #define to_cdns_uart(_nb) container_of(_nb, struct cdns_uart, \ - clk_rate_change_nb); + clk_rate_change_nb) /** * cdns_uart_handle_rx - Handle the received bytes along with Rx errors. @@ -312,7 +312,8 @@ static void cdns_uart_handle_tx(void *dev_id) } else { numbytes = port->fifosize; while (numbytes && !uart_circ_empty(&port->state->xmit) && - !(readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_TXFULL)) { + !(readl(port->membase + CDNS_UART_SR) & + CDNS_UART_SR_TXFULL)) { /* * Get the data from the UART circular buffer * and write it to the cdns_uart's TX_FIFO @@ -1073,8 +1074,6 @@ static void cdns_uart_poll_put_char(struct uart_port *port, unsigned char c) cpu_relax(); spin_unlock_irqrestore(&port->lock, flags); - - return; } #endif From patchwork Mon Jun 10 08:44:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 10984397 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 8648392A for ; Mon, 10 Jun 2019 08:45:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74DEE2876D for ; Mon, 10 Jun 2019 08:45:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67E2B2877E; Mon, 10 Jun 2019 08:45: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C0E1A2876D for ; Mon, 10 Jun 2019 08:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=aYgA7Rv61sEUKC7U7YT8a6elNT8OooWYqOogVIR/5yw=; b=ADTcG4De9TmMmJK4U7y4e6/6BM 7N0OQBEZ3ONCJPFA52qBcpCMBzvvCgPf3lFAq4kDJBfhrzgRoOpkS/Ma9oKnUsuYhpzWbcNFUoSfu RU33QjbOw0Q9sfbyT3l1UBnkQC4lfZ3yYmNj7nHV9vNNqfMV+Qj3bqkNdtD3TOKvHldIyqGW/A3zD c3ew4Z5ejTNH7j7zLyU+tpch1gfLR/iK/7ggKRYIjH0V6HSXhp0k+k1auVlXD/xVPWEStJA36fODG Tinmyz3kg9AbbriSJcbHZRvBB5FpOZru0UCL+FU/8jTAL2GF+v+Rrpl/3vPubxVvfzx2HUmQbsFUI U11Ido0A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haFw3-0006Nl-FJ; Mon, 10 Jun 2019 08:45:47 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haFvN-0004hG-Ks for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2019 08:45:16 +0000 Received: by mail-wm1-x344.google.com with SMTP id u8so7305606wmm.1 for ; Mon, 10 Jun 2019 01:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=M+cP6C7+VK3jw1r29YjrDx6Ndjlh7cgtx3v4K/NgDeo=; b=skNfvRf9d+s4BJ3piPlivoHWyDhAwaIRmipuCtcV3u2KR+vFbN4F+TJuRmtQ8/lnvF 1gtZAsGOd56DCCnP1pmwBnX2m2YQLDATKu4pUkOmahNnAPJ/MNrjJSfW7MSY7+j21xPI Mhr9hj0SmaCObOLnsXZTJRZ5thrzaXG3syQQBNPB/FJkoXl4UC7/pALnd/1O1tjvkixy DCIbarfpgzpMXJO4PPUWxqzowa49YG/LWIkMjAQpoMn9oZPrX4iN9MGm7n8+SYn9p9kd BUAKc/S+myiWbw7/p1Nd/QWCDET3wxjz3eijq8BQ3AVmtbcO5Kcn3gKl1ToUub+WIZ10 4Gww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=M+cP6C7+VK3jw1r29YjrDx6Ndjlh7cgtx3v4K/NgDeo=; b=tE9YcEDjv9bwK/PCkakyJFIM3wSljCAV8ZhD9YmG1a9AQHjDfls8dbFZq+XsOSlFXz o2OK/SmRqOE7lnbovTRb/D0/75D8/8Qo3KHZNUyFscyhCHSO97KzzyvXlE2x6yYjh5oO SAS0Kx1jjptlJtefMIi2AwoiV98T/h1aog9mIAa8r/pucHj5geAch8oL0/bnJTYcCWcd M8kfgSlFkdpAcTeG3vUdy1FoBGK9Qx6PWrnbTAr9E6tjAl97mt/Or5crQZzcWsXo5rY2 mPqcwXGgCuti/t+Ut9ZQQHCua7Hhbv5yVnlfukJyact/Z7Dj+vDH4g/Bk7ZM3wyxpxkd 1imA== X-Gm-Message-State: APjAAAUag5s8nxcrdKce4L5HAhbEGmhIH2YOkyX0rmaGKQ2iXNieHAjs h7kWE5L6I9D4qKzvtDMWOumixQ== X-Google-Smtp-Source: APXvYqyqoIr6fU1KzvLY8lEPM3s5B6qJXzVnTwekyShtxIqDrTxMhdNjfJPY9GeTEpwMm2XWi5yoPg== X-Received: by 2002:a1c:750d:: with SMTP id o13mr12156994wmc.35.1560156303497; Mon, 10 Jun 2019 01:45:03 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id w23sm7629173wmi.45.2019.06.10.01.45.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jun 2019 01:45:03 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, johan@kernel.org, gregkh@linuxfoundation.org Subject: [PATCH 2/2] serial: uartps: Use the same dynamin major number for all ports Date: Mon, 10 Jun 2019 10:44:56 +0200 Message-Id: <381ea608440345a4424d24296666b2451b1a20ee.1560156294.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_014505_835519_342C411B X-CRM114-Status: GOOD ( 13.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shubhrajyoti Datta , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Jiri Slaby MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shubhrajyoti Datta Let kernel to find out major number dynamically for the first device and then reuse it for other instances. This fixes the issue that each uart is registered with a different major number. After the patch: crw------- 1 root root 253, 0 Jun 10 08:31 /dev/ttyPS0 crw--w---- 1 root root 253, 1 Jan 1 1970 /dev/ttyPS1 Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek --- drivers/tty/serial/xilinx_uartps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 6af2886f5ba7..a0b51c60faeb 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -29,12 +29,12 @@ #define CDNS_UART_TTY_NAME "ttyPS" #define CDNS_UART_NAME "xuartps" -#define CDNS_UART_MAJOR 0 /* use dynamic node allocation */ #define CDNS_UART_FIFO_SIZE 64 /* FIFO size */ #define CDNS_UART_REGISTER_SPACE 0x1000 /* Rx Trigger level */ static int rx_trigger_level = 56; +static int uartps_major; module_param(rx_trigger_level, uint, 0444); MODULE_PARM_DESC(rx_trigger_level, "Rx trigger level, 1-63 bytes"); @@ -1516,7 +1516,7 @@ static int cdns_uart_probe(struct platform_device *pdev) cdns_uart_uart_driver->owner = THIS_MODULE; cdns_uart_uart_driver->driver_name = driver_name; cdns_uart_uart_driver->dev_name = CDNS_UART_TTY_NAME; - cdns_uart_uart_driver->major = CDNS_UART_MAJOR; + cdns_uart_uart_driver->major = uartps_major; cdns_uart_uart_driver->minor = cdns_uart_data->id; cdns_uart_uart_driver->nr = 1; @@ -1545,6 +1545,7 @@ static int cdns_uart_probe(struct platform_device *pdev) goto err_out_id; } + uartps_major = cdns_uart_uart_driver->tty_driver->major; cdns_uart_data->cdns_uart_driver = cdns_uart_uart_driver; /*