From patchwork Mon May 5 05:03:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4111721 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1D55CBFF02 for ; Mon, 5 May 2014 05:03:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3526920396 for ; Mon, 5 May 2014 05:03:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47F6120384 for ; Mon, 5 May 2014 05:03:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754274AbaEEFDz (ORCPT ); Mon, 5 May 2014 01:03:55 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:50355 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751843AbaEEFDy (ORCPT ); Mon, 5 May 2014 01:03:54 -0400 Received: by mail-pa0-f48.google.com with SMTP id rd3so218960pab.7 for ; Sun, 04 May 2014 22:03:53 -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=xzL0YYb+kcLM6BiOIyl56LxtjRfQikHLG9xbsfTUJBY=; b=rABvAzT/tfRN3L5bB9jDioUQOBslo6sq5iAtD96+zMLgavyov30fYsi/Mvbg9RJtOi ZJPiqJ6Z3foG7VPM5mfw2Dm2ET99HhfgM0alfikyTrkwbR3853hPqeH55PnuT44M1AaJ uWq/8JHBSRRh3ZkQ/8bXbGSOEGX39K7St8ejAVBAtOUchWBBv/iPvmzdXPcFZl0apXx9 eCBACJ1YBIad6yW77ZvXBfcP2AR40qLBD4oYy8aIHzW+8MkyUGLbQlYEzRBatOy4WR1X j0Nz8RztZsaGJTlJ2xvaSxmMgbgxrRORUUiMCXKG2ha5qqTFvJG4Orgv3SwbrUYunTNx jqWA== X-Received: by 10.66.253.33 with SMTP id zx1mr67959467pac.28.1399266233395; Sun, 04 May 2014 22:03:53 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id ff4sm61697749pad.24.2014.05.04.22.03.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 04 May 2014 22:03:52 -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 v4 1/4] usb: ohci-exynos: Use struct device instead of platform_device Date: Mon, 5 May 2014 10:33:42 +0530 Message-Id: <1399266222-31802-1-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399034855-9686-2-git-send-email-gautam.vivek@samsung.com> References: <1399034855-9686-2-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=ham 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 Acked-by: Kukjin Kim --- Changes since v1: - 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);