All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@freescale.com>
To: "Antoine Ténart" <antoine.tenart@free-electrons.com>
Cc: <balbi@ti.com>, <gregkh@linuxfoundation.org>, <kishon@ti.com>,
	<stern@rowland.harvard.edu>, <sergei.shtylyov@cogentembedded.com>,
	<yoshihiro.shimoda.uh@renesas.com>,
	<alexandre.belloni@free-electrons.com>,
	<thomas.petazzoni@free-electrons.com>, <zmxu@marvell.com>,
	<jszhang@marvell.com>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 6/8] usb: allow to supply the PHY in the drivers when using HCD
Date: Wed, 23 Jul 2014 18:59:41 +0800	[thread overview]
Message-ID: <20140723105940.GA5071@shlinux1.ap.freescale.net> (raw)
In-Reply-To: <1405435156-27297-7-git-send-email-antoine.tenart@free-electrons.com>

On Tue, Jul 15, 2014 at 04:39:14PM +0200, Antoine Ténart wrote:
> This patch modify the generic code handling PHYs to allow them to be
> supplied from the drivers. This adds checks to ensure no PHY was already
> there when looking for one in the generic code. This also makes sure we
> do not modify its state in the generic HCD functions, it it was
> provided by the driver.

one extra "it"

> 
> Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com>
> ---
>  drivers/usb/core/hcd.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 228bad89f09b..ce9ea309ab0f 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2650,7 +2650,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
>  		}
>  	}
>  
> -	if (IS_ENABLED(CONFIG_GENERIC_PHY)) {
> +	if (IS_ENABLED(CONFIG_GENERIC_PHY) && !hcd->phy) {
>  		struct phy *phy = phy_get(hcd->self.controller, "usb");
>  
>  		if (IS_ERR(phy)) {
> @@ -2670,6 +2670,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
>  				goto err_phy;
>  			}
>  			hcd->phy = phy;
> +			hcd->remove_phy = 1;
>  		}
>  	}
>  
> @@ -2816,7 +2817,7 @@ err_allocate_root_hub:
>  err_register_bus:
>  	hcd_buffer_destroy(hcd);
>  err_create_buf:
> -	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->phy) {
> +	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
>  		phy_power_off(hcd->phy);
>  		phy_exit(hcd->phy);
>  		phy_put(hcd->phy);
> @@ -2900,7 +2901,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
>  	usb_deregister_bus(&hcd->self);
>  	hcd_buffer_destroy(hcd);
>  
> -	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->phy) {
> +	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {
>  		phy_power_off(hcd->phy);
>  		phy_exit(hcd->phy);
>  		phy_put(hcd->phy);
> -- 
> 1.9.1
> 

-- 

Best Regards,
Peter Chen

  reply	other threads:[~2014-07-23 11:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 14:39 [PATCH v2 0/8] usb: add support for the generic PHY framework Antoine Ténart
2014-07-15 14:39 ` [PATCH v2 1/8] usb: move the OTG state from the USB PHY to the OTG structure Antoine Ténart
2014-07-15 14:39 ` [PATCH v2 2/8] usb: rename phy to usb_phy in OTG Antoine Ténart
2014-07-15 14:39 ` [PATCH v2 3/8] usb: add support to the generic PHY framework " Antoine Ténart
2014-07-15 14:39 ` [PATCH v2 4/8] usb: rename phy to usb_phy in HCD Antoine Ténart
2014-07-15 15:55   ` Sergei Shtylyov
2014-07-16 15:09     ` Felipe Balbi
2014-07-16 17:02       ` Sergei Shtylyov
2014-07-15 14:39 ` [PATCH v2 5/8] usb: rename gen_phy to phy " Antoine Ténart
2014-07-15 14:39 ` [PATCH v2 6/8] usb: allow to supply the PHY in the drivers when using HCD Antoine Ténart
2014-07-23 10:59   ` Peter Chen [this message]
2014-07-15 14:39 ` [PATCH v2 7/8] usb: rename transceiver and phy to usb_phy in ChipIdea Antoine Ténart
2014-07-24 11:12   ` Peter Chen
2014-07-15 14:39 ` [PATCH v2 8/8] usb: chipidea: add support to the generic PHY framework " Antoine Ténart
2014-07-24 11:39   ` Peter Chen
2014-07-24 12:25     ` Antoine Ténart
2014-07-25  0:34       ` Peter Chen
2014-07-25  8:13         ` Antoine Ténart
2014-07-25  8:33           ` Peter Chen
2014-07-25  8:38             ` Antoine Ténart
2014-07-15 15:58 ` [PATCH v2 0/8] usb: add support for the generic PHY framework Alan Stern
2014-07-16 17:45 ` Felipe Balbi
2014-07-17  8:03   ` Antoine Ténart
2014-07-17 17:23     ` Felipe Balbi
2014-07-23 11:36 ` Peter Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140723105940.GA5071@shlinux1.ap.freescale.net \
    --to=peter.chen@freescale.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=antoine.tenart@free-electrons.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jszhang@marvell.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=stern@rowland.harvard.edu \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    --cc=zmxu@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.