From patchwork Mon Apr 28 09:25:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4076031 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5C2879F271 for ; Mon, 28 Apr 2014 09:28:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 714C920274 for ; Mon, 28 Apr 2014 09:28:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88CA020270 for ; Mon, 28 Apr 2014 09:28:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754367AbaD1J16 (ORCPT ); Mon, 28 Apr 2014 05:27:58 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:39688 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754753AbaD1JZv (ORCPT ); Mon, 28 Apr 2014 05:25:51 -0400 Received: by mail-pa0-f45.google.com with SMTP id kq14so4939670pab.4 for ; Mon, 28 Apr 2014 02:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5hiOPVIXib2JvQFhvUS3lKCs9W/xitokVmlyTBI7tPM=; b=nD/d0XQrp2AYbjxVzXk13O58+jh6R2vbB4GnmGghXjEM4RHAAkjUHCgiJahY+TgZmS pc8o3Pgbkgg0s49NACqyUjEAK7NsD+JgyWV9Gm+L7syyoa2Eb8Kp9yN4sayXHpNaYJSC frIo0RygG1SctyGhUskgrZGnI9cpm00OavWdy3DINcPIbQWWPBRl9rlte1RerJN4GwI4 svoKCsrnHoednUEPTzjKvFu2S05GxkecYK96Q/oGPng3omWQ2HYZzZUdBQhJCV8Trex2 ZwHi+R4LqT9EDs37XPMW9tf/hC22WZ4Xwd/fNj73VvDzwP1eVqnYXcxrX8ZAPIYWq0ax kdnA== X-Received: by 10.68.96.225 with SMTP id dv1mr27883128pbb.30.1398677150289; Mon, 28 Apr 2014 02:25:50 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id xz7sm88411846pac.3.2014.04.28.02.25.45 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 02:25:49 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, balbi@ti.com, kgene.kim@samsung.com, k.debski@samsung.com, Vivek Gautam , Jingoo Han , Alan Stern Subject: [PATCH 1/4] usb: ohci-exynos: Use struct device instead of platform_device Date: Mon, 28 Apr 2014 14:55:29 +0530 Message-Id: <1398677132-30600-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1398677132-30600-1-git-send-email-gautam.vivek@samsung.com> References: <1398677132-30600-1-git-send-email-gautam.vivek@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Change to use struct device instead of struct platform_device for some static functions. Signed-off-by: Vivek Gautam Cc: Jingoo Han Cc: Alan Stern Acked-by: Jingoo Han --- drivers/usb/host/ohci-exynos.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 9cf80cb..05f00e3 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -39,18 +39,18 @@ struct exynos_ohci_hcd { struct usb_otg *otg; }; -static void exynos_ohci_phy_enable(struct platform_device *pdev) +static void exynos_ohci_phy_enable(struct device *dev) { - struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); if (exynos_ohci->phy) usb_phy_init(exynos_ohci->phy); } -static void exynos_ohci_phy_disable(struct platform_device *pdev) +static void exynos_ohci_phy_disable(struct device *dev) { - struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); if (exynos_ohci->phy) @@ -139,7 +139,7 @@ skip_phy: platform_set_drvdata(pdev, hcd); - exynos_ohci_phy_enable(pdev); + exynos_ohci_phy_enable(&pdev->dev); err = usb_add_hcd(hcd, irq, IRQF_SHARED); if (err) { @@ -150,7 +150,7 @@ skip_phy: return 0; fail_add_hcd: - exynos_ohci_phy_disable(pdev); + exynos_ohci_phy_disable(&pdev->dev); fail_io: clk_disable_unprepare(exynos_ohci->clk); fail_clk: @@ -168,7 +168,7 @@ static int exynos_ohci_remove(struct platform_device *pdev) if (exynos_ohci->otg) exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); - exynos_ohci_phy_disable(pdev); + exynos_ohci_phy_disable(&pdev->dev); clk_disable_unprepare(exynos_ohci->clk); @@ -190,7 +190,6 @@ static int exynos_ohci_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); - struct platform_device *pdev = to_platform_device(dev); bool do_wakeup = device_may_wakeup(dev); int rc = ohci_suspend(hcd, do_wakeup); @@ -200,7 +199,7 @@ static int exynos_ohci_suspend(struct device *dev) if (exynos_ohci->otg) exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); - exynos_ohci_phy_disable(pdev); + exynos_ohci_phy_disable(dev); clk_disable_unprepare(exynos_ohci->clk); @@ -211,14 +210,13 @@ static int exynos_ohci_resume(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); - struct platform_device *pdev = to_platform_device(dev); clk_prepare_enable(exynos_ohci->clk); if (exynos_ohci->otg) exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); - exynos_ohci_phy_enable(pdev); + exynos_ohci_phy_enable(dev); ohci_resume(hcd, false);