From patchwork Wed Apr 16 21:26:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 28511 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2E960206A6 for ; Wed, 16 Apr 2014 21:30:14 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id jt11sf43012971pbb.7 for ; Wed, 16 Apr 2014 14:30:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=wcv8XtKfK/24gbLULITi6KGb2lHjtmZIiBFEYOqfwIE=; b=DxkmT4Vtf2OlEPkVILcno2nzfuZkrTiTgtNAK/cLYdqvwFBExgYepgVChxZEbUnl8r 9KG5OhDDt6mQck6izoSPNjGMbuxP0ABC3oCyUbNftZ8NlxFwrABF5lheUcvKx/QnWRhs 6y7TTjNhhQY/7TTS5H5jXE7ph/CwwwVUwnTCh7MmVOhLndALsIc8tVkYdwYiOnIVLg40 GVw1NFTNYi5leSxH9kIwx+QypTJqnDSy7pL6jlcZIgMiM2CNDUZp29pYMIucl5IklA1Y o/9GuSxuB3f/UXGlp2HvmX8syxcbyhSs6Ty2Nvas7VPEtMyVIyHehxoCtU4vSoIv3jxW xBvQ== X-Gm-Message-State: ALoCoQkUdhkD1rmso+pwC1Pc6fh21J4OPQZpwluZ/pXz/rYp9f0Bww8OyMPf58tumPicullGwFW7 X-Received: by 10.67.4.202 with SMTP id cg10mr5033418pad.42.1397683813443; Wed, 16 Apr 2014 14:30:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.81 with SMTP id r75ls837965qga.71.gmail; Wed, 16 Apr 2014 14:30:13 -0700 (PDT) X-Received: by 10.220.75.7 with SMTP id w7mr3878916vcj.20.1397683813227; Wed, 16 Apr 2014 14:30:13 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id kj3si3477230vdb.114.2014.04.16.14.30.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Apr 2014 14:30:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id im17so11383791vcb.37 for ; Wed, 16 Apr 2014 14:30:13 -0700 (PDT) X-Received: by 10.221.4.66 with SMTP id ob2mr3119829vcb.28.1397683813099; Wed, 16 Apr 2014 14:30:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp343971vcb; Wed, 16 Apr 2014 14:30:12 -0700 (PDT) X-Received: by 10.68.164.4 with SMTP id ym4mr11242991pbb.53.1397683812382; Wed, 16 Apr 2014 14:30:12 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wt1si13388027pbc.247.2014.04.16.14.30.11; Wed, 16 Apr 2014 14:30:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161139AbaDPV3h (ORCPT + 3 others); Wed, 16 Apr 2014 17:29:37 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:39254 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756765AbaDPV3S (ORCPT ); Wed, 16 Apr 2014 17:29:18 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s3GLSwju032152; Wed, 16 Apr 2014 16:28:58 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3GLSwY0011330; Wed, 16 Apr 2014 16:28:58 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Wed, 16 Apr 2014 16:28:58 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3GLSvh5029944; Wed, 16 Apr 2014 16:28:58 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Greg KH , , Linux OMAP Mailing List , Kishon Vijay Abraham I , Roger Quadros , George Cherian , , , , , David Cohen , Felipe Balbi Subject: [PATCH 7/8] usb: musb: move usb_phy_generic_{un, }register calls to probe()/remove() Date: Wed, 16 Apr 2014 16:26:34 -0500 Message-ID: <1397683595-3606-8-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.9.2.459.g68773ac In-Reply-To: <1397683595-3606-1-git-send-email-balbi@ti.com> References: <1397683595-3606-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch is in preparation to supporting calling those functions multiple times. Signed-off-by: Felipe Balbi --- drivers/usb/musb/am35x.c | 4 ++-- drivers/usb/musb/blackfin.c | 6 +++--- drivers/usb/musb/da8xx.c | 4 ++-- drivers/usb/musb/davinci.c | 4 ++-- drivers/usb/musb/tusb6010.c | 5 ++--- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index 044cd82..05459b5 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.c @@ -360,7 +360,6 @@ static int am35x_musb_init(struct musb *musb) if (!rev) return -ENODEV; - usb_phy_generic_register(); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); if (IS_ERR_OR_NULL(musb->xceiv)) return -EPROBE_DEFER; @@ -402,7 +401,6 @@ static int am35x_musb_exit(struct musb *musb) data->set_phy_power(0); usb_put_phy(musb->xceiv); - usb_phy_generic_unregister(); return 0; } @@ -505,6 +503,7 @@ static int am35x_probe(struct platform_device *pdev) pdata->platform_ops = &am35x_ops; + usb_phy_generic_register(); platform_set_drvdata(pdev, glue); pinfo = am35x_dev_info; @@ -547,6 +546,7 @@ static int am35x_remove(struct platform_device *pdev) struct am35x_glue *glue = platform_get_drvdata(pdev); platform_device_unregister(glue->musb); + usb_phy_generic_unregister(); clk_disable(glue->clk); clk_disable(glue->phy_clk); clk_put(glue->clk); diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index c9992a2..53acffe 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c @@ -401,7 +401,6 @@ static int bfin_musb_init(struct musb *musb) } gpio_direction_output(musb->config->gpio_vrsel, 0); - usb_phy_generic_register(); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); if (IS_ERR_OR_NULL(musb->xceiv)) { gpio_free(musb->config->gpio_vrsel); @@ -424,9 +423,8 @@ static int bfin_musb_init(struct musb *musb) static int bfin_musb_exit(struct musb *musb) { gpio_free(musb->config->gpio_vrsel); - usb_put_phy(musb->xceiv); - usb_phy_generic_unregister(); + return 0; } @@ -477,6 +475,7 @@ static int bfin_probe(struct platform_device *pdev) pdata->platform_ops = &bfin_ops; + usb_phy_generic_register(); platform_set_drvdata(pdev, glue); memset(musb_resources, 0x00, sizeof(*musb_resources) * @@ -528,6 +527,7 @@ static int bfin_remove(struct platform_device *pdev) struct bfin_glue *glue = platform_get_drvdata(pdev); platform_device_unregister(glue->musb); + usb_phy_generic_unregister(); kfree(glue); return 0; diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index a0dabb0..024751f 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -418,7 +418,6 @@ static int da8xx_musb_init(struct musb *musb) if (!rev) goto fail; - usb_phy_generic_register(); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); if (IS_ERR_OR_NULL(musb->xceiv)) { ret = -EPROBE_DEFER; @@ -453,7 +452,6 @@ static int da8xx_musb_exit(struct musb *musb) phy_off(); usb_put_phy(musb->xceiv); - usb_phy_generic_unregister(); return 0; } @@ -512,6 +510,7 @@ static int da8xx_probe(struct platform_device *pdev) pdata->platform_ops = &da8xx_ops; + usb_phy_generic_register(); platform_set_drvdata(pdev, glue); memset(musb_resources, 0x00, sizeof(*musb_resources) * @@ -561,6 +560,7 @@ static int da8xx_remove(struct platform_device *pdev) struct da8xx_glue *glue = platform_get_drvdata(pdev); platform_device_unregister(glue->musb); + usb_phy_generic_unregister(); clk_disable(glue->clk); clk_put(glue->clk); kfree(glue); diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 7370354..de8492b 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -381,7 +381,6 @@ static int davinci_musb_init(struct musb *musb) u32 revision; int ret = -ENODEV; - usb_phy_generic_register(); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); if (IS_ERR_OR_NULL(musb->xceiv)) { ret = -EPROBE_DEFER; @@ -487,7 +486,6 @@ static int davinci_musb_exit(struct musb *musb) phy_off(); usb_put_phy(musb->xceiv); - usb_phy_generic_unregister(); return 0; } @@ -545,6 +543,7 @@ static int davinci_probe(struct platform_device *pdev) pdata->platform_ops = &davinci_ops; + usb_phy_generic_register(); platform_set_drvdata(pdev, glue); memset(musb_resources, 0x00, sizeof(*musb_resources) * @@ -603,6 +602,7 @@ static int davinci_remove(struct platform_device *pdev) struct davinci_glue *glue = platform_get_drvdata(pdev); platform_device_unregister(glue->musb); + usb_phy_generic_unregister(); clk_disable(glue->clk); clk_put(glue->clk); kfree(glue); diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 8d4a819..e1da199 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -1065,7 +1065,6 @@ static int tusb_musb_init(struct musb *musb) void __iomem *sync = NULL; int ret; - usb_phy_generic_register(); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); if (IS_ERR_OR_NULL(musb->xceiv)) return -EPROBE_DEFER; @@ -1117,7 +1116,6 @@ done: iounmap(sync); usb_put_phy(musb->xceiv); - usb_phy_generic_unregister(); } return ret; } @@ -1133,7 +1131,6 @@ static int tusb_musb_exit(struct musb *musb) iounmap(musb->sync_va); usb_put_phy(musb->xceiv); - usb_phy_generic_unregister(); return 0; } @@ -1176,6 +1173,7 @@ static int tusb_probe(struct platform_device *pdev) pdata->platform_ops = &tusb_ops; + usb_phy_generic_register(); platform_set_drvdata(pdev, glue); memset(musb_resources, 0x00, sizeof(*musb_resources) * @@ -1224,6 +1222,7 @@ static int tusb_remove(struct platform_device *pdev) struct tusb6010_glue *glue = platform_get_drvdata(pdev); platform_device_unregister(glue->musb); + usb_phy_generic_unregister(); kfree(glue); return 0;