From patchwork Fri May 2 12:47:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4101901 Return-Path: X-Original-To: patchwork-linux-arm@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 A473E9F271 for ; Fri, 2 May 2014 12:51:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDBAD20375 for ; Fri, 2 May 2014 12:51:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 063F720373 for ; Fri, 2 May 2014 12:51:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WgCt5-0002TQ-0J; Fri, 02 May 2014 12:48:23 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WgCt1-0002SO-QO for linux-arm-kernel@lists.infradead.org; Fri, 02 May 2014 12:48:20 +0000 Received: by mail-pa0-f50.google.com with SMTP id rd3so5303365pab.23 for ; Fri, 02 May 2014 05:47:57 -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=g4NMSIk6CCyVxZyBdz3F9SMrhhSbJ0++l+QxadUovdU=; b=dS4NM7Js5Bz+dyby+vSldm2kuw70pDEI+XEM2S2c5Scf4on6n0kBJaddtuNSUEirNa j8IqdpjU3lmsTVcE6EPrlZfUrYAYHIOzkHware5cI9bMbx2MZgxjyQxFNrF4GdQDWkXt +vo4QobuOFln4y1c0RmhLmsxIWHWIO8tYlJDOrWBJa7Yv7Nlt11CVJn77i+3FGo11GXM vr7X7NpG5XsghiNBhUN2pw9x4n1bdrSYedoOuO1TXd6AcY9W8BkL069ZUd/0sFUEVBPN k8g6Igb2PwdLUCR3njVINw3wg2pEV0n/LDcPGhL0/y4glS1T2YPKZYwejhmtrLStH+uF df2Q== X-Received: by 10.66.252.69 with SMTP id zq5mr34822058pac.54.1399034876831; Fri, 02 May 2014 05:47:56 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id lr3sm181078163pab.4.2014.05.02.05.47.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 05:47:55 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v3 1/4] usb: ohci-exynos: Use struct device instead of platform_device Date: Fri, 2 May 2014 18:17:32 +0530 Message-Id: <1399034855-9686-2-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399034855-9686-1-git-send-email-gautam.vivek@samsung.com> References: <1399034855-9686-1-git-send-email-gautam.vivek@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140502_054819_896827_97F1C54D X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: 0.2 (/) Cc: devicetree@vger.kernel.org, k.debski@samsung.com, kgene.kim@samsung.com, linux-doc@vger.kernel.org, gregkh@linuxfoundation.org, t.figa@samsung.com, jg1.han@samsung.com, linux-kernel@vger.kernel.org, balbi@ti.com, Vivek Gautam , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Acked-by: Alan Stern Acked-by: Jingoo Han --- Changes from v2: - none 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);