From patchwork Mon Apr 21 15:56:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 28716 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 81E732032B for ; Mon, 21 Apr 2014 16:00:00 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rp16sf19748703pbb.9 for ; Mon, 21 Apr 2014 08:59:59 -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=g0Ug58RWyx6k+bIxNq3yeDytWF/qDFXpTaYgTeOotWou80OWuIWY8VuEX5TrUubwBQ zclr2HqQBIo3HyxsreIHisad1gkp5s9XbVfMH0AKSFsTZSzD9VCEqob11oPQlPMy5xaH FUT28hTZS68vJwu1Jk0CzMAxC/AGOEy9k8PuVmUYIoSwAi9FbcetrC1Lm+A+6LfQmv+G 3KTLV4B/O/1JIedD+e3jHeaGaSTMW/uYgPw/D5/UgpiQTMHEy3/MVp8UAaRl59n4CmYc 5Df0ZtZB6FoarQMgn/l5OVH/CofYwrVLtFAx9ibRERQLG6QxyIPRhgai7uHtU01Efwee H+Hg== X-Gm-Message-State: ALoCoQn/crWhdvGGTh5odga850IvFFNxJ7sWQCUX14iAVcTEEu6zprZUibl3ifu8xe/5hyMYSs4F X-Received: by 10.66.192.232 with SMTP id hj8mr18772073pac.2.1398095999789; Mon, 21 Apr 2014 08:59:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.10 with SMTP id l10ls2039245qga.4.gmail; Mon, 21 Apr 2014 08:59:59 -0700 (PDT) X-Received: by 10.52.34.4 with SMTP id v4mr574691vdi.42.1398095999654; Mon, 21 Apr 2014 08:59:59 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id eb17si6306261veb.76.2014.04.21.08.59.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 08:59:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id lg15so1194793vcb.30 for ; Mon, 21 Apr 2014 08:59:59 -0700 (PDT) X-Received: by 10.58.230.103 with SMTP id sx7mr1245812vec.28.1398095999570; Mon, 21 Apr 2014 08:59:59 -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 ib8csp300571vcb; Mon, 21 Apr 2014 08:59:59 -0700 (PDT) X-Received: by 10.66.171.76 with SMTP id as12mr39005481pac.52.1398095998039; Mon, 21 Apr 2014 08:59:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10si21056502paw.333.2014.04.21.08.59.57; Mon, 21 Apr 2014 08:59:57 -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 S1752361AbaDUP7y (ORCPT + 3 others); Mon, 21 Apr 2014 11:59:54 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:50767 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbaDUP7X (ORCPT ); Mon, 21 Apr 2014 11:59:23 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s3LFxKvp013735; Mon, 21 Apr 2014 10:59:20 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3LFxKAm020728; Mon, 21 Apr 2014 10:59:20 -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; Mon, 21 Apr 2014 10:59:19 -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 s3LFxJUq011925; Mon, 21 Apr 2014 10:59:20 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Linux OMAP Mailing List , , Tony Lindgren , Felipe Balbi Subject: [PATCH 08/10] usb: musb: move usb_phy_generic_{un, }register calls to probe()/remove() Date: Mon, 21 Apr 2014 10:56:50 -0500 Message-ID: <1398095812-14222-9-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.9.2.459.g68773ac In-Reply-To: <1398095812-14222-1-git-send-email-balbi@ti.com> References: <1398095812-14222-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.171 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;