From patchwork Mon Aug 8 08:52:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 9267119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F09E6075A for ; Mon, 8 Aug 2016 09:02:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EFC727FA9 for ; Mon, 8 Aug 2016 09:02:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20EC428169; Mon, 8 Aug 2016 09:02:45 +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=-6.9 required=2.0 tests=BAYES_00,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 75FCF27FA9 for ; Mon, 8 Aug 2016 09:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752247AbcHHJC0 (ORCPT ); Mon, 8 Aug 2016 05:02:26 -0400 Received: from mail-bn3nam01on0062.outbound.protection.outlook.com ([104.47.33.62]:43713 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752117AbcHHJCG (ORCPT ); Mon, 8 Aug 2016 05:02:06 -0400 Received: from DM2PR03CA0007.namprd03.prod.outlook.com (10.141.96.17) by BY2PR0301MB0696.namprd03.prod.outlook.com (10.160.63.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Mon, 8 Aug 2016 09:02:02 +0000 Received: from BL2FFO11OLC012.protection.gbl (2a01:111:f400:7c09::104) by DM2PR03CA0007.outlook.office365.com (2a01:111:e400:2428::17) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15 via Frontend Transport; Mon, 8 Aug 2016 09:02:02 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC012.mail.protection.outlook.com (10.173.160.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.557.8 via Frontend Transport; Mon, 8 Aug 2016 09:02:02 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7891D1u013331; Mon, 8 Aug 2016 02:01:55 -0700 From: Peter Chen To: , , , , , , , , CC: , , , , , , , , , , , , , , , , , , Peter Chen Subject: [PATCH v5 5/6] usb: chipidea: let chipidea core device of_node equal's glue layer device of_node Date: Mon, 8 Aug 2016 16:52:10 +0800 Message-ID: <1470646331-23227-6-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470646331-23227-1-git-send-email-peter.chen@nxp.com> References: <1470646331-23227-1-git-send-email-peter.chen@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131151205231205738; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(50986999)(5003940100001)(104016004)(2906002)(2201001)(50226002)(4326007)(11100500001)(76176999)(2950100001)(50466002)(19580405001)(68736007)(2171001)(87936001)(48376002)(85426001)(86362001)(19580395003)(36756003)(189998001)(92566002)(77096005)(47776003)(7416002)(356003)(5001770100001)(107886002)(105606002)(33646002)(8676002)(7846002)(8666005)(8936002)(81156014)(586003)(97736004)(81166006)(4001430100002)(229853001)(106466001)(305945005)(7059030)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0696; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC012; 1:SOv9zR2fD8W0Np32g3KJBes5dv1fuOi3HhMKPB7jSWBGob4XvIQG7Qor/f4k1cAK26Y99VskOgo0iL+Ld/0U5vJ4GBc09aJimAM6Aj+Rlpoqs4IfGxkclbsFbdYnvj76KSJ9KOBqaPZ7WuBt3OEg+2FrbIhGrIRGfkFRA0JK6A9EH+8aNtkrlFwURSoS7KvO4S4ow8c7B29Ql+snpD9sZvGNF1vZAu+DyZ53D+ncpqJv6Kkirrq+U6DeVHEbnMOvnHAXknDEMYBimg1BeOHAeiMI9+NgIIbfS8n7Lfe9XImcPobsxXHuOXUKJiCLhsmALtEABWf4uX7693ZvONs9lINjTPT82kYetyLv83ia/V792cv/k/0kV3fmE3ENMbtWkiaqGzmdfEGjB2EpBDh+KyPIDo0uom2UZhyW+ZRzCEjFjSqMWlmmwwenm44+6Fo6RzhF0IeUw1cpavinWKDztDsECZsIBrXeNoee+6ViwfzNQwgStBn4u43rzsSxbo9/UtZbXowRGuj5d4dwAWBQH3OumYWdmh58N00Ddv8hzaNj2vNFf7M9sKaKx8v5F111naswT1kotOFBAbGCfTCgWueAsavcveNn8GNf+o5VbiR80YsYVAfIN04avvNvZag8goLOQoKAV++4f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Grh3POQ= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0696; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0696; 31:i2wMocsjU9Z2ZhFgKo6cJFt381q18hA2B1XKAW2ppjuby6/yyL/5F5xvIQAfQTBh65kA+WXLesUoz/BQMjTwBSYs/oTJcv1Sx1769ac0cWj0pYTVuPzo8r3jxd7uiOckk6hGSk42kJZJ+YKAfiSjhLJCHxzpPoZmxSyQVp3BJRl1F3/6uSKDXB5W5dGtkQ9U5cprXIoBansEzI8Iv0c0MDweNVVSx10k3HJX20TWca4=; 4:DT4SWtXNAz1L6zhRxNyAVK3wTgi6QrycuUKx+wYGO5/IO7VyI7AIg9VwAMz70O7MxoA5sJTsDuHGTQsdtup7xG4cjYA1Q9QbSq9E+Axukj8FqIIYf5T7veVBLPidi9V0BReUYoF7sjd/jMDbHQlwqt4S42PX8wH3uUyJSB48m77lChdO8lJYwIwJ23EatB5UIV1R7/T/CSwJhz4ux8akfUvfKv6sT0WRlGbn7S8aCyVQQsb6xxafpFMz2mzZr+6ITZrl86dVOcOjhSKj91qgfQuOUydq6md/4g2w+ad8VswWJ6m2cgEZ7Nz/BvQnoTqYchA8pxNBACDD5puLd/X8EnNhoLKIh2XvTgkO7GsWP0Y2OhZ6VtPd4g2t4N+SyyhyG1o6qnh/250yFkczIn0ItormMk/Z+NKH9RAYMsFv0n/9RTQtJDotqaV+/BghAuL10ujcX3GAMpHtWJo5UAmK6CDaNBj8+WtLiesEm4SPi4AnDfdy9MF4naG27pUUuTP/7mk88AlCuueDx8XqwAavZw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(8121501046)(13024025)(13023025)(13015025)(13017025)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB0696; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0696; X-Forefront-PRVS: 00286C0CA6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0696; 23:nwqoErSfmf7wcDJeTa00Vvj4W81PKNpyvAAGaTp?= =?us-ascii?Q?llWd10UG5rNIrv0T684x5De/lDD9W7qoPVE25kkjnZHuszOHZ6v50q9Ip177?= =?us-ascii?Q?cNqSNKd2YgXW10FSEPLotxnJrUqm5STFtg4LCAw0dkMekL2tt5ayU+L8yGJz?= =?us-ascii?Q?g111U2Xhr3xX27581j3vW9cl+khgw0NB0qD1PDOhTXoOdd0eBtJ4zoD284jP?= =?us-ascii?Q?NZctoBbLCuQwpXayPQRuo7oSUNjZ8KcdUBYi6rl9eV2Xjp/ZYxymnl1XwXcQ?= =?us-ascii?Q?z9N4vGe+/o49kvg0QADZVAX/ww+RgakqFCxnuB/57AwAn0fT5LTqw+qSbIPp?= =?us-ascii?Q?IjPTCrcuiejStcvyZxOr2XikrkESE8bGDNX/JdpPOcRZQErfkuAsEEa4AgCF?= =?us-ascii?Q?xOqyqp4Iv8nDxps0pk33QObLpFvUEP/AaVHUITgOwYINEAkJXKI1E0XuajS2?= =?us-ascii?Q?bnFae00sK4jlxRa91Da+G77Gm9IVXMHIUOGzjpUZus5HGuOW7QTx5L+M5TYF?= =?us-ascii?Q?e8DYzjp45P2wNMt+waVRBUotqqzsQ2gVdfNJLwzSUYdOeEYJnlyHkbgl6COv?= =?us-ascii?Q?M7sg9I7t6YQUxLHAsObYRy/st32M4MOujF4XidRskk//sDdaODx8VrLCGYuV?= =?us-ascii?Q?2hZXHmqZabg5GnOEQKCHPZRCvvN2BZwWpvA5kSJiAA7e9SxOARG9mpJG/t4Y?= =?us-ascii?Q?brP0yGvDT9hXu2hrPG8PrYQz6DPcuek96UWZNAwKskekLqMK4x6x/2QEpFsF?= =?us-ascii?Q?E/pHFe+X8+OTYkpbPDNgYspx+x5GZNVHAUUc9sYDT/bJhrs0W9Ngi8XygD9q?= =?us-ascii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KEgPG/l5RJqNp7kR4/ktCvoJFYnE6sFXjpgfkaoxBp6gTDVWAAmvhkuTsFiPTMTP2QyzxBqEpW1Q3Ga6wOtZbBIoSDQ=; 7:uvIQlQ06bYIr1QrXNWmcF8eyTw8O9GNCxH1gG0Z9cNI2DtFHdyKEdQ/ZD4wXCBFY9YfmHvP0JfNnyN8fOeGdcPXqhJep6+bVnmyeiEoOLb0HOaxNdLN8cfWrO8bhQvoelANN+q98exzzS6aIHoaoUy28Cftl4hzcek/+S6sDZ0P9X56mVPjVzsCg+O1sKqBC5e1GNKAKCCi1GBXJkEGCqx3TDlEs7O7o0R4bhOWPXdr0FdsCH3ax1uFkbniyabbU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2016 09:02:02.8241 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0696 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Chen At device tree, we have no device node for chipidea core, the glue layer's node is the parent node for host and udc device. But in related driver, the parent device is chipidea core. So, in order to let the common driver get parent's node, we let the core's device node equals glue layer device node. Signed-off-by: Peter Chen Tested-by: Maciej S. Szmigiero Tested-by Joshua Clayton --- drivers/usb/chipidea/core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 69426e6..b189dc7 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -954,6 +954,15 @@ static int ci_hdrc_probe(struct platform_device *pdev) dev_err(dev, "unable to init phy: %d\n", ret); return ret; } + /* + * At device tree, we have no device node for chipidea core, + * the glue layer's node is the parent node for host and udc + * device. But in related driver, the parent device is chipidea + * core. So, in order to let the common driver get parent's node, + * we let the core's device node equals glue layer's node. + */ + if (dev->parent && dev->parent->of_node) + dev->of_node = dev->parent->of_node; ci->hw_bank.phys = res->start; @@ -1057,6 +1066,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) stop: ci_role_destroy(ci); deinit_phy: + dev->of_node = NULL; ci_usb_phy_exit(ci); return ret; @@ -1076,6 +1086,7 @@ static int ci_hdrc_remove(struct platform_device *pdev) ci_extcon_unregister(ci); ci_role_destroy(ci); ci_hdrc_enter_lpm(ci, true); + ci->dev->of_node = NULL; ci_usb_phy_exit(ci); return 0;