Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4981890imm; Tue, 16 Oct 2018 03:21:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV63LMTfbK+GCgNSUrpPnTBTaxVG3XNMJsxSCq3EbooNYjm+hDzjzT/2l+UN7tc4pnLZdMNur X-Received: by 2002:a63:441f:: with SMTP id r31-v6mr19708135pga.60.1539685260175; Tue, 16 Oct 2018 03:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539685260; cv=none; d=google.com; s=arc-20160816; b=xliIpVpRdzwBYazuATzBHjKlof1hcMzq/dvFeUOaY1KiQloxckNmxYWZ96TLCA0hyJ nrSXJ5dQk1Zkq9eoeMn01fxFjTdabRWQBd3Ux0c1l6vXmjbRRuqxUWKu21+TvHt5jRYR HQuQhdUsqKRvLJMKkW5pHNyWyBRV1tZYH9dlNEDijwvitf9FNyx0bvJP1lHtOXq9N9on L3BAxESQKlWhrMtWEcZ3OEgdF+MXTCkkWGCnoUVEBDhquRB1Of2Pn7eKLszulgl2pD9u 5NXcuXVzUBlZC5B8eGZW31HrD6cNnriSH1So1ZkJSe5DmL2SKquo4Ix4iKdTmL5yFxtK HmyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ro6NpmuQQHqCXI8pg9A8LfdlDNEI7SU3KQaaxBkzS28=; b=xMWKUQ6y4irzVCDclyNKc28cSUP7MKFtjWiKgZUs2VvG5DWgGh55YhLkAmhTlMw3S+ mY24fyVroEJ1bWcsxJwJ58FcFG2Pdr1CpOUCe3lsyUdyPEbLJcx+cAZFNO8GWiPdHL1I cKQ35UrEjDlJyI7q2/wfeYNKXF8Td0cOKgqA9wQFWB6rRV2E4vktuKtGeuQmfgky6aUd 13n+oXf6uikAxLQcjMw5n0ACk8sxQlBbE2NqNk1aUbZCAs3hgQBytkdd00lU91GjwOin /LCa5Ws6g5s64jiPt3Zq/8z7hKOQSuZVAposi7Q3esWuCt1n5LaYBCH+tqxZNHcShRoH 84Zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p10-v6si12607630plr.299.2018.10.16.03.20.44; Tue, 16 Oct 2018 03:21:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727237AbeJPSKI (ORCPT + 99 others); Tue, 16 Oct 2018 14:10:08 -0400 Received: from mail-cys01nam02on0067.outbound.protection.outlook.com ([104.47.37.67]:1376 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727071AbeJPSKH (ORCPT ); Tue, 16 Oct 2018 14:10:07 -0400 Received: from MWHPR02CA0010.namprd02.prod.outlook.com (2603:10b6:300:4b::20) by BYAPR02MB4678.namprd02.prod.outlook.com (2603:10b6:a03:52::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.24; Tue, 16 Oct 2018 10:20:20 +0000 Received: from SN1NAM02FT064.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::207) by MWHPR02CA0010.outlook.office365.com (2603:10b6:300:4b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1228.24 via Frontend Transport; Tue, 16 Oct 2018 10:20:20 +0000 Authentication-Results: spf=softfail (sender IP is 149.199.60.83) smtp.mailfrom=gmail.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 149.199.60.83 as permitted sender) Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT064.mail.protection.outlook.com (10.152.72.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1250.11 via Frontend Transport; Tue, 16 Oct 2018 10:20:18 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1gCMQl-0007Kk-Me; Tue, 16 Oct 2018 03:18:27 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gCMQg-0002Bz-Ds; Tue, 16 Oct 2018 03:18:22 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w9GAILB7005739; Tue, 16 Oct 2018 03:18:21 -0700 Received: from [172.23.37.106] (helo=xhdshubhraj40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gCMQf-00028h-9j; Tue, 16 Oct 2018 03:18:21 -0700 From: To: , CC: , , , Shubhrajyoti Datta , Michal Simek Subject: [LINUX PATCHv3 3/9] serial-uartlite: Do not use static struct uart_driver out of probe() Date: Tue, 16 Oct 2018 15:48:02 +0530 Message-ID: <1539685088-13465-4-git-send-email-shubhrajyoti.datta@gmail.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1539685088-13465-1-git-send-email-shubhrajyoti.datta@gmail.com> References: <1539685088-13465-1-git-send-email-shubhrajyoti.datta@gmail.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-Result: No--6.018-7.0-31-1 X-imss-scan-details: No--6.018-7.0-31-1;No--6.018-5.0-31-1 X-TM-AS-User-Approved-Sender: No;No X-TM-AS-Result-Xfilter: Match text exemption rules:No X-EOPAttributedMessage: 0 X-Matching-Connectors: 131841588197546808;(f9e945fa-a09a-4caa-7158-08d2eb1d8c44);() X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(346002)(39860400002)(396003)(376002)(2980300002)(199004)(189003)(16586007)(83322999)(336012)(6666004)(498600001)(305945005)(51416003)(76176011)(110136005)(450100002)(2906002)(54906003)(4326008)(446003)(76482006)(2876002)(55446002)(86362001)(11346002)(486006)(126002)(77096007)(73392003)(476003)(2616005)(426003)(73972006)(26005)(356004)(48376002)(61266001)(50226002)(81166006)(87572001)(106466001)(81156014)(63266004)(8676002)(14444005)(50466002)(8936002)(47776003)(36756003)(105596002)(5660300001)(9786002)(316002)(86152003)(107886003)(82202002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR02MB4678;H:xsj-pvapsmtpgw01;FPR:;SPF:SoftFail;LANG:en;PTR:unknown-60-83.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT064;1:BUog6i+3mSuWoj8wn7mce7ns7sUGv4xiMR3dZslMKynlaCV2MdbIv2OxRQVtGLamURFSSMx4ZsRaNrdSwEWkgD86XY/mTxjmxiM2QhGQArP8Prd9pStc83a2pPwLmfGr MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e577018-e6c9-42c4-d1b0-08d63350f990 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(5600074)(711020)(2017052603328);SRVR:BYAPR02MB4678; X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4678;3:8Mgq9IsmKeQYrBmsQdpt3p+1NZzQL0Agzf6ZoArz3XUXQNfGaO5fRxtLHGdAUo2HR1r/2R/3Bq4WzBAHROQHB2mknigdpkOlMQCA2QlgGrb2846jbUv7fJ2HGMq5cVBwfzA24g3uG+wlT4H7/PFNzenKvoX6bGvGkxeRFdkpRlNuR8dUY5zSKGzeY8rpaxE3NrbrxTGkpxfoOtFqkrzAMPyYXw8E3vBFYSFbmWWOY2+EdI3NO32jvoJ+SMnTdqZ5z8PJgoVPUjWNKAqQl5JiElr4SE+WI0KPkWxi3reIePv765sTK37PqeGky6lFK3k4Px82DdvyqNFHI4Wf7bpx9KMR3OCWCDo+JWfBM9jiqPU=;25:Whu7IBYqc++T6txQ7flCkots7m5jbdoXiDgmitbsibSz57+cbEbNbyR56dNOFzjesQVzxiSWha90CLG6s98RXUQj1KpHRwie1awk6ZGSQxP2v652nJUj2AF0SgLtQrTXo8aaHGYgFx1kKFsFpOUMhbRQMZaT7YvzfHj0QRcl31ko2ikV0OujKuOgM6lssl/FJG7KALlkfpmCYf5+DH72lnthCPzzxfbynNzEyGjjQCkXzyCYuoXgBHFVhWWybFuZObvgz/TGhkZ/l4JogCK8hoNUVwfThisAbqj1NFDg0gPK4zbJLJ4I/sCsanTQ1V6fXy+EZzZulrrMPkLtF94Rch5GS5JFkBJIqazcb9pjUqE= X-MS-TrafficTypeDiagnostic: BYAPR02MB4678: X-Microsoft-Exchange-Diagnostics: 1;BYAPR02MB4678;31:64XEwFDHhL3IqGOnK7VjxpeZIlj4dMCz1RGDZX6qQqF5NML9e9HdgSziqcl2au6bT/Rc4jThP90IyWlL1jQCJUb+bS1yAb/go456iUdHqD1wdAg16zYp08PKFmRrP/w2q9Bd58lZ0e8eSSCVBA8p+NLX+1y2rXTcYM19swWt9m58XTMpkPl1Q2YZ2Da2piEr79DAnizfVdRKTZFjpU4AMuAlojPovrlBCwYAxoYOSlE=;4:QcBUAWLvlC2aU6/esJZLOxFPMaC2QdArHihA8NSNYiEoFwmXYsBygSJU7LxLgha5Jd71lG6CHwe3C9wrW4dVDo9iKl13fi8rAdNd3PLZkIYMjfrSh/S+a0OkCRec42fXPrez0yDnILiqKtspSd9z68XfgI/RLDGfgiiI48Q9SUwxbalOQWnlXgvapz/GrdVPtDBdx9sjiBBAgr0O9aM6X/l6S0Q6QLPIX+SA1FQamj7/Q/feKIW9HfixATsF4VxjGk0eVS/ziWhZbvbDxbJOBT5PuzKbrmRB5hoRMpbn66Bpscq5LUAVS/uN4AW+uo+P X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(6096035)(20161123561025)(20161123563025)(20161123565025)(20161123556025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(201708071742011)(7699051)(76991067);SRVR:BYAPR02MB4678;BCL:0;PCL:0;RULEID:(400006);SRVR:BYAPR02MB4678; X-Forefront-PRVS: 0827D7ACB9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BYAPR02MB4678;23:iwWajhovwBHlMdeBCL0qqOY06iGhkNF0mT1d8OOis?= =?us-ascii?Q?B0VX5Vt1GuMaE92JeOeqMfGPuYeJjJQm5AtpfF9/cwHf4RAdR+r+9puuGgoC?= =?us-ascii?Q?qt4huSt3Vy1MkiVgifRmNDfR25bWrpnEO3Fzi+vHbqI1qL0vjL6OR5nkaisG?= =?us-ascii?Q?p7TKKdyP4rojgnpIjLJRGaiP6SgWy4+ktj+NqdFW6xAJ6PkE0cA+E/uMbfLM?= =?us-ascii?Q?AV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RzusyUdzUc0UQTgRSJCWwe7MCG40touph5zZOq5fkrAWPbs6CMMXcaNHAqMHFp9vNuA3wapJ+zKlFi9pHjh6i+Dpgu8XnUe7WEDIw/rsHw==;5:G4mnwG/tyLafnxZXHZKwm++LVLwK+VXO5zeAmFNj0fkevoyAcLfGu2QN4Og2mhRXR/ULsTA6yfgZfkgV1SQS7CZfLmKXbFzhabvD0wyEzMna8HnbSUA54eFd0Brn+HPzM4ejsAeaRdg47GAUvI3vIqfWrgJKj91ztLPRCXOMeVs=;7:+8xQqbI8Bk6ZHQEL/mU7Purl0H/Af1nFDPY2eUHOb42oOc3B+zNdH2FTr9pzd6Ls4ATt82+eMkomwc4dLWKrhFAnRpr8NEG6A7eZEGBgxqyPtiqkLK/3sPdMTcd8jtYQhl9g8daWeLgRn2ym9WBU6mk0QKKB2bsDggxV0klf5fJc0LDfu0lMMDtKfU2l1LCqInLWEOPSfKBstgXl078SZLQ1Nn7iMH+QrhGT94uy2Woh4mWfq2B3GT48AyBMzaXK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2018 10:20:18.8952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e577018-e6c9-42c4-d1b0-08d63350f990 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4678 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shubhrajyoti Datta ulite_uart_suspend()/resume() and remove() are using static reference to struct uart_driver. Assign this referece to private data structure as preparation step for dynamic struct uart_driver allocation. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek --- drivers/tty/serial/uartlite.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 441a216..64c7248 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -63,6 +63,7 @@ static struct uart_port *console_port; struct uartlite_data { const struct uartlite_reg_ops *reg_ops; struct clk *clk; + struct uart_driver *ulite_uart_driver; }; struct uartlite_reg_ops { @@ -691,10 +692,11 @@ static int ulite_assign(struct device *dev, int id, u32 base, int irq, static int ulite_release(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); + struct uartlite_data *pdata = port->private_data; int rc = 0; if (port) { - rc = uart_remove_one_port(&ulite_uart_driver, port); + rc = uart_remove_one_port(pdata->ulite_uart_driver, port); dev_set_drvdata(dev, NULL); port->mapbase = 0; } @@ -711,9 +713,10 @@ static int ulite_release(struct device *dev) static int __maybe_unused ulite_suspend(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); + struct uartlite_data *pdata = port->private_data; if (port) - uart_suspend_port(&ulite_uart_driver, port); + uart_suspend_port(pdata->ulite_uart_driver, port); return 0; } @@ -727,9 +730,10 @@ static int __maybe_unused ulite_suspend(struct device *dev) static int __maybe_unused ulite_resume(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); + struct uartlite_data *pdata = port->private_data; if (port) - uart_resume_port(&ulite_uart_driver, port); + uart_resume_port(pdata->ulite_uart_driver, port); return 0; } @@ -804,6 +808,7 @@ static int ulite_probe(struct platform_device *pdev) pdata->clk = NULL; } + pdata->ulite_uart_driver = &ulite_uart_driver; ret = clk_prepare_enable(pdata->clk); if (ret) { dev_err(&pdev->dev, "Failed to prepare clock\n"); -- 2.1.1