From patchwork Mon Feb 22 09:58:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 8374461 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 D4E9D9F372 for ; Mon, 22 Feb 2016 09:58:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E4F220382 for ; Mon, 22 Feb 2016 09:58:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3153F2037C for ; Mon, 22 Feb 2016 09:58:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753064AbcBVJ61 (ORCPT ); Mon, 22 Feb 2016 04:58:27 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:14408 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752737AbcBVJ6Z (ORCPT ); Mon, 22 Feb 2016 04:58:25 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie1.idc.renesas.com with ESMTP; 22 Feb 2016 18:58:23 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 6EF15421E0; Mon, 22 Feb 2016 18:58:23 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 50465480A4; Mon, 22 Feb 2016 18:58:23 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 46DCA480A3; Mon, 22 Feb 2016 18:58:23 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id UAH10627; Mon, 22 Feb 2016 18:58:23 +0900 X-IronPort-AV: E=Sophos;i="5.22,483,1449500400"; d="scan'";a="204877964" Received: from mail-pu1apc01lp0017.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.17]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 22 Feb 2016 18:58:21 +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=a9leMlLlE4pSB21bLVQEovX7oqrFaZZDTaEe0aCTyvc=; b=Ez8JVl+HvsvxOO2GUaTLJRmAELKwutaVtVHLfmWtnNi75AU+CzGvq8AnKRdcTDOdxLqsklK/YvcZIto55E3qH0VBhjW7UTdNdWd8PZH8So98ZKE2zKA/widP57i/y53MpSsmhaPGlyjfQ9jhBVH3a8GxCeFxx63Sx4XnbwN38uk= Authentication-Results: verge.net.au; dkim=none (message not signed) header.d=none; verge.net.au; dmarc=none action=none header.from=renesas.com; Received: from localhost (211.11.155.141) by SG2PR06MB0920.apcprd06.prod.outlook.com (10.162.204.153) with Microsoft SMTP Server (TLS) id 15.1.409.15; Mon, 22 Feb 2016 09:58:20 +0000 From: Yoshihiro Shimoda To: , , , , , , CC: , , Yoshihiro Shimoda Subject: [PATCH/RFC v2 1/9] phy: rcar-gen3-usb2: remove unnecesary struct rcar_gen3_data Date: Mon, 22 Feb 2016 18:58:00 +0900 Message-ID: <1456135088-7976-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1456135088-7976-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1456135088-7976-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.141] X-ClientProxiedBy: TY1PR06CA0006.apcprd06.prod.outlook.com (25.164.91.16) To SG2PR06MB0920.apcprd06.prod.outlook.com (25.162.204.153) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0920; 2:+0+jVV/QfIwzajl/32pw7/iPzsOwrUrx8zl+F8el5G54RR/1BlXPLs6b7XEWMvkKkIjq8FrArP74zR5BNrVuy+husqXvlP/HF9rZm4oggLUGtJSEE6Nl9/mje7vijmL/08l2h9YGmMTp7pyKF4ljjg==; 3:clcEVubvs6J7NRidzTnX962kJ0zWBHkoqFt2p5O55ds1+1mKCZsFwclGItZDWBN4YS36Ci7cChLDcFBqexV58h4WSy/1q1LXJCHSuFLq2m8FNFzz6LTulzIyWVYrTpm3; 25:PsVZ/O15uJJxv7ssX8+EnEFlPRt4S/d5AxWBuLBB+/YQXLdUymZFfwzl9sVepl3AAnQTmOArfnFu8eTAPlRYdjLLW8UWCfafTGUhPMtTaRqQ/jJWdCr7SItJBP4HOy9nWfndJ8AlzhKynyct4IvrO+sZVgpnAS8hiBhIe7jtC89Qu8fwlWXTzQkJVchJdjBVEZsglJvvc7vrXorbQytMhtvS2Ri/HcwPPEHwnV+Bp/eViIZrS5nWxe0rjjSUYSDXTUNtPIEuUL0g8TQDGD0OHKb8BsBmSTOb9z+SjLLbgp0j4fwqfylAOO+RiUK2WEFlZi4jqUn/Ad4o5WBYCr+S+YzKrAXbdHBIyZAImXyvcQM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0920; X-MS-Office365-Filtering-Correlation-Id: 1a648a75-1e02-4ff1-b2b2-08d33b6eb1ef X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0920; 20:gqiyPJy7a8wgVETBKWz4TUJKyXDhNBi4bqGmaiqxMX/L7BTTbz6GOQ69hhENRF/f+13SRGXpZUZvQ8FPR3/IUv1xrpuXIyOmzJFGFY97JDkot2NVOUk4Jf3YJZGK033IpREbr0qWKcWk2yAugALRde8LWOkRw1ucBxu7dl9ZO31Iur4tKX2GhXbgTCNhA94HeN2TiiyY1tgY8VGvRk4HP6CNTGSFk9AW6D1hV2VltPRBIpcHx7SgDQThLDywT66WS3MtT1FH11Ypilx3mQ/f+BLnmNpApLXDMk+kG4MN9bbjm5MzpuLquJUbVEkB6LiTsTJouTyx0XeBYB9gsiZnF2PNvOvYvmAEXf4Q+DIhPNZiLQfxzZPhuCbyP4H5hjVPub2GU1GNMi4XYT7WYaKToirvL5cKO/GaWUaNUF4+jfKAC/oNy2sBr1n1yhb2gmEkCUZy5GfZY5EavEhC3bN/nAS0UhAFClx5ROrJdauXQeJ7uMAhlX3BR1cBlehKwTsd; 4:aVLM+iLicwYQDFLjAnWBh6Vm+8NJ+yxdyEejnM2qz1EtkuLkyG5NrkEvhV9AU+21AKIswSI2MtdE0ZaiD8urjoCj215Dpi3SiJZcsmnacRa6Fr5TmCAMqkrSWSvgPwysiIQN2G2VQCgb3ok9mNryW3vMjVp9T8WK79JMfcXSpO2xwTiccRcetF2kxWeIcSWyjElOSFHsYafINiIzgVPB+vpy2NEu4wcQGSnUvCue8QXikqAA2owI+H0JbziHzm+kTsc0GZgF7EV8PjkH3B+h/Y7/1IwS75eCXu1mAwgwzx8aeMkH6TT2Tb9GxGfPXoeP+I/5Pduis+rP1tSiZiwEK+TcOsFTHzCnJndxscizNUg2Gwz742szYCOaN5wti6QT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:SG2PR06MB0920; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0920; X-Forefront-PRVS: 0860FE717F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(5001770100001)(33646002)(107886002)(76176999)(5001960100002)(50986999)(2950100001)(77096005)(42382002)(36756003)(50466002)(229853001)(50226001)(230783001)(87976001)(5004730100002)(2906002)(4326007)(76506005)(92566002)(5008740100001)(586003)(48376002)(6116002)(3846002)(1096002)(78352003)(42186005)(66066001)(47776003)(4001430100002)(40100003)(189998001)(19580405001)(122386002)(19580395003); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0920; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB0920; 23:Eu4N6g4G8BNxbopSUWppLhLVs0+48h71k+q0ViCQd?= =?us-ascii?Q?PyngyhSW0ZhmBEJ+dTGC96hLJsWxo3p7K8Xu1T+Yx2kUmhDBTHh4345DLodK?= =?us-ascii?Q?A7X9tWG6PAz+re4xp4ZuP+KSfy0Zzxz5qoOjY3RKJCoT9kFHpwDwjLeYuE57?= =?us-ascii?Q?L01C/do7+HLm9CzjfSvtTO5aWfLz1xk9ZZPk93SzQI7LHBe62oYXF7bYuFJX?= =?us-ascii?Q?zZoF1Fj/DJ1jkNGxB3jnRQjP5ntn8/mXmkS4CDqRDh5e+Zs/Hyj7NI9v9vGq?= =?us-ascii?Q?DURz4wqCIcdhMBFn1RlODsX/2KBuYuGr4u+wuGm24U5mqUd7N0bPziI+EymO?= =?us-ascii?Q?D/6afYZVVnQOkkPI7b+zgxe098Jk5PXDTTeOUyLg2iVuSh9+D+zU4Mpa7lB7?= =?us-ascii?Q?gz+Mef5fO0KWH+7tPx1nHIpYsAIZDFE/o1qa9xef9199Hdx/ijtvX9+zefup?= =?us-ascii?Q?ZEmJwcX7EcMFT3M6F1ttOPGcDo5G4J6YPx6ie2dNRtunf1m3j0yLjyKGZ3Iz?= =?us-ascii?Q?q9K8gnqR+Yxm0RJX4SmcGnZ0EQHhz376a3nBJYpPb2LlaeixbmkUMb4E2xn/?= =?us-ascii?Q?W2+P7mckNUMi5ER1VBNFTZqgajkcxDUp/yfzbc0V8ntTIT2qEM+wmGWMq6I/?= =?us-ascii?Q?FY5W/CTawygDPBp0jpiXivJpsmVjxOrqRcLKC/JdlnvNE00xnFwm/FONpHK7?= =?us-ascii?Q?/jzP2VcIG/S6rkAvtyPgYDa+9gaBgNQ9QBCy73gcq96QUEk/57lqSasihOZH?= =?us-ascii?Q?IaCK/m3gTseX/CL+OdNlwewoKIp+DftHwMywSM+AG+AHgxVKR5JN0ApxPhEU?= =?us-ascii?Q?p/h/w6WM2BOffdjaH9chKKV++VuwYGsLIh2YikasXGDeWeOoXOrLGrL/Qbf9?= =?us-ascii?Q?wEgXa74mH5nIz5GAuUgZuyqHcXWh6kMQNqZUH7MF9DHa1IEPRFu7maiMC1V5?= =?us-ascii?Q?tn3Ie+vlIlquo4ONqLsqCVZ2lU+8DTtfE/LKOBn20r4V9ASk6nT6F2gAboGv?= =?us-ascii?Q?m96pyS85oe/n0tNPOEefpY+zUNSB8m3qIqOgeentN8iHexRF+c2QQ5E0+P69?= =?us-ascii?Q?H2EkHU=3D?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0920; 5:40CEV+zYWpw8WEA3gf/Ryegir8FLhnEWKDW3SNAOnWFylQrmDRXvWUAxfjVg4CU7SxIiqx5kMsMpCqXvQ4bjAg0yUlU0oJ2IfriYXQjDtSWaZyzP2Q2C034DXWUa9my8mvQ6e3j3PMttT7JlgvIWWQ==; 24:MXC08GpBZE6t8g887wh3hMgt+DZe/qw8TS603TrzWdMvz3DtzIm8C7kbzNnZHHYz3bQIhYYWnviHdcH7dtjzhqK9VGwln472NrcwKUjJ6QY=; 20:V9Hv2gmsStHpGuNGn+p+FcXaP8EP7QjkLs2+Z2Klr0wh7jhUaStP3i33jNbKDT8gasNtw9wLEVVkKEjt4cFOpWS60QqMT0oVXmRtXzfGzlFd+nG2F3+PHvT/ZxkP7ybk6OTvApikwgHBdKuUEQ8zveMstqu7ycMFYuzZgVyJsJI= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2016 09:58:20.3964 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0920 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 bc4f7dd..2da2148 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; @@ -273,9 +268,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);