Re: [PATCH v2 6/8] usb: allow to supply the PHY in the drivers when using HCD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux