Received: by 10.223.164.202 with SMTP id h10csp1294155wrb; Mon, 27 Nov 2017 00:12:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMbOmAJBZ0Pt+TF466f/T5GCdl8XXoT+JTQqwFQv89l/IVtPasZ3ozGB1Dx7vVvPCxgVw9c6 X-Received: by 10.101.76.65 with SMTP id l1mr28028803pgr.323.1511770350165; Mon, 27 Nov 2017 00:12:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511770350; cv=none; d=google.com; s=arc-20160816; b=w5SVC33mkC4hjBYpZCgY5XI6azOnPjp0tFhHfglINoEBmuiYmcxTbNGlRBJtk9cDH8 EhGjhq6yTnl7NtCP+IZ6jDCMJZEvA7SYmli7utEicPECZbBMBsbtMOqA6J5H5ZIvs007 2EX/ezYTo+j/0Di8ZDKcCuwMLClVovRzOQ5QIHN8Ycz0HqVQ44yEAfyzx58GpguBow3x hctM+qHxJDU9MAlaKlsfr5SBwzpNX4aOQZ11CZPF+uQlhri2GRhevcAl1G5tOa9r8xr+ B6H//yor0p/DROYgyjbBoWKS8YkrKePz5xx9lnu5Q7i2vvGnrcXmBPspjykEQjkH0vc1 ivQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=/AUO/wjiekfHsz4aRRZypPbV7PV5+mo/JfzONO+cFKE=; b=rfBYhF/ikN4V5YjwGSewBxmaTH+A1pZB0eV1iKgk0wPrYHoWeuwfuqpOpcojw9ZNkA DzNY/T7pfIrfgnNpyMDvEnZrBw0fRYkYPmiw8wvRQcOeCZjdWq3m7maahWJA1dYrVw82 5xVfEjKjj3OFIWu7qNWmjkqUdp5HOXYtTq2ED8PpnsYMJvfzwcf5bKCA2yf3DxC/DJPp sqVFX9Eyz46rJG+EjyRZVVPlDj6dc2lNL5xVxX/YJtM6pkzHd3fdkmcD8/XpYVAnV5VM zkvd/ZG8np/Y2wvTYrXG8nNUAL1BSQ2qnYuN28k8qdBA7xVX1w4qaTLmUe/ATSpm6ZR5 fM7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=tQjM8MF5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si20595657plv.554.2017.11.27.00.12.18; Mon, 27 Nov 2017 00:12:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=tQjM8MF5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751373AbdK0ILl (ORCPT + 78 others); Mon, 27 Nov 2017 03:11:41 -0500 Received: from mail-co1nam03on0048.outbound.protection.outlook.com ([104.47.40.48]:1797 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751270AbdK0ILj (ORCPT ); Mon, 27 Nov 2017 03:11:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/AUO/wjiekfHsz4aRRZypPbV7PV5+mo/JfzONO+cFKE=; b=tQjM8MF5O+DMtp84YBo9RvORUZbQnu4NHvIy97PY5RUZ52qIPNWR3AaDtXRIM2tSuyoyiJNNTsN0oLp4ryKzKbb60DVPMFr3ZSEm2xAreAWmRHbI1XrbRBzA9WwbJLfiDnj44Yokzu9kPQq4n7BKUjwRAVZ64n2UPDmjDa7QYns= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by DM2PR0301MB0767.namprd03.prod.outlook.com (2a01:111:e400:3c0d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Mon, 27 Nov 2017 08:11:35 +0000 Date: Mon, 27 Nov 2017 16:11:15 +0800 From: Jisheng Zhang To: mathias.nyman@intel.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: host: xhci-plat: move clk to plat own private structure Message-ID: <20171127161115.2525b73a@xhacker.debian> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: SG2PR01CA0105.apcprd01.prod.exchangelabs.com (2603:1096:3:15::31) To DM2PR0301MB0767.namprd03.prod.outlook.com (2a01:111:e400:3c0d::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39b61c14-676e-4ed8-9ba6-08d5356e7b47 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:DM2PR0301MB0767; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0767;3:QHz8cnDRoInWBkzCGcuqEW486yFdX9/+rH5x6Exs9kfYNSfkSiJUnyCiKxRFO2ki8hlop9m+ncdyLXerr5YdghtzmOQLnu1v0CBlFtJk+Mg4ZlyAVkYP2xuc9aswzAXSwarzUEiNehrjyn3jymF/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9hE1MzUNLcCyg2BBYu5iO08h0K5IHfH6IJYJG4cs4TO3NrWz+HW8Ic7jRsk+SWu6kv5vXYJ3iU4n9h5ufVPPEVI0Tk1tuJDKEcHwtzUHPzzNx3tZE=;4:A7LOa9k1USZQ5bSK6UVJoOMUk9ETykT6JxmSQTK4yVy+C8sja5VcRymY6D9i0hmuDi9vWecEEJdjSQukV/9E8c1bDdJ1qDERnEq2M7BMuhSgiKjy3EY6O40Rh+cliMXXWUtprPmixCDKjL3OcKOwxNsmGzxSSXFsOHmQfPjuYYBpWitG7voxDMKADNV2ZUXU7rn+aMBzzmxeMoYRp0AC32rTWsABn2oU5Ht3L3YQEXCMv7DtjxiUIPBpIheofWunHqPi6ip+T2MfbIdJovvokg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(3231022)(10201501046)(93006095)(93001095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(6072148)(201708071742011);SRVR:DM2PR0301MB0767;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM2PR0301MB0767; X-Forefront-PRVS: 0504F29D72 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(376002)(346002)(366004)(199003)(189002)(16526018)(1076002)(316002)(5660300001)(230700001)(8936002)(305945005)(2906002)(33646002)(55016002)(7736002)(9686003)(6506006)(8676002)(72206003)(50226002)(25786009)(97736004)(81166006)(6666003)(52116002)(81156014)(478600001)(3846002)(7696005)(6116002)(66066001)(47776003)(101416001)(189998001)(50986999)(68736007)(86362001)(53936002)(4326008)(23726003)(106356001)(105586002)(50466002)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0767;H:xhacker.debian;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB0767;23:hNAiqGUYO4pPTWIWfZQFrHeRVYobraEWeBTnLP1?= =?us-ascii?Q?IGzcft5CQGIBaYYDStvjSDRBJjYQ83+ZUrpelDo+TpbIjg7oOca15nqv8Cxe?= =?us-ascii?Q?DR0dSu61PFOCntDHlllKRyEEeJgTW/cLgYYJJX3E/x114KwUtIgFJEw0SV80?= =?us-ascii?Q?l4Jxm5zmeHLxO9qrwbBssEv+2R0YGtyqPra6/X73EuLZScdOD+vcnsUBfP7s?= =?us-ascii?Q?R9NQL7IcL/XHYBuK8P7+XVyKzJvLqZAlvo8yNO2wThtE0lrk1oqTGyIZgnfy?= =?us-ascii?Q?ZdUvubggDqnigbvOywjs60f/8gJrDPt2zmvpbZbuZPZZi1LmHKCmnJTCThKt?= =?us-ascii?Q?ZEsn7uJH8/Z5/f/H5VNiOiMkSwV4PhCzIbnD3F9AVB/zmVOoAjOnWvwr86Xq?= =?us-ascii?Q?QHv2EDatc3uPXWC/YKqj+wA/flvnbu3lHAYgLyWXpqa6bmFRJPJgUGIW6ALb?= =?us-ascii?Q?bO9DZoZxcQEZqZPvAzylSkv5UDega5pXooUFe8HJ3WHI6fmfILW6tyTssPYr?= =?us-ascii?Q?7X6ktjCl12Nh1VduWR3PZGCD1Zkx/4VgyWbwTsC72oib4b/c/SWgwb14whoQ?= =?us-ascii?Q?DYBhAHybU665jZ3LKJDgytWDoACQBOcKf0jLknvqeXbZ8D+i7yvtdbyYjYAG?= =?us-ascii?Q?qGtCuubhgJNigZAitY6zWFvRWXJL47kHq7UJti6jVtHjIS1iVRhSTq7OpxXI?= =?us-ascii?Q?XNJCqlh2g9vXglRR2QjSA+F24MRdOhuNGxQo8dsLvOITn5GHySw39dyt9uRd?= =?us-ascii?Q?1eKIkWsi6u4Oufuim0KOhkEFwkuopf8cXGA6pU9B0PkIpJiOeC16bgOoZO1P?=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x5cCIHClQT494JlbbYqI3ftCUzULuwpbg/iXee7Tv4lznNSaNWFtRozh8HXGJPmB731TEZNqilNkgmX9U78ClQ1Twy0kUMmARhbc047lm60F4pPrqiYCEc33lcogNDle64ccJ5E2Ay25SqFhrUC05oVwsOVfY0SnHnHCFcacMdk4eQnAJAw1DoOxmm0ELcfDd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2017 08:11:35.7664 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39b61c14-676e-4ed8-9ba6-08d5356e7b47 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0767 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 4efb2f694114 ("usb: host: xhci-plat: add struct xhci_plat_priv") introduced struct xhci_plat_priv to hold the plat driver's specific variables. The clk is only for plat driver, so let's move it to the proper structure. Signed-off-by: Jisheng Zhang --- drivers/usb/host/xhci-plat.c | 17 +++++++++++------ drivers/usb/host/xhci-plat.h | 2 ++ drivers/usb/host/xhci.h | 2 -- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 09f164f..4cd9162 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -152,6 +152,7 @@ static int xhci_plat_probe(struct platform_device *pdev) { const struct xhci_plat_priv *priv_match; const struct hc_driver *driver; + struct xhci_plat_priv *priv; struct device *sysdev; struct xhci_hcd *xhci; struct resource *res; @@ -240,6 +241,7 @@ static int xhci_plat_probe(struct platform_device *pdev) } xhci = hcd_to_xhci(hcd); + priv = hcd_to_xhci_priv(hcd); priv_match = of_device_get_match_data(&pdev->dev); if (priv_match) { struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); @@ -251,7 +253,7 @@ static int xhci_plat_probe(struct platform_device *pdev) device_wakeup_enable(hcd->self.controller); - xhci->clk = clk; + priv->clk = clk; xhci->main_hcd = hcd; xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev, dev_name(&pdev->dev), hcd); @@ -331,7 +333,8 @@ static int xhci_plat_remove(struct platform_device *dev) { struct usb_hcd *hcd = platform_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); - struct clk *clk = xhci->clk; + struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); + struct clk *clk = priv->clk; xhci->xhc_state |= XHCI_STATE_REMOVING; @@ -355,6 +358,7 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); + struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); int ret; /* @@ -367,8 +371,8 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) */ ret = xhci_suspend(xhci, device_may_wakeup(dev)); - if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk)) - clk_disable_unprepare(xhci->clk); + if (!device_may_wakeup(dev) && !IS_ERR(priv->clk)) + clk_disable_unprepare(priv->clk); return ret; } @@ -377,10 +381,11 @@ static int __maybe_unused xhci_plat_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); + struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); int ret; - if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk)) - clk_prepare_enable(xhci->clk); + if (!device_may_wakeup(dev) && !IS_ERR(priv->clk)) + clk_prepare_enable(priv->clk); ret = xhci_priv_resume_quirk(hcd); if (ret) diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h index ae29f22..4d6f048 100644 --- a/drivers/usb/host/xhci-plat.h +++ b/drivers/usb/host/xhci-plat.h @@ -12,6 +12,8 @@ struct xhci_plat_priv { const char *firmware_name; + /* optional clock */ + struct clk *clk; void (*plat_start)(struct usb_hcd *); int (*init_quirk)(struct usb_hcd *); int (*resume_quirk)(struct usb_hcd *); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 99a014a..55c3441 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1724,8 +1724,6 @@ struct xhci_hcd { int page_shift; /* msi-x vectors */ int msix_count; - /* optional clock */ - struct clk *clk; /* data structures */ struct xhci_device_context_array *dcbaa; struct xhci_ring *cmd_ring; -- 1.9.1 From 1584656180196965091@xxx Tue Nov 21 06:31:39 +0000 2017 X-GM-THRID: 1584656180196965091 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread