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: 4101891 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 88A389F467 for ; Fri, 2 May 2014 12:49:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B887A20373 for ; Fri, 2 May 2014 12:49:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D033320377 for ; Fri, 2 May 2014 12:49:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbaEBMr7 (ORCPT ); Fri, 2 May 2014 08:47:59 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:53155 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987AbaEBMr5 (ORCPT ); Fri, 2 May 2014 08:47:57 -0400 Received: by mail-pd0-f179.google.com with SMTP id g10so2411777pdj.10 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 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, t.figa@samsung.com, k.debski@samsung.com, jg1.han@samsung.com, Vivek Gautam 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> 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 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);