From patchwork Thu Mar 3 10:09:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 8490841 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7B4089F314 for ; Thu, 3 Mar 2016 10:09:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42A61202AE for ; Thu, 3 Mar 2016 10:09:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D4B620225 for ; Thu, 3 Mar 2016 10:09:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756615AbcCCKJc (ORCPT ); Thu, 3 Mar 2016 05:09:32 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:28067 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751256AbcCCKJ1 (ORCPT ); Thu, 3 Mar 2016 05:09:27 -0500 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 03 Mar 2016 19:09:26 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 1F75B614DD; Thu, 3 Mar 2016 19:09:26 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 199051806F; Thu, 3 Mar 2016 19:09:25 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id D22CE1800A; Thu, 3 Mar 2016 19:09:25 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id VAB24940; Thu, 3 Mar 2016 19:09:25 +0900 X-IronPort-AV: E=Sophos;i="5.22,532,1449500400"; d="scan'";a="205640771" Received: from mail-pu1apc01lp0023.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.23]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 03 Mar 2016 19:09:24 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesasgroup-onmicrosoft-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MOKqmTBMyfQpdOHtSxSTyTL4ZYvHmVVI4izq3zIL/TQ=; b=XdJXUMhILtHoG4yKVUCalwO4TAhAUtP1qjPU7r96nrAmMV5ZaZlEup22NrnGdtgqcI+d0IblIRFbb1Le7XX5BtSHjx1gUm+rrxxp0iZ0iWRMO5hE7z9gaUKtKT9vNRnEmOawwMt0Ty4vEXSX1aluGhE/oINb00AVZztUqM59+So= Authentication-Results: ti.com; dkim=none (message not signed) header.d=none; ti.com; dmarc=none action=none header.from=renesas.com; Received: from localhost (211.11.155.144) by TY1PR06MB0927.apcprd06.prod.outlook.com (10.164.99.153) with Microsoft SMTP Server (TLS) id 15.1.415.20; Thu, 3 Mar 2016 10:09:22 +0000 From: Yoshihiro Shimoda To: , , , , , CC: , , , Yoshihiro Shimoda Subject: [PATCH 1/3] phy: rcar-gen3-usb2: remove unnecesary struct rcar_gen3_data Date: Thu, 3 Mar 2016 19:09:04 +0900 Message-ID: <1456999746-2800-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1456999746-2800-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1456999746-2800-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0035.jpnprd01.prod.outlook.com (25.165.48.145) To TY1PR06MB0927.apcprd06.prod.outlook.com (25.164.99.153) X-Microsoft-Exchange-Diagnostics: 1; TY1PR06MB0927; 2:c4HaLPWSCsauxAqev3tL5GmB7/CX8YJzE41qXN3OfT7IMglc2XmFC8dBrUpGV2fl9w85ZtmFDwllIK5kmw5b2M4Q1qqhSJrqdInva0UbGbtyn7odvZuSXa0APtjASu5XG3TL1Om9SfspOkWCniFQUQ==; 3:S73ErhwMxTD3dEIimcz7mUErK6uLbBbi8kHDgBWZShJq7Lv8LMBzmJq4tjmNWeQgwX5SywRn/I07ltHTzjko9UjEaAzrx3ARAM4jekw+eLJgafH3MP70AQu2wjxzgktl; 25:a1PJ5rrF6NO9iY9jzAKqy6kejA3vSZFgf9XmLKsawWU5g3HcfXKUEmpovaO/ocg2b3b7gXlt8bt9GgIkKpPm4AZ8t4fA+yN5kM4I6WN8FapFa4GPSANCokMQyeoKzm1LnvuVdsJonOOshZ5t3C8PzAyDdIXcvdYupYnbZXMti3VDsm7MP3uiU0sOtNnkhXeXNs36Q+OY3pAey1WWTBSp4ggnWEd79J0eIn8XH37KhsNoXTk1/Mv/wXu/8+kgBPHBItSa2Y1NFemuZxIDDNiv7lUefOt6wcYjPDoLNisxNH8c0Nfqq/4aGuxwxj4K8jZT/SMEaUNl7+y5sUJBSmm/8g== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:TY1PR06MB0927; X-MS-Office365-Filtering-Correlation-Id: 4b927e26-1ea0-457b-9d51-08d3434be4cd X-Microsoft-Exchange-Diagnostics: 1; TY1PR06MB0927; 20:Mlwap61jpuO8bRl/e0Y27/v1FkBOIXxL8csQDi1iazh+KBH+IM8I+Qmqrlmz2bP4hSaeAz1CRE2EfaoMlYiQyyMjpywJDY48ux7v61AD2rkzxpLqeRfXLXO8fckuX5WuwcQlY7hUy5K2KA9JeBgTklzXpaBVaALYxn59zIx1L0AqGGJ2Ia7YXumfjPi5bCcfeSFFtj3l4K93ZlU3D8e0Z6uBIcXtyJK9CBOjuhEB6D7fm3mLPWqwAFFbEKgta7/CLRAXufgplTKnU8Ew48hAbTF2DIfeS1V8+QKaZPmoecKyu9kGDh014ffWjODFwvt4dAkNanjZ1ehHLlMXTR2jJ8bfocETRQ+52IbLwCSG1mKu5R3T7q+t27R41RTmOq1iv6eoqaGlAjgDwatsC75Q2FZQbKnvdjLEf/I/Wm9YGhrTKYhiOAo9jHHNs0dwsY0qfxW3ONX1wVJkewW1AW8GyudpG9K6GEv3riYgjQr0jACLCgfiDtYPxdD4tC7q1Vff; 4:E8ff9Z4RbEzc2LXCVY/KyJgCO5ae+eX9pVOIQ9Zb1HmXSFGWhVKPTWXFPxo9WIMhwE9W3IroPlPw3s9mLw+CJErtVuAd3TUM4zBs5IPHKUl/qwcaYMvSBDpnoEeBQuvqqD49ExEzHD8+jXMjd+7LE3M9ROBPYA4tCHHl6+7K3wgKFUW4AG5iK0fzI3KYIcyWAU/PJ1RManlvgFaR8kAkY2c4krCZps/0mK0siZofem7aheNjmHNAXdBdVKvt9AgCZK/94Xc7V/9h9HbaM5uf19FkcLTL8KFjS1MYmTO+keVgTDV+aYlQLvNcq82sj4wqQrtjOCw5x0JTv5YLRXnjwXQVicZ1c2ZA/26wf6Y4vhLBkoYxRlJ9gUd/Mgv9+F8b X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:TY1PR06MB0927; BCL:0; PCL:0; RULEID:; SRVR:TY1PR06MB0927; X-Forefront-PRVS: 0870212862 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(40100003)(5003940100001)(87976001)(50986999)(42382002)(76176999)(2950100001)(36756003)(50226001)(47776003)(66066001)(77096005)(33646002)(229853001)(5004730100002)(42186005)(230783001)(122386002)(5001960100004)(76506005)(4001430100002)(6116002)(5008740100001)(48376002)(2906002)(78352003)(50466002)(19580405001)(4326007)(3846002)(107886002)(189998001)(92566002)(1096002)(5001770100001)(19580395003)(586003); DIR:OUT; SFP:1102; SCL:1; SRVR:TY1PR06MB0927; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; TY1PR06MB0927; 23:hkuuloLKWFd8MxopP43C7EAn7GuyEvg+y4z/NKJwa?= =?us-ascii?Q?IBnj8zwaVg6666pShXgQcEzl/NsvJK9fxcLjvdNHxq5aNR7C/ZI3NCA6zmsw?= =?us-ascii?Q?m+O3/aota0Wivzn+9jFsYF9rrLiSV0iURLdGjtFZS9g3h80aTIKPKQkD9AQI?= =?us-ascii?Q?ysdxNKu4YSRNGOsWLrkBaeIlnumFJzc2Uj1PR9SuQ/LWWhigY0TwufOGm69/?= =?us-ascii?Q?ufkK53NUZ8ezhInXqvpEop/l+/tpWJTZQmZyMYHqcIX3kzmjONG4bCXZfRgn?= =?us-ascii?Q?3NVW2eFCZTXLyXSHY8Xbh/TKj0Uoe9yceTyq2RqSk65nfPBn5DR9fR9u0vAE?= =?us-ascii?Q?jnJTd7XK4CEcfNdd4QfZuwCdV2tjQwoneto3blZ768qtFFJ7faaD+zzZTIH7?= =?us-ascii?Q?XBE/s9+ZOrJeCrWAof4DXf/lo94ARycL7owu2ITSjB2x//Xsvu2kKxsP74zW?= =?us-ascii?Q?mLnT3IQUfZ1ZTP1hCyGhLMnSUMLBHqJewBrX8PQ5mgoTBH66r+lIdrkLaY7m?= =?us-ascii?Q?K2cjLYJq/k798KTzJf+TFzUTPzB1sYA45EDsHLzTCSmiAhdtLg3kK7Z5dxlS?= =?us-ascii?Q?wKFWYTrd7RjSshTGNkNR9u31nWX2p70Z/zmgaCMpBuqwzmBhCgDEEq/GXbNd?= =?us-ascii?Q?WO0JiknJ9yeDvydn7BbSgjorebdDEjFrFi6pHLCwzdoTrcMV1+y3dccE/N84?= =?us-ascii?Q?NRMaVHnDXP30iIGE5IoHpnkHPjbh/yKscjJh1GDavXlz8d5ZaPBee87Lskzk?= =?us-ascii?Q?W1JhUVhN/T0BFaVK0ccC0tQezzgxpNQIqH2vKWKjHbj74LlyqsdZklb5t83i?= =?us-ascii?Q?TINLyicR1ypial9FqwPrHa9zhry7JaVaU0fvwC8sbCLi4nms+nyYbPJ6z3ht?= =?us-ascii?Q?a6dB5mJBH4/ie70myx6S39N8w6GtuHUks/Q/lyVL+d4icPQ+13fifC2dEWYI?= =?us-ascii?Q?Q7ZPzNk3oW+SXmTVf9EwqFoY7ufeunEej6SDx0zXX97m3w+S9tovKATrlkbo?= =?us-ascii?Q?k2HCdbT6jt3ezgRUrbYPOS9Ydmi8K8l/AXIhZH2gdLqygfscJeZpyYsKGSrH?= =?us-ascii?Q?mn3O+2XcV1k7Nsr+s75EAXELhKGBWkwoo3hXpHsTmDNHL5RgQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; TY1PR06MB0927; 5:9vWZ6NOLzZCFFGg92jDc7JYptKlGI9T5qCrSQiGFVQkggp+MjglIgB1B7t6k9fV/QvvrYyi7AdIzaPLU9oZR5P9/p6VE5UFPh8ng3BedF1+Ie3phqlwdshnPfnWqcRRh8S0m6zUpGaaG6HfnzMx1+g==; 24:9SBKCZpTR0+ClZBJtX1CjYlQQHYGN1nyrNPq9T6+WZT90dIlCz95vSMT6IRwCLiBrd8aPGb4tW2xZkUg7k0/w5jA01eRQ5KlTEgIXAcmz/4=; 20:UZUKiM3uqDmytYp70z9kdRpYRtIb3HDB34PkF4aiQetaT6VJphFoSjQaVjvUMPxSVsVdpmtOe4YVu+idlt8YwC1BGz/KjYnrbyrQtCYqebBFnw760pW3aKLW7wz3o6TXdwccfG8zGS8wWbtEtaIjS2g/Yq1U+oqY2gEnSVB6CNU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2016 10:09:22.7316 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR06MB0927 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since this driver uses the struct rcar_gen3_data in struct rcar_gen3_chan only, we can remove the rcar_gen3_data. Signed-off-by: Yoshihiro Shimoda --- drivers/phy/phy-rcar-gen3-usb2.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/phy/phy-rcar-gen3-usb2.c b/drivers/phy/phy-rcar-gen3-usb2.c index 257be74..3c647cd 100644 --- a/drivers/phy/phy-rcar-gen3-usb2.c +++ b/drivers/phy/phy-rcar-gen3-usb2.c @@ -74,20 +74,15 @@ #define USB2_ADPCTRL_IDPULLUP BIT(5) /* 1 = ID sampling is enabled */ #define USB2_ADPCTRL_DRVVBUS BIT(4) -struct rcar_gen3_data { - void __iomem *base; - struct clk *clk; -}; - struct rcar_gen3_chan { - struct rcar_gen3_data usb2; + void __iomem *base; struct phy *phy; bool has_otg; }; static void rcar_gen3_set_host_mode(struct rcar_gen3_chan *ch, int host) { - void __iomem *usb2_base = ch->usb2.base; + void __iomem *usb2_base = ch->base; u32 val = readl(usb2_base + USB2_COMMCTRL); dev_vdbg(&ch->phy->dev, "%s: %08x, %d\n", __func__, val, host); @@ -100,7 +95,7 @@ static void rcar_gen3_set_host_mode(struct rcar_gen3_chan *ch, int host) static void rcar_gen3_set_linectrl(struct rcar_gen3_chan *ch, int dp, int dm) { - void __iomem *usb2_base = ch->usb2.base; + void __iomem *usb2_base = ch->base; u32 val = readl(usb2_base + USB2_LINECTRL1); dev_vdbg(&ch->phy->dev, "%s: %08x, %d, %d\n", __func__, val, dp, dm); @@ -114,7 +109,7 @@ static void rcar_gen3_set_linectrl(struct rcar_gen3_chan *ch, int dp, int dm) static void rcar_gen3_enable_vbus_ctrl(struct rcar_gen3_chan *ch, int vbus) { - void __iomem *usb2_base = ch->usb2.base; + void __iomem *usb2_base = ch->base; u32 val = readl(usb2_base + USB2_ADPCTRL); dev_vdbg(&ch->phy->dev, "%s: %08x, %d\n", __func__, val, vbus); @@ -141,13 +136,13 @@ static void rcar_gen3_init_for_peri(struct rcar_gen3_chan *ch) static bool rcar_gen3_check_vbus(struct rcar_gen3_chan *ch) { - return !!(readl(ch->usb2.base + USB2_ADPCTRL) & + return !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_OTGSESSVLD); } static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch) { - return !!(readl(ch->usb2.base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG); + return !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG); } static void rcar_gen3_device_recognition(struct rcar_gen3_chan *ch) @@ -166,7 +161,7 @@ static void rcar_gen3_device_recognition(struct rcar_gen3_chan *ch) static void rcar_gen3_init_otg(struct rcar_gen3_chan *ch) { - void __iomem *usb2_base = ch->usb2.base; + void __iomem *usb2_base = ch->base; u32 val; val = readl(usb2_base + USB2_VBCTRL); @@ -187,7 +182,7 @@ static void rcar_gen3_init_otg(struct rcar_gen3_chan *ch) static int rcar_gen3_phy_usb2_init(struct phy *p) { struct rcar_gen3_chan *channel = phy_get_drvdata(p); - void __iomem *usb2_base = channel->usb2.base; + void __iomem *usb2_base = channel->base; /* Initialize USB2 part */ writel(USB2_INT_ENABLE_INIT, usb2_base + USB2_INT_ENABLE); @@ -205,7 +200,7 @@ static int rcar_gen3_phy_usb2_exit(struct phy *p) { struct rcar_gen3_chan *channel = phy_get_drvdata(p); - writel(0, channel->usb2.base + USB2_INT_ENABLE); + writel(0, channel->base + USB2_INT_ENABLE); return 0; } @@ -213,7 +208,7 @@ static int rcar_gen3_phy_usb2_exit(struct phy *p) static int rcar_gen3_phy_usb2_power_on(struct phy *p) { struct rcar_gen3_chan *channel = phy_get_drvdata(p); - void __iomem *usb2_base = channel->usb2.base; + void __iomem *usb2_base = channel->base; u32 val; val = readl(usb2_base + USB2_USBCTR); @@ -235,7 +230,7 @@ static struct phy_ops rcar_gen3_phy_usb2_ops = { static irqreturn_t rcar_gen3_phy_usb2_irq(int irq, void *_ch) { struct rcar_gen3_chan *ch = _ch; - void __iomem *usb2_base = ch->usb2.base; + void __iomem *usb2_base = ch->base; u32 status = readl(usb2_base + USB2_OBINTSTA); irqreturn_t ret = IRQ_NONE; @@ -274,9 +269,9 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - channel->usb2.base = devm_ioremap_resource(dev, res); - if (IS_ERR(channel->usb2.base)) - return PTR_ERR(channel->usb2.base); + channel->base = devm_ioremap_resource(dev, res); + if (IS_ERR(channel->base)) + return PTR_ERR(channel->base); /* call request_irq for OTG */ irq = platform_get_irq(pdev, 0);